summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHal Rosenstock <halr@voltaire.com>2005-09-19 22:51:01 +0200
committerRoland Dreier <rolandd@cisco.com>2005-09-19 22:51:01 +0200
commiteff4c654b1a4a5e5493fbdc3affa6dd48765c085 (patch)
tree1ddbbdaa978b310f5ac11b9778ac8e5f775d0783 /drivers
parent[PATCH] IB/mthca: Don't try to set srq->last for userspace SRQs (diff)
downloadlinux-eff4c654b1a4a5e5493fbdc3affa6dd48765c085.tar.xz
linux-eff4c654b1a4a5e5493fbdc3affa6dd48765c085.zip
[PATCH] IB: Fix data length for RMPP SA sends
We need to subtract off the header length from our payload length when sending multi-packet SA messages. Signed-off-by: Hal Rosenstock <halr@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/user_mad.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 7c2f03057ddb..a64d6b4dcc16 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -334,10 +334,11 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
ret = -EINVAL;
goto err_ah;
}
- /* Validate that management class can support RMPP */
+
+ /* Validate that the management class can support RMPP */
if (rmpp_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_ADM) {
hdr_len = offsetof(struct ib_sa_mad, data);
- data_len = length;
+ data_len = length - hdr_len;
} else if ((rmpp_mad->mad_hdr.mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START) &&
(rmpp_mad->mad_hdr.mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END)) {
hdr_len = offsetof(struct ib_vendor_mad, data);