From patchwork Tue Apr 11 15:28:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 9675617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E6B7060382 for ; Tue, 11 Apr 2017 15:29:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D746B28613 for ; Tue, 11 Apr 2017 15:29:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB43328619; Tue, 11 Apr 2017 15:29:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BCEE28613 for ; Tue, 11 Apr 2017 15:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753896AbdDKP3e (ORCPT ); Tue, 11 Apr 2017 11:29:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42352 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753874AbdDKP3Y (ORCPT ); Tue, 11 Apr 2017 11:29:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 392138AE72; Tue, 11 Apr 2017 15:29:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 392138AE72 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=honli@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 392138AE72 Received: from dhcp-13-42.nay.redhat.com (unknown [10.66.128.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id A834618B8F; Tue, 11 Apr 2017 15:29:22 +0000 (UTC) From: Honggang LI To: linux-rdma@vger.kernel.org Cc: sagig@mellanox.com, bart.vanassche@sandisk.com, Honggang Li Subject: [rdma-core/srp_daemon PATCH] Correct method field for PathRecord request Date: Tue, 11 Apr 2017 23:28:53 +0800 Message-Id: <1491924533-2548-1-git-send-email-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 11 Apr 2017 15:29:24 +0000 (UTC) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Honggang Li According to InfiniBand Architecture Release 1.2.1, Table 208 Example PathRecord Request MAD Header Fields, MADHeader:Method should setup to 0x12 (SubnAdmGetTable()). Before send the MAD packet for PathRecord request, init_srp_mad setup out_mad->method to SRP_MAD_METHOD_GET (0x01) for get_shared_pkeys. But get_shared_pkeys setup the attr_id field to SRP_SA_ATTR_PATH_REC (0x35). Because of this incorrect field in MAD packet, upstream srptools-1.0.3 failed with an embedded subnet manager running on an Intel True Scale Edge Switch 12300. Upstream srptools-1.0.3 works with upstream opensm, because sa_mad_ctrl_process post the MAD to the dispatcher based on the attr_id field. As attr_id had been set to SRP_SA_ATTR_PATH_REC (0x35), PathRecord query works with opensm. opensm/opensm/osm_sa_mad_ctrl.c 292 static void sa_mad_ctrl_rcv_callback(IN osm_madw_t * p_madw, IN void *context, ......... 357 switch (p_sa_mad->method) { ......... 370 case IB_MAD_METHOD_GET: // 0x01 371 case IB_MAD_METHOD_GETTABLE: // 0x12 372 #if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP) 373 case IB_MAD_METHOD_GETMULTI: 374 #endif 375 is_get_request = TRUE; 376 case IB_MAD_METHOD_SET: 377 case IB_MAD_METHOD_DELETE: 378 /* if we are closing down simply do nothing */ 379 if (osm_exit_flag) 380 osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw); 381 else 382 sa_mad_ctrl_process(p_ctrl, p_madw, is_get_request); 383 break; 384 2ad09524931dbf98d412e1912c1bdbf22f8ac81d ("srp_daemon: Work around SM bug over non-default P_Key support") in the old git tree [1] introduced this regression issue. Upstream srptools-0.0.4 works with the embedded subnet manager. [1] git://git.openfabrics.org/~bvanassche/srptools.git Signed-off-by: Honggang Li --- srp_daemon/srp_daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c index 71b5f07..f905c6f 100644 --- a/srp_daemon/srp_daemon.c +++ b/srp_daemon/srp_daemon.c @@ -1134,6 +1134,7 @@ static int get_shared_pkeys(struct resources *res, continue; /* Mark components: DLID, SLID, PKEY */ + out_sa_mad->method = SRP_SA_METHOD_GET_TABLE; out_sa_mad->comp_mask = htobe64(1 << 4 | 1 << 5 | 1 << 13); out_sa_mad->rmpp_hdr.rmpp_version = UMAD_RMPP_VERSION; out_sa_mad->rmpp_hdr.rmpp_type = 1;