From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Dasaratharaman Chandramouli
<dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH for-next 11/27] IB/core: Change port_attr.lid size from 16 to 32 bits
Date: Fri, 04 Aug 2017 13:53:15 -0700 [thread overview]
Message-ID: <20170804205314.17853.94294.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20170804204842.17853.14858.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
From: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/core_priv.h | 1 +
drivers/infiniband/core/uverbs_cmd.c | 5 ++++-
drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +-
drivers/infiniband/hw/mlx4/mad.c | 2 +-
drivers/infiniband/hw/mthca/mthca_mad.c | 2 +-
include/rdma/ib_verbs.h | 2 +-
include/rdma/opa_addr.h | 3 ++-
7 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index 11ae675..9d4f17f 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -39,6 +39,7 @@
#include <rdma/ib_verbs.h>
#include <rdma/ib_mad.h>
+#include <rdma/opa_addr.h>
#include "mad_priv.h"
struct pkey_index_qp_list {
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 60535c7..7ef74b0 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -275,8 +275,11 @@ 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.lid = attr.lid;
resp.sm_lid = attr.sm_lid;
+ if (rdma_cap_opa_ah(ib_dev, cmd.port_num))
+ resp.lid = OPA_TO_IB_UCAST_LID(attr.lid);
+ else
+ resp.lid = (u16)attr.lid;
resp.lmc = attr.lmc;
resp.max_vl_num = attr.max_vl_num;
resp.sm_sl = attr.sm_sl;
diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c
index ea24230..5a897b0 100644
--- a/drivers/infiniband/hw/mlx4/alias_GUID.c
+++ b/drivers/infiniband/hw/mlx4/alias_GUID.c
@@ -528,7 +528,7 @@ static int set_guid_rec(struct ib_device *ibdev,
memset(&guid_info_rec, 0, sizeof (struct ib_sa_guidinfo_rec));
- guid_info_rec.lid = cpu_to_be16(attr.lid);
+ guid_info_rec.lid = cpu_to_be16((u16)attr.lid);
guid_info_rec.block_num = index;
memcpy(guid_info_rec.guid_info_list, rec_det->all_recs,
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index 21d31cb..00f0570 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -860,7 +860,7 @@ static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
in_mad->mad_hdr.method == IB_MGMT_METHOD_SET &&
in_mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO &&
!ib_query_port(ibdev, port_num, &pattr))
- prev_lid = pattr.lid;
+ prev_lid = (u16)pattr.lid;
err = mlx4_MAD_IFC(to_mdev(ibdev),
(mad_flags & IB_MAD_IGNORE_MKEY ? MLX4_MAD_IFC_IGNORE_MKEY : 0) |
diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c
index 7df3db7..617531f 100644
--- a/drivers/infiniband/hw/mthca/mthca_mad.c
+++ b/drivers/infiniband/hw/mthca/mthca_mad.c
@@ -256,7 +256,7 @@ int mthca_process_mad(struct ib_device *ibdev,
in_mad->mad_hdr.method == IB_MGMT_METHOD_SET &&
in_mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO &&
!ib_query_port(ibdev, port_num, &pattr))
- prev_lid = pattr.lid;
+ prev_lid = (u16)pattr.lid;
err = mthca_MAD_IFC(to_mdev(ibdev),
mad_flags & IB_MAD_IGNORE_MKEY,
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 1082b4c..4eccf89 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -549,8 +549,8 @@ struct ib_port_attr {
u32 bad_pkey_cntr;
u32 qkey_viol_cntr;
u16 pkey_tbl_len;
- u16 lid;
u16 sm_lid;
+ u32 lid;
u8 lmc;
u8 max_vl_num;
u8 sm_sl;
diff --git a/include/rdma/opa_addr.h b/include/rdma/opa_addr.h
index eace28f..46d0567 100644
--- a/include/rdma/opa_addr.h
+++ b/include/rdma/opa_addr.h
@@ -50,7 +50,8 @@
#define OPA_SPECIAL_OUI (0x00066AULL)
#define OPA_MAKE_ID(x) (cpu_to_be64(OPA_SPECIAL_OUI << 40 | (x)))
-
+#define OPA_TO_IB_UCAST_LID(x) (((x) >= be16_to_cpu(IB_MULTICAST_LID_BASE)) \
+ ? 0 : x)
/**
* ib_is_opa_gid: Returns true if the top 24 bits of the gid
* contains the OPA_STL_OUI identifier. This identifies that
--
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
next prev parent reply other threads:[~2017-08-04 20:53 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 20:52 [PATCH for-next 00/27] IB/hfi1, rdmavt, core, etc: patches for next 08/04/2017 Dennis Dalessandro
2017-08-04 20:52 ` Dennis Dalessandro
2017-08-04 20:52 ` [PATCH for-next 01/27] IB/hfi1: Revert egress pkey check enforcement Dennis Dalessandro
[not found] ` <20170804204842.17853.14858.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-08-04 20:52 ` [PATCH for-next 02/27] IB/hfi1: Remove pmtu from the QP structure Dennis Dalessandro
2017-08-04 20:52 ` [PATCH for-next 03/27] IB/hfi1: Remove lstate from hfi1_pportdata Dennis Dalessandro
2017-08-04 20:52 ` [PATCH for-next 04/27] IB/hfi1: Use host_link_state to read state when DC is shut down Dennis Dalessandro
2017-08-04 20:52 ` [PATCH for-next 05/27] IB/hfi1: Protect context array set/clear with spinlock Dennis Dalessandro
2017-08-04 20:52 ` [PATCH for-next 06/27] IB/hf1: User context locking is inconsistent Dennis Dalessandro
2017-08-04 20:52 ` [PATCH for-next 07/27] IB/core: Convert ah_attr from OPA to IB when copying to user Dennis Dalessandro
2017-08-04 20:52 ` [PATCH for-next 08/27] IB/srpt: Increase lid and sm_lid to 32 bits Dennis Dalessandro
2017-08-04 20:53 ` [PATCH for-next 09/27] IB/IPoIB: Increase local_lid " Dennis Dalessandro
2017-08-04 20:53 ` [PATCH for-next 10/27] IB/mad: Change slid in RMPP recv from 16 " Dennis Dalessandro
2017-08-04 20:53 ` Dennis Dalessandro [this message]
2017-08-04 20:53 ` [PATCH for-next 12/27] IB/core: Change port_attr.sm_lid " Dennis Dalessandro
[not found] ` <20170804205320.17853.77236.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-08-06 8:18 ` Leon Romanovsky
[not found] ` <20170806081857.GC3636-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-06 8:22 ` Leon Romanovsky
[not found] ` <20170806082217.GE3636-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-08 14:41 ` Leon Romanovsky
[not found] ` <20170808144146.GF28851-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-08 16:35 ` Weiny, Ira
[not found] ` <2807E5FD2F6FDA4886F6618EAC48510E67CFAF96-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-08-08 16:49 ` Don Hiatt
[not found] ` <018c6e70-78d5-51ec-993f-35be575a6da1-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-09 6:57 ` Leon Romanovsky
[not found] ` <20170809065730.GC1423-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-10 18:18 ` Don Hiatt
2017-08-09 6:56 ` Leon Romanovsky
2017-08-04 20:53 ` [PATCH for-next 13/27] IB/core: Change wc.slid " Dennis Dalessandro
2017-08-04 20:53 ` [PATCH for-next 14/27] IB/CM: Add OPA Path record support to CM Dennis Dalessandro
2017-08-04 20:53 ` [PATCH for-next 15/27] IB/CM: Create appropriate path records when handling CM request Dennis Dalessandro
2017-08-04 20:53 ` [PATCH for-next 16/27] IB/CM: Set appropriate slid and dlid " Dennis Dalessandro
2017-08-04 20:53 ` [PATCH for-next 17/27] IB/rdmavt, hfi1, qib: Modify check_ah() to account for extended LIDs Dennis Dalessandro
2017-08-04 20:53 ` [PATCH for-next 18/27] IB/hfi1: Add support to receive 16B bypass packets Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 19/27] IB/hfi1: Add support to send " Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 20/27] IB/hfi1: Add support to process 16B header errors Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 21/27] IB/hfi1: Determine 9B/16B L2 header type based on Address handle Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 22/27] IB/hfi1: Add 16B UD support Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 23/27] IB/hfi1: Add 16B trace support Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 24/27] IB/rdmavt, hfi1, qib: Enhance rdmavt and hfi1 to use 32 bit lids Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 25/27] IB/hfi1: Add 16B RC/UC support Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 26/27] IB/hfi1: Enhance PIO/SDMA send for 16B Dennis Dalessandro
2017-08-04 20:54 ` [PATCH for-next 27/27] IB/hfi1: Enable RDMA_CAP_OPA_AH in hfi driver to support extended LIDs Dennis Dalessandro
2017-08-10 17:05 ` [PATCH for-next 00/27] IB/hfi1, rdmavt, core, etc: patches for next 08/04/2017 Dennis Dalessandro
[not found] ` <f73b2f88-bc1b-92ed-1632-d2f3b1583d60-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-10 18:17 ` Don Hiatt
2017-08-10 18:17 ` Don Hiatt
2017-08-18 19:07 ` Doug Ledford
2017-08-22 18:23 ` Doug Ledford
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=20170804205314.17853.94294.stgit@scvm10.sc.intel.com \
--to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=ira.weiny-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.