mad.c (1724c7c0c9494dcbdd7f630f29e1e8427cb231d1) mad.c (62ede7779904bc75bdd84f1ff0016113956ce3b4)
1/*
2 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 64 unchanged lines hidden (view full) ---

73
74static int process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
75 const struct ib_wc *in_wc, const struct ib_grh *in_grh,
76 const struct ib_mad *in_mad, struct ib_mad *out_mad)
77{
78 u16 slid;
79 int err;
80
1/*
2 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 64 unchanged lines hidden (view full) ---

73
74static int process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
75 const struct ib_wc *in_wc, const struct ib_grh *in_grh,
76 const struct ib_mad *in_mad, struct ib_mad *out_mad)
77{
78 u16 slid;
79 int err;
80
81 slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
81 slid = in_wc ? ib_lid_cpu16(in_wc->slid) : be16_to_cpu(IB_LID_PERMISSIVE);
82
83 if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0)
84 return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
85
86 if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
87 in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
88 if (in_mad->mad_hdr.method != IB_MGMT_METHOD_GET &&
89 in_mad->mad_hdr.method != IB_MGMT_METHOD_SET &&

--- 513 unchanged lines hidden ---
82
83 if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0)
84 return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
85
86 if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
87 in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
88 if (in_mad->mad_hdr.method != IB_MGMT_METHOD_GET &&
89 in_mad->mad_hdr.method != IB_MGMT_METHOD_SET &&

--- 513 unchanged lines hidden ---