mad.c (bc030d6cb9532877c1c5a3f5e7123344fa24a285) | mad.c (1397490938aa0aca39001c3fd5a9fc9387110d86) |
---|---|
1/* 2 * Copyright (c) 2007 Cisco Systems, Inc. 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: --- 197 unchanged lines hidden (view full) --- 206 int qpn = mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_LID_ROUTED; 207 struct ib_mad_send_buf *send_buf; 208 struct ib_mad_agent *agent = dev->send_agent[port_num - 1][qpn]; 209 int ret; 210 211 if (agent) { 212 send_buf = ib_create_send_mad(agent, qpn, 0, 0, IB_MGMT_MAD_HDR, 213 IB_MGMT_MAD_DATA, GFP_ATOMIC); | 1/* 2 * Copyright (c) 2007 Cisco Systems, Inc. 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: --- 197 unchanged lines hidden (view full) --- 206 int qpn = mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_LID_ROUTED; 207 struct ib_mad_send_buf *send_buf; 208 struct ib_mad_agent *agent = dev->send_agent[port_num - 1][qpn]; 209 int ret; 210 211 if (agent) { 212 send_buf = ib_create_send_mad(agent, qpn, 0, 0, IB_MGMT_MAD_HDR, 213 IB_MGMT_MAD_DATA, GFP_ATOMIC); |
214 if (IS_ERR(send_buf)) 215 return; |
|
214 /* 215 * We rely here on the fact that MLX QPs don't use the 216 * address handle after the send is posted (this is 217 * wrong following the IB spec strictly, but we know 218 * it's OK for our devices). 219 */ 220 spin_lock(&dev->sm_lock); 221 memcpy(send_buf->mad, mad, sizeof *mad); --- 141 unchanged lines hidden --- | 216 /* 217 * We rely here on the fact that MLX QPs don't use the 218 * address handle after the send is posted (this is 219 * wrong following the IB spec strictly, but we know 220 * it's OK for our devices). 221 */ 222 spin_lock(&dev->sm_lock); 223 memcpy(send_buf->mad, mad, sizeof *mad); --- 141 unchanged lines hidden --- |