diff options
author | Ralph Campbell <ralph.campbell@qlogic.com> | 2008-04-17 00:09:26 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-17 00:09:26 -0400 |
commit | c4b4d16e090e1b68d1d4d20a28757070982b9725 (patch) | |
tree | 4ccc895d5effc5789d7e81182cc4ac76cb6f2c74 /drivers/infiniband/hw/ipath/ipath_diag.c | |
parent | 4330e4dad780467d930b394b5119c0218a1e2dbe (diff) |
IB/ipath: Make send buffers available for kernel if not allocated to user
A fixed partitioning of send buffers is determined at driver load time
for user processes and kernel use. Since send buffers are a scarce
resource, it makes sense to allow the kernel to use the buffers if they
are not in use by a user process.
Also, eliminate code duplication for ipath_force_pio_avail_update().
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_diag.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_diag.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_diag.c b/drivers/infiniband/hw/ipath/ipath_diag.c index 96a1c4172f87..af59bf380ca2 100644 --- a/drivers/infiniband/hw/ipath/ipath_diag.c +++ b/drivers/infiniband/hw/ipath/ipath_diag.c | |||
@@ -439,7 +439,9 @@ static ssize_t ipath_diagpkt_write(struct file *fp, | |||
439 | goto bail; | 439 | goto bail; |
440 | } | 440 | } |
441 | 441 | ||
442 | piobuf = ipath_getpiobuf(dd, &pbufn); | 442 | plen >>= 2; /* in dwords */ |
443 | |||
444 | piobuf = ipath_getpiobuf(dd, plen, &pbufn); | ||
443 | if (!piobuf) { | 445 | if (!piobuf) { |
444 | ipath_cdbg(VERBOSE, "No PIO buffers avail unit for %u\n", | 446 | ipath_cdbg(VERBOSE, "No PIO buffers avail unit for %u\n", |
445 | dd->ipath_unit); | 447 | dd->ipath_unit); |
@@ -449,8 +451,6 @@ static ssize_t ipath_diagpkt_write(struct file *fp, | |||
449 | /* disarm it just to be extra sure */ | 451 | /* disarm it just to be extra sure */ |
450 | ipath_disarm_piobufs(dd, pbufn, 1); | 452 | ipath_disarm_piobufs(dd, pbufn, 1); |
451 | 453 | ||
452 | plen >>= 2; /* in dwords */ | ||
453 | |||
454 | if (ipath_debug & __IPATH_PKTDBG) | 454 | if (ipath_debug & __IPATH_PKTDBG) |
455 | ipath_cdbg(VERBOSE, "unit %u 0x%x+1w pio%d\n", | 455 | ipath_cdbg(VERBOSE, "unit %u 0x%x+1w pio%d\n", |
456 | dd->ipath_unit, plen - 1, pbufn); | 456 | dd->ipath_unit, plen - 1, pbufn); |