aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2006-07-20 04:25:50 -0400
committerRoland Dreier <rolandd@cisco.com>2006-07-24 12:18:07 -0400
commit2527e681fd4fd4231c2e04f09d7b04d3cab8eefe (patch)
treec9c4fe05d04bcad941505f9e8d1c3903d9501f6b /include
parent16c59419a09f0140a07a1828d6a45656265e07c7 (diff)
IB/mad: Validate MADs for spec compliance
Validate MADs sent by userspace clients for spec compliance with C13-18.1.1 (prevent duplicate requests and responses sent on the same port). Without this, RMPP transactions get aborted because of duplicate packets. This patch is similar to that provided by Jack Morgenstein. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include')
-rw-r--r--include/rdma/ib_mad.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h
index 5ff77558013b..585d28e960dd 100644
--- a/include/rdma/ib_mad.h
+++ b/include/rdma/ib_mad.h
@@ -75,6 +75,7 @@
75#define IB_MGMT_METHOD_TRAP_REPRESS 0x07 75#define IB_MGMT_METHOD_TRAP_REPRESS 0x07
76 76
77#define IB_MGMT_METHOD_RESP 0x80 77#define IB_MGMT_METHOD_RESP 0x80
78#define IB_BM_ATTR_MOD_RESP cpu_to_be32(1)
78 79
79#define IB_MGMT_MAX_METHODS 128 80#define IB_MGMT_MAX_METHODS 128
80 81
@@ -247,6 +248,12 @@ struct ib_mad_send_buf {
247}; 248};
248 249
249/** 250/**
251 * ib_response_mad - Returns if the specified MAD has been generated in
252 * response to a sent request or trap.
253 */
254int ib_response_mad(struct ib_mad *mad);
255
256/**
250 * ib_get_rmpp_resptime - Returns the RMPP response time. 257 * ib_get_rmpp_resptime - Returns the RMPP response time.
251 * @rmpp_hdr: An RMPP header. 258 * @rmpp_hdr: An RMPP header.
252 */ 259 */