aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_diag.c
diff options
context:
space:
mode:
authorRalph Campbell <ralph.campbell@qlogic.com>2008-04-16 21:09:26 -0700
committerRoland Dreier <rolandd@cisco.com>2008-04-16 21:09:26 -0700
commitc4b4d16e090e1b68d1d4d20a28757070982b9725 (patch)
tree4ccc895d5effc5789d7e81182cc4ac76cb6f2c74 /drivers/infiniband/hw/ipath/ipath_diag.c
parent4330e4dad780467d930b394b5119c0218a1e2dbe (diff)
downloadkernel_samsung_smdk4412-c4b4d16e090e1b68d1d4d20a28757070982b9725.zip
kernel_samsung_smdk4412-c4b4d16e090e1b68d1d4d20a28757070982b9725.tar.gz
kernel_samsung_smdk4412-c4b4d16e090e1b68d1d4d20a28757070982b9725.tar.bz2
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.c6
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 96a1c41..af59bf3 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,
goto bail;
}
- piobuf = ipath_getpiobuf(dd, &pbufn);
+ plen >>= 2; /* in dwords */
+
+ piobuf = ipath_getpiobuf(dd, plen, &pbufn);
if (!piobuf) {
ipath_cdbg(VERBOSE, "No PIO buffers avail unit for %u\n",
dd->ipath_unit);
@@ -449,8 +451,6 @@ static ssize_t ipath_diagpkt_write(struct file *fp,
/* disarm it just to be extra sure */
ipath_disarm_piobufs(dd, pbufn, 1);
- plen >>= 2; /* in dwords */
-
if (ipath_debug & __IPATH_PKTDBG)
ipath_cdbg(VERBOSE, "unit %u 0x%x+1w pio%d\n",
dd->ipath_unit, plen - 1, pbufn);