public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
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	[thread overview]
Message-ID: <1502388268-20687-8-git-send-email-don.hiatt@intel.com> (raw)
In-Reply-To: <1502388268-20687-1-git-send-email-don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

From: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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 <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 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;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-08-10 18:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 18:04 [PATCH rdma-next v4 0/8] Add OPA extended LID support Don Hiatt
     [not found] ` <1502388268-20687-1-git-send-email-don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-10 18:04   ` [PATCH rdma-next v4 1/8] IB/core: Convert ah_attr from OPA to IB when copying to user Don Hiatt
2017-08-10 18:04   ` [PATCH rdma-next v4 2/8] IB/srpt: Increase lid and sm_lid to 32 bits Don Hiatt
2017-08-10 18:04   ` [PATCH rdma-next v4 3/8] IB/IPoIB: Increase local_lid " Don Hiatt
2017-08-10 18:04   ` [PATCH rdma-next v4 4/8] IB/mad: Change slid in RMPP recv from 16 " Don Hiatt
2017-08-10 18:04   ` [PATCH rdma-next v4 5/8] IB/core: Add functions to convert 32 bit lids to 16 bits Don Hiatt
     [not found]     ` <1502388268-20687-6-git-send-email-don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-11 11:03       ` Leon Romanovsky
2017-08-10 18:04   ` [PATCH rdma-next v4 6/8] IB/core: Change port_attr.lid size from 16 to 32 bits Don Hiatt
2017-08-10 18:04   ` Don Hiatt [this message]
2017-08-10 18:04   ` [PATCH rdma-next v4 8/8] IB/core: Change wc.slid " Don Hiatt
2017-08-11 15:39   ` [PATCH rdma-next v4 0/8] Add OPA extended LID support Doug Ledford
     [not found]     ` <1502465986.3080.40.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-08-11 15:48       ` Don Hiatt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502388268-20687-8-git-send-email-don.hiatt@intel.com \
    --to=don.hiatt-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox