[ofa-general] [PATCH] for-2.6.23 ib/umad: add partition support
Sean Hefty
sean.hefty at intel.com
Fri Jun 15 09:34:55 PDT 2007
In order to support multiple partitions, user_mad needs to handle
different pkey's. PKeys must be specified by the user when sending
and receiving MADs. This bumps the ABI.
Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
If there are no objections, I will queue this patch for 2.6.23, and request
a pull when 2.6.23 is closer.
drivers/infiniband/core/user_mad.c | 5 +++--
include/rdma/ib_user_mad.h | 4 +++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index d97ded2..b0128fa 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -228,6 +228,7 @@ static void recv_handler(struct ib_mad_agent *agent,
packet->mad.hdr.lid = cpu_to_be16(mad_recv_wc->wc->slid);
packet->mad.hdr.sl = mad_recv_wc->wc->sl;
packet->mad.hdr.path_bits = mad_recv_wc->wc->dlid_path_bits;
+ packet->mad.hdr.pkey_index = mad_recv_wc->wc->pkey_index;
packet->mad.hdr.grh_present = !!(mad_recv_wc->wc->wc_flags & IB_WC_GRH);
if (packet->mad.hdr.grh_present) {
struct ib_ah_attr ah_attr;
@@ -503,8 +504,8 @@ static ssize_t ib_umad_write(struct file *filp, const char __user
*buf,
data_len = count - sizeof (struct ib_user_mad) - hdr_len;
packet->msg = ib_create_send_mad(agent,
be32_to_cpu(packet->mad.hdr.qpn),
- 0, rmpp_active, hdr_len,
- data_len, GFP_KERNEL);
+ packet->mad.hdr.pkey_index, rmpp_active,
+ hdr_len, data_len, GFP_KERNEL);
if (IS_ERR(packet->msg)) {
ret = PTR_ERR(packet->msg);
goto err_ah;
diff --git a/include/rdma/ib_user_mad.h b/include/rdma/ib_user_mad.h
index d66b15e..e7bf6fa 100644
--- a/include/rdma/ib_user_mad.h
+++ b/include/rdma/ib_user_mad.h
@@ -43,7 +43,7 @@
* Increment this value if any changes that break userspace ABI
* compatibility are made.
*/
-#define IB_USER_MAD_ABI_VERSION 5
+#define IB_USER_MAD_ABI_VERSION 6
/*
* Make sure that all structs defined in this file remain laid out so
@@ -88,6 +88,8 @@ struct ib_user_mad_hdr {
__u8 traffic_class;
__u8 gid[16];
__be32 flow_label;
+ __u16 pkey_index;
+ __u8 reserved[6];
};
/**
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4370 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20070615/89a18e94/attachment.bin>
More information about the general
mailing list