diff options
author | Roland Dreier <rolandd@cisco.com> | 2007-10-09 22:59:15 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-10-09 22:59:15 -0400 |
commit | 2be8e3ee8efd6f99ce454115c29d09750915021a (patch) | |
tree | 00e21e061a18c7bd1339ebbb637de9701863312d /include | |
parent | c01759cee91379cc3cb551bfd7c76f1b51f91ca2 (diff) |
IB/umad: Add P_Key index support
Add support for setting the P_Key index of sent MADs and getting the
P_Key index of received MADs. This requires a change to the layout of
the ABI structure struct ib_user_mad_hdr, so to avoid breaking
compatibility, we default to the old (unchanged) ABI and add a new
ioctl IB_USER_MAD_ENABLE_PKEY that allows applications that are aware
of the new ABI to opt into using it.
We plan on switching to the new ABI by default in a year or so, and
this patch adds a warning that is printed when an application uses the
old ABI, to push people towards converting to the new ABI.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Reviewed-by: Sean Hefty <sean.hefty@intel.com>
Reviewed-by: Hal Rosenstock <hal@xsigo.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/rdma/ib_user_mad.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/rdma/ib_user_mad.h b/include/rdma/ib_user_mad.h index d66b15ea82c4..2a32043d1abd 100644 --- a/include/rdma/ib_user_mad.h +++ b/include/rdma/ib_user_mad.h | |||
@@ -52,7 +52,50 @@ | |||
52 | */ | 52 | */ |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * ib_user_mad_hdr_old - Old version of MAD packet header without pkey_index | ||
56 | * @id - ID of agent MAD received with/to be sent with | ||
57 | * @status - 0 on successful receive, ETIMEDOUT if no response | ||
58 | * received (transaction ID in data[] will be set to TID of original | ||
59 | * request) (ignored on send) | ||
60 | * @timeout_ms - Milliseconds to wait for response (unset on receive) | ||
61 | * @retries - Number of automatic retries to attempt | ||
62 | * @qpn - Remote QP number received from/to be sent to | ||
63 | * @qkey - Remote Q_Key to be sent with (unset on receive) | ||
64 | * @lid - Remote lid received from/to be sent to | ||
65 | * @sl - Service level received with/to be sent with | ||
66 | * @path_bits - Local path bits received with/to be sent with | ||
67 | * @grh_present - If set, GRH was received/should be sent | ||
68 | * @gid_index - Local GID index to send with (unset on receive) | ||
69 | * @hop_limit - Hop limit in GRH | ||
70 | * @traffic_class - Traffic class in GRH | ||
71 | * @gid - Remote GID in GRH | ||
72 | * @flow_label - Flow label in GRH | ||
73 | */ | ||
74 | struct ib_user_mad_hdr_old { | ||
75 | __u32 id; | ||
76 | __u32 status; | ||
77 | __u32 timeout_ms; | ||
78 | __u32 retries; | ||
79 | __u32 length; | ||
80 | __be32 qpn; | ||
81 | __be32 qkey; | ||
82 | __be16 lid; | ||
83 | __u8 sl; | ||
84 | __u8 path_bits; | ||
85 | __u8 grh_present; | ||
86 | __u8 gid_index; | ||
87 | __u8 hop_limit; | ||
88 | __u8 traffic_class; | ||
89 | __u8 gid[16]; | ||
90 | __be32 flow_label; | ||
91 | }; | ||
92 | |||
93 | /** | ||
55 | * ib_user_mad_hdr - MAD packet header | 94 | * ib_user_mad_hdr - MAD packet header |
95 | * This layout allows specifying/receiving the P_Key index. To use | ||
96 | * this capability, an application must call the | ||
97 | * IB_USER_MAD_ENABLE_PKEY ioctl on the user MAD file handle before | ||
98 | * any other actions with the file handle. | ||
56 | * @id - ID of agent MAD received with/to be sent with | 99 | * @id - ID of agent MAD received with/to be sent with |
57 | * @status - 0 on successful receive, ETIMEDOUT if no response | 100 | * @status - 0 on successful receive, ETIMEDOUT if no response |
58 | * received (transaction ID in data[] will be set to TID of original | 101 | * received (transaction ID in data[] will be set to TID of original |
@@ -70,6 +113,7 @@ | |||
70 | * @traffic_class - Traffic class in GRH | 113 | * @traffic_class - Traffic class in GRH |
71 | * @gid - Remote GID in GRH | 114 | * @gid - Remote GID in GRH |
72 | * @flow_label - Flow label in GRH | 115 | * @flow_label - Flow label in GRH |
116 | * @pkey_index - P_Key index | ||
73 | */ | 117 | */ |
74 | struct ib_user_mad_hdr { | 118 | struct ib_user_mad_hdr { |
75 | __u32 id; | 119 | __u32 id; |
@@ -88,6 +132,8 @@ struct ib_user_mad_hdr { | |||
88 | __u8 traffic_class; | 132 | __u8 traffic_class; |
89 | __u8 gid[16]; | 133 | __u8 gid[16]; |
90 | __be32 flow_label; | 134 | __be32 flow_label; |
135 | __u16 pkey_index; | ||
136 | __u8 reserved[6]; | ||
91 | }; | 137 | }; |
92 | 138 | ||
93 | /** | 139 | /** |
@@ -134,4 +180,6 @@ struct ib_user_mad_reg_req { | |||
134 | 180 | ||
135 | #define IB_USER_MAD_UNREGISTER_AGENT _IOW(IB_IOCTL_MAGIC, 2, __u32) | 181 | #define IB_USER_MAD_UNREGISTER_AGENT _IOW(IB_IOCTL_MAGIC, 2, __u32) |
136 | 182 | ||
183 | #define IB_USER_MAD_ENABLE_PKEY _IO(IB_IOCTL_MAGIC, 3) | ||
184 | |||
137 | #endif /* IB_USER_MAD_H */ | 185 | #endif /* IB_USER_MAD_H */ |