From patchwork Thu Jun 3 13:42:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 104104 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o53DeZLu014989 for ; Thu, 3 Jun 2010 13:40:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824Ab0FCNkf (ORCPT ); Thu, 3 Jun 2010 09:40:35 -0400 Received: from qmta04.westchester.pa.mail.comcast.net ([76.96.62.40]:49541 "EHLO qmta04.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753025Ab0FCNke (ORCPT ); Thu, 3 Jun 2010 09:40:34 -0400 Received: from omta12.westchester.pa.mail.comcast.net ([76.96.62.44]) by qmta04.westchester.pa.mail.comcast.net with comcast id RP431e0040xGWP854RgaEb; Thu, 03 Jun 2010 13:40:34 +0000 Received: from hal.comcast.net ([75.69.247.31]) by omta12.westchester.pa.mail.comcast.net with comcast id RRgZ1e00S0hNrtn3YRgZ5N; Thu, 03 Jun 2010 13:40:34 +0000 Received: from hal.comcast.net (localhost.localdomain [127.0.0.1]) by hal.comcast.net (8.14.3/8.14.3) with ESMTP id o53DgR7f012260; Thu, 3 Jun 2010 09:42:33 -0400 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id o53DgAZI012229; Thu, 3 Jun 2010 09:42:10 -0400 Date: Thu, 3 Jun 2010 09:42:09 -0400 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm/osm_sa.c: In osm_sa_respond, only fill in attr offset if RMPP method Message-ID: <20100603134209.GA12225@comcast.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 03 Jun 2010 13:40:36 +0000 (UTC) diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c index 0aca81f..8325632 100644 --- a/opensm/opensm/osm_sa.c +++ b/opensm/opensm/osm_sa.c @@ -3,6 +3,7 @@ * Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * Copyright (c) 2008 Xsigo Systems Inc. All rights reserved. + * Copyright (c) 2010 HNR Consulting. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -454,8 +455,15 @@ void osm_sa_respond(osm_sa_t *sa, osm_madw_t *madw, size_t attr_size, /* C15-0.1.5 - always return SM_Key = 0 (table 185 p 884) */ resp_sa_mad->sm_key = 0; - /* Fill in the offset (paylen will be done by the rmpp SAR) */ - resp_sa_mad->attr_offset = num_rec ? ib_get_attr_offset(attr_size) : 0; +#ifdef DUAL_SIDED_RMPP + if (resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP || + resp_sa_mad->method == IB_MAD_METHOD_GETMULTI_RESP) { +#else + if (resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP) { +#endif + /* Fill in the offset (paylen will be done by the rmpp SAR) */ + resp_sa_mad->attr_offset = num_rec ? ib_get_attr_offset(attr_size) : 0; + } p = ib_sa_mad_get_payload_ptr(resp_sa_mad);