From patchwork Wed Nov 21 06:58:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10692045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBE1415A7 for ; Wed, 21 Nov 2018 06:58:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A60892B980 for ; Wed, 21 Nov 2018 06:58:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96E512B985; Wed, 21 Nov 2018 06:58:21 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SUBJ_OBFU_PUNCT_MANY 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 3C7082B980 for ; Wed, 21 Nov 2018 06:58:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728220AbeKURbe (ORCPT ); Wed, 21 Nov 2018 12:31:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56040 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbeKURbd (ORCPT ); Wed, 21 Nov 2018 12:31:33 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4C8930821EF; Wed, 21 Nov 2018 06:58:17 +0000 (UTC) Received: from lhg.nay.redhat.com (unknown [10.66.129.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E3A617A8F; Wed, 21 Nov 2018 06:58:16 +0000 (UTC) From: Honggang LI To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [opensm patch 1/6] opensm/osm_ucast_cache.h: Improve coding style and comments Date: Wed, 21 Nov 2018 14:58:06 +0800 Message-Id: <20181121065811.21806-1-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 21 Nov 2018 06:58:17 +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 Signed-off-by: Honggang Li --- include/opensm/osm_ucast_cache.h | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/include/opensm/osm_ucast_cache.h b/include/opensm/osm_ucast_cache.h index e186590f..316a7f61 100644 --- a/include/opensm/osm_ucast_cache.h +++ b/include/opensm/osm_ucast_cache.h @@ -89,7 +89,7 @@ struct osm_ucast_mgr; * * SYNOPSIS */ -void osm_ucast_cache_invalidate(struct osm_ucast_mgr *p_mgr); +void osm_ucast_cache_invalidate(IN struct osm_ucast_mgr *p_mgr); /* * PARAMETERS * p_mgr @@ -115,19 +115,27 @@ void osm_ucast_cache_invalidate(struct osm_ucast_mgr *p_mgr); * * SYNOPSIS */ -void osm_ucast_cache_check_new_link(struct osm_ucast_mgr *p_mgr, - osm_node_t * p_node_1, uint8_t port_num_1, - osm_node_t * p_node_2, uint8_t port_num_2); +void osm_ucast_cache_check_new_link(IN struct osm_ucast_mgr *p_mgr, + IN osm_node_t * p_node_1, + IN uint8_t port_num_1, + IN osm_node_t * p_node_2, + IN uint8_t port_num_2); /* * PARAMETERS * p_mgr * [in] Pointer to the unicast manager object. * -* physp1 -* [in] Pointer to the first physical port of the link. +* p_node_1 +* [in] Pointer to the first node of the link. * -* physp2 -* [in] Pointer to the second physical port of the link. +* port_num_1 +* [in] Port number of the first node. +* +* p_node_2 +* [in] Pointer to the second node of the link. +* +* port_num_2 +* [in] Port number of the second node. * * RETURN VALUE * This function does not return any value. @@ -151,8 +159,9 @@ void osm_ucast_cache_check_new_link(struct osm_ucast_mgr *p_mgr, * * SYNOPSIS */ -void osm_ucast_cache_add_link(struct osm_ucast_mgr *p_mgr, - osm_physp_t * physp1, osm_physp_t * physp2); +void osm_ucast_cache_add_link(IN struct osm_ucast_mgr *p_mgr, + IN osm_physp_t * physp1, + IN osm_physp_t * physp2); /* * PARAMETERS * p_mgr @@ -188,7 +197,8 @@ void osm_ucast_cache_add_link(struct osm_ucast_mgr *p_mgr, * * SYNOPSIS */ -void osm_ucast_cache_add_node(struct osm_ucast_mgr *p_mgr, osm_node_t * p_node); +void osm_ucast_cache_add_node(IN struct osm_ucast_mgr *p_mgr, + IN osm_node_t * p_node); /* * PARAMETERS * p_mgr @@ -218,7 +228,7 @@ void osm_ucast_cache_add_node(struct osm_ucast_mgr *p_mgr, osm_node_t * p_node); * * SYNOPSIS */ -int osm_ucast_cache_process(struct osm_ucast_mgr *p_mgr); +int osm_ucast_cache_process(IN struct osm_ucast_mgr *p_mgr); /* * PARAMETERS * p_mgr From patchwork Wed Nov 21 06:58:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10692047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC3FB15A7 for ; Wed, 21 Nov 2018 06:58:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB7B42B981 for ; Wed, 21 Nov 2018 06:58:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACF842B986; Wed, 21 Nov 2018 06:58:26 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 4BA612B981 for ; Wed, 21 Nov 2018 06:58:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbeKURbk (ORCPT ); Wed, 21 Nov 2018 12:31:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbeKURbk (ORCPT ); Wed, 21 Nov 2018 12:31:40 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3DD34307D84C; Wed, 21 Nov 2018 06:58:25 +0000 (UTC) Received: from lhg.nay.redhat.com (unknown [10.66.129.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC4BD5F7DA; Wed, 21 Nov 2018 06:58:23 +0000 (UTC) From: Honggang LI To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [opensm patch 2/6] opensm/osm_remote_sm.c: Improve comment Date: Wed, 21 Nov 2018 14:58:07 +0800 Message-Id: <20181121065811.21806-2-honli@redhat.com> In-Reply-To: <20181121065811.21806-1-honli@redhat.com> References: <20181121065811.21806-1-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 21 Nov 2018 06:58:25 +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 Signed-off-by: Honggang Li --- opensm/osm_remote_sm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensm/osm_remote_sm.c b/opensm/osm_remote_sm.c index 4ebbd3fe..e081664b 100644 --- a/opensm/osm_remote_sm.c +++ b/opensm/osm_remote_sm.c @@ -35,7 +35,7 @@ /* * Abstract: - * Implementation of osm_sm_t. + * Implementation of osm_remote_sm_t. * This object represents the remote SM object. * This object is part of the opensm family of objects. */ From patchwork Wed Nov 21 06:58:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10692049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 594E313AD for ; Wed, 21 Nov 2018 06:58:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 490882B980 for ; Wed, 21 Nov 2018 06:58:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DC432B985; Wed, 21 Nov 2018 06:58:29 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 ED8CB2B980 for ; Wed, 21 Nov 2018 06:58:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726039AbeKURbn (ORCPT ); Wed, 21 Nov 2018 12:31:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60458 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbeKURbn (ORCPT ); Wed, 21 Nov 2018 12:31:43 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 268985F799; Wed, 21 Nov 2018 06:58:28 +0000 (UTC) Received: from lhg.nay.redhat.com (unknown [10.66.129.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3AF52C8C6; Wed, 21 Nov 2018 06:58:26 +0000 (UTC) From: Honggang LI To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [opensm patch 3/6] opensm/osm_mtree.h: improve comment Date: Wed, 21 Nov 2018 14:58:08 +0800 Message-Id: <20181121065811.21806-3-honli@redhat.com> In-Reply-To: <20181121065811.21806-2-honli@redhat.com> References: <20181121065811.21806-1-honli@redhat.com> <20181121065811.21806-2-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Nov 2018 06:58:28 +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 Signed-off-by: Honggang Li --- include/opensm/osm_mtree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/opensm/osm_mtree.h b/include/opensm/osm_mtree.h index b8307f0c..ad47af6d 100644 --- a/include/opensm/osm_mtree.h +++ b/include/opensm/osm_mtree.h @@ -134,7 +134,7 @@ typedef struct osm_mtree_node { * osm_mtree_node_new * * DESCRIPTION -* Returns an initialized a Multicast Tree object for use. +* Returns an initialized Multicast Tree object for use. * * SYNOPSIS */ From patchwork Wed Nov 21 06:58:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10692051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0719E15A7 for ; Wed, 21 Nov 2018 06:58:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D54A28B1B for ; Wed, 21 Nov 2018 06:58:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 009E02B985; Wed, 21 Nov 2018 06:58:31 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 A721D2B980 for ; Wed, 21 Nov 2018 06:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728144AbeKURbq (ORCPT ); Wed, 21 Nov 2018 12:31:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49694 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbeKURbq (ORCPT ); Wed, 21 Nov 2018 12:31:46 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA6B84E33B; Wed, 21 Nov 2018 06:58:30 +0000 (UTC) Received: from lhg.nay.redhat.com (unknown [10.66.129.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7770F2C8C6; Wed, 21 Nov 2018 06:58:29 +0000 (UTC) From: Honggang LI To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [opensm patch 4/6] opensm/osm_mlnx_ext_port_info_rcv.c: Check the pointer of osm_sm_t before access it Date: Wed, 21 Nov 2018 14:58:09 +0800 Message-Id: <20181121065811.21806-4-honli@redhat.com> In-Reply-To: <20181121065811.21806-3-honli@redhat.com> References: <20181121065811.21806-1-honli@redhat.com> <20181121065811.21806-2-honli@redhat.com> <20181121065811.21806-3-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Nov 2018 06:58:30 +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 Signed-off-by: Honggang Li --- opensm/osm_mlnx_ext_port_info_rcv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opensm/osm_mlnx_ext_port_info_rcv.c b/opensm/osm_mlnx_ext_port_info_rcv.c index 8151bbce..e4f8521e 100644 --- a/opensm/osm_mlnx_ext_port_info_rcv.c +++ b/opensm/osm_mlnx_ext_port_info_rcv.c @@ -73,9 +73,10 @@ void osm_mlnx_epi_rcv_process(IN void *context, IN void *data) ib_net64_t port_guid, node_guid; uint8_t port_num, portnum, start_port = 1; + CL_ASSERT(sm); + OSM_LOG_ENTER(sm->p_log); - CL_ASSERT(sm); CL_ASSERT(p_madw); p_smp = osm_madw_get_smp_ptr(p_madw); From patchwork Wed Nov 21 06:58:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10692053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 656F315A7 for ; Wed, 21 Nov 2018 06:58:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 529312B3B9 for ; Wed, 21 Nov 2018 06:58:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44EE82B3CC; Wed, 21 Nov 2018 06:58:37 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 D6CD72B3B9 for ; Wed, 21 Nov 2018 06:58:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728136AbeKURbv (ORCPT ); Wed, 21 Nov 2018 12:31:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51252 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbeKURbv (ORCPT ); Wed, 21 Nov 2018 12:31:51 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBFEB89ACE; Wed, 21 Nov 2018 06:58:35 +0000 (UTC) Received: from lhg.nay.redhat.com (unknown [10.66.129.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4680217A8F; Wed, 21 Nov 2018 06:58:32 +0000 (UTC) From: Honggang LI To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [opensm patch 5/6] opensm/osm_service.h: Fix and add some comments Date: Wed, 21 Nov 2018 14:58:10 +0800 Message-Id: <20181121065811.21806-5-honli@redhat.com> In-Reply-To: <20181121065811.21806-4-honli@redhat.com> References: <20181121065811.21806-1-honli@redhat.com> <20181121065811.21806-2-honli@redhat.com> <20181121065811.21806-3-honli@redhat.com> <20181121065811.21806-4-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Nov 2018 06:58:35 +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 Signed-off-by: Honggang Li --- include/opensm/osm_service.h | 91 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 5 deletions(-) diff --git a/include/opensm/osm_service.h b/include/opensm/osm_service.h index 446b8883..9a41878e 100644 --- a/include/opensm/osm_service.h +++ b/include/opensm/osm_service.h @@ -96,10 +96,10 @@ typedef struct osm_svcr { } osm_svcr_t; /* * FIELDS -* map_item -* Map Item for qmap linkage. Must be first element!! +* list_item +* List Item for Quick List linkage. Must be first element!! * -* svc_rec +* service_record * IB Service record structure * * modified_time @@ -150,7 +150,7 @@ void osm_svcr_init(IN osm_svcr_t * p_svcr, IN const ib_service_record_t * p_svc_rec); /* * PARAMETERS -* p_svc_rec +* p_svcr * [in] Pointer to osm_svcr_t structure * p_svc_rec * [in] Pointer to the ib_service_record_t @@ -171,21 +171,102 @@ void osm_svcr_init(IN osm_svcr_t * p_svcr, void osm_svcr_delete(IN osm_svcr_t * p_svcr); /* * PARAMETERS -* p_svc_rec +* p_svcr * [in] Pointer to osm_svcr_t structure * * SEE ALSO * Service Record, osm_svcr_new *********/ +/****f* OpenSM: Service Record/osm_svcr_get_by_rid +* NAME +* osm_svcr_get_by_rid +* +* DESCRIPTION +* Search the Service Record Database by record service_id, +* service_gid and service_pkey. +* +* SYNOPSIS +*/ osm_svcr_t *osm_svcr_get_by_rid(IN osm_subn_t const *p_subn, IN osm_log_t * p_log, IN ib_service_record_t * p_svc_rec); +/* +* PARAMETERS +* p_subn +* [in] Pointer to Subnet structure +* +* p_log +* [in] Pointer to osm_log_t +* +* p_svc_rec +* [in] Pointer to IB Service Record +* +* RETURN VALUES +* If found a matched record, pointer to osm_svcr_t structure. +* Otherwise, pointer to NULL. +* +* SEE ALSO +* Service Record +*********/ +/****f* OpenSM: Service Record/osm_svcr_insert_to_db +* NAME +* osm_svcr_insert_to_db +* +* DESCRIPTION +* Insert new Service Record into Database +* +* SYNOPSIS +*/ void osm_svcr_insert_to_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log, IN osm_svcr_t * p_svcr); +/* +* PARAMETERS +* p_subn +* [in] Pointer to Subnet structure +* +* p_log +* [in] Pointer to osm_log_t +* +* p_svcr +* [in] Pointer to IB Service Record to be inserted +* +* RETURN VALUES +* This function does not return a value. +* +* SEE ALSO +* Service Record, osm_svcr_remove_from_db +*********/ + +/****f* OpenSM: Service Record/osm_svcr_remove_from_db +* NAME +* osm_svcr_remove_from_db +* +* DESCRIPTION +* Remove a Service Record from Database +* +* SYNOPSIS +*/ void osm_svcr_remove_from_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log, IN osm_svcr_t * p_svcr); +/* +* PARAMETERS +* p_subn +* [in] Pointer to Subnet structure +* +* p_log +* [in] Pointer to osm_log_t +* +* p_svcr +* [in] Pointer to IB Service Record to be removed +* +* RETURN VALUES +* This function does not return a value. +* +* SEE ALSO +* Service Record, osm_svcr_insert_to_db +*********/ END_C_DECLS #endif /* _OSM_SVCR_H_ */ From patchwork Wed Nov 21 06:58:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10692055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFCFB13AD for ; Wed, 21 Nov 2018 06:58:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB6E42B3B9 for ; Wed, 21 Nov 2018 06:58:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF5C42B48F; Wed, 21 Nov 2018 06:58:39 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 7F15A2B3B9 for ; Wed, 21 Nov 2018 06:58:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728221AbeKURby (ORCPT ); Wed, 21 Nov 2018 12:31:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbeKURby (ORCPT ); Wed, 21 Nov 2018 12:31:54 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A52FD3082134; Wed, 21 Nov 2018 06:58:38 +0000 (UTC) Received: from lhg.nay.redhat.com (unknown [10.66.129.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CF9F17A9C; Wed, 21 Nov 2018 06:58:36 +0000 (UTC) From: Honggang LI To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [opensm patch 6/6] opensm/osm_resp.c: Fix an error in swapping directed route source and destination lid Date: Wed, 21 Nov 2018 14:58:11 +0800 Message-Id: <20181121065811.21806-6-honli@redhat.com> In-Reply-To: <20181121065811.21806-5-honli@redhat.com> References: <20181121065811.21806-1-honli@redhat.com> <20181121065811.21806-2-honli@redhat.com> <20181121065811.21806-3-honli@redhat.com> <20181121065811.21806-4-honli@redhat.com> <20181121065811.21806-5-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 21 Nov 2018 06:58:38 +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 Signed-off-by: Honggang Li --- opensm/osm_resp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opensm/osm_resp.c b/opensm/osm_resp.c index 3f270e66..42015564 100644 --- a/opensm/osm_resp.c +++ b/opensm/osm_resp.c @@ -85,8 +85,8 @@ static void resp_make_resp_smp(IN osm_sm_t * sm, IN const ib_smp_t * p_src_smp, if (p_src_smp->mgmt_class == IB_MCLASS_SUBN_DIR) p_dest_smp->status |= IB_SMP_DIRECTION; - p_dest_smp->dr_dlid = p_dest_smp->dr_slid; - p_dest_smp->dr_slid = p_dest_smp->dr_dlid; + p_dest_smp->dr_dlid = p_src_smp->dr_slid; + p_dest_smp->dr_slid = p_src_smp->dr_dlid; memcpy(&p_dest_smp->data, p_payload, IB_SMP_DATA_SIZE); Exit: