From patchwork Thu Aug 10 18:04:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hiatt, Don" X-Patchwork-Id: 9894479 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 CA16460352 for ; Thu, 10 Aug 2017 18:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF05D28B1C for ; Thu, 10 Aug 2017 18:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B41C328B62; Thu, 10 Aug 2017 18:04:38 +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 653C228B1C for ; Thu, 10 Aug 2017 18:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753023AbdHJSEg (ORCPT ); Thu, 10 Aug 2017 14:04:36 -0400 Received: from mga06.intel.com ([134.134.136.31]:22465 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753161AbdHJSEc (ORCPT ); Thu, 10 Aug 2017 14:04:32 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 10 Aug 2017 11:04:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,354,1498546800"; d="scan'208";a="888643335" Received: from phwtpriv07.ph.intel.com ([10.228.208.82]) by FMSMGA003.fm.intel.com with ESMTP; 10 Aug 2017 11:04:31 -0700 From: Don Hiatt To: linux-rdma Subject: [PATCH rdma-next v4 7/8] IB/core: Change port_attr.sm_lid from 16 to 32 bits Date: Thu, 10 Aug 2017 14:04:27 -0400 Message-Id: <1502388268-20687-8-git-send-email-don.hiatt@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1502388268-20687-1-git-send-email-don.hiatt@intel.com> References: <1502388268-20687-1-git-send-email-don.hiatt@intel.com> 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: Dasaratharaman Chandramouli sm_lid field in struct ib_port_attr is increased to 32 bits. This enables core components to use larger LIDs if needed. The user ABI is unchanged and return 16 bit values when queried. Signed-off-by: Dasaratharaman Chandramouli Reviewed-by: Ira Weiny Signed-off-by: Don Hiatt --- drivers/infiniband/core/uverbs_cmd.c | 8 +++++--- include/rdma/ib_verbs.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index e693b8b..13484ea 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -275,7 +275,6 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file, resp.bad_pkey_cntr = attr.bad_pkey_cntr; resp.qkey_viol_cntr = attr.qkey_viol_cntr; resp.pkey_tbl_len = attr.pkey_tbl_len; - resp.sm_lid = attr.sm_lid; /* * In the current implementation the only way to get @@ -283,10 +282,13 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file, * For IB, lids will always be 16bits so cast the * value accordingly. */ - if (rdma_cap_opa_ah(ib_dev, cmd.port_num)) + if (rdma_cap_opa_ah(ib_dev, cmd.port_num)) { resp.lid = OPA_TO_IB_UCAST_LID(attr.lid); - else + resp.sm_lid = OPA_TO_IB_UCAST_LID(attr.sm_lid); + } else { resp.lid = ib_lid_cpu16(attr.lid); + resp.sm_lid = ib_lid_cpu16(attr.sm_lid); + } resp.lmc = attr.lmc; resp.max_vl_num = attr.max_vl_num; resp.sm_sl = attr.sm_sl; diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 0826a66..c92b98b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -549,7 +549,7 @@ struct ib_port_attr { u32 bad_pkey_cntr; u32 qkey_viol_cntr; u16 pkey_tbl_len; - u16 sm_lid; + u32 sm_lid; u32 lid; u8 lmc; u8 max_vl_num;