* [RFC PATCH 07/11] IB/mad: Change slid in RMPP recv from 16 to 32 bits
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Don Hiatt, Dasaratharaman Chandramouli
In-Reply-To: <1474652674-13110-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
OPA devices will contain larger lids in the wc.slid
which is now 32 bits. This change ensures RMPP handler
is able to retrieve the correct lid.
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/mad_rmpp.c | 22 ++++++++++++++++++----
include/rdma/ib_addr.h | 12 ++++++++++++
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c
index 1fc9469b5e66..1cc452c2e03d 100644
--- a/drivers/infiniband/core/mad_rmpp.c
+++ b/drivers/infiniband/core/mad_rmpp.c
@@ -33,6 +33,7 @@
*/
#include <linux/slab.h>
+#include <rdma/ib_addr.h>
#include "mad_priv.h"
#include "mad_rmpp.h"
@@ -64,7 +65,7 @@ struct mad_rmpp_recv {
__be64 tid;
u32 src_qp;
- u16 slid;
+ u32 slid;
u8 mgmt_class;
u8 class_version;
u8 method;
@@ -316,7 +317,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent,
mad_hdr = &mad_recv_wc->recv_buf.mad->mad_hdr;
rmpp_recv->tid = mad_hdr->tid;
rmpp_recv->src_qp = mad_recv_wc->wc->src_qp;
- rmpp_recv->slid = (u16)mad_recv_wc->wc->slid;
+ rmpp_recv->slid = mad_recv_wc->wc->slid;
rmpp_recv->mgmt_class = mad_hdr->mgmt_class;
rmpp_recv->class_version = mad_hdr->class_version;
rmpp_recv->method = mad_hdr->method;
@@ -337,7 +338,7 @@ find_rmpp_recv(struct ib_mad_agent_private *agent,
list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
if (rmpp_recv->tid == mad_hdr->tid &&
rmpp_recv->src_qp == mad_recv_wc->wc->src_qp &&
- rmpp_recv->slid == (u16)mad_recv_wc->wc->slid &&
+ rmpp_recv->slid == mad_recv_wc->wc->slid &&
rmpp_recv->mgmt_class == mad_hdr->mgmt_class &&
rmpp_recv->class_version == mad_hdr->class_version &&
rmpp_recv->method == mad_hdr->method)
@@ -850,11 +851,14 @@ out:
static int init_newwin(struct ib_mad_send_wr_private *mad_send_wr)
{
struct ib_mad_agent_private *agent = mad_send_wr->mad_agent_priv;
+ struct ib_device *ib_dev = agent->qp_info->port_priv->device;
+ u8 port = agent->qp_info->port_priv->port_num;
struct ib_mad_hdr *mad_hdr = mad_send_wr->send_buf.mad;
struct mad_rmpp_recv *rmpp_recv;
struct ib_ah_attr ah_attr;
unsigned long flags;
int newwin = 1;
+ u32 dlid;
if (!(mad_hdr->method & IB_MGMT_METHOD_RESP))
goto out;
@@ -870,7 +874,17 @@ static int init_newwin(struct ib_mad_send_wr_private *mad_send_wr)
if (ib_query_ah(mad_send_wr->send_buf.ah, &ah_attr))
continue;
- if (rmpp_recv->slid == ah_attr.dlid) {
+ if (rdma_cap_opa_ah(ib_dev, port)) {
+ if ((ah_attr.ah_flags & IB_AH_GRH) &&
+ (ib_is_opa_gid(&ah_attr.grh.dgid)))
+ dlid = opa_get_lid_from_gid(&ah_attr.grh.dgid);
+ else
+ dlid = OPA_TO_IB_UCAST_LID(ah_attr.dlid);
+ } else {
+ dlid = ah_attr.dlid;
+ }
+
+ if (rmpp_recv->slid == dlid) {
newwin = rmpp_recv->repwin;
break;
}
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index 0d4fa0cdf0ab..fbd532652655 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -347,4 +347,16 @@ static inline bool ib_is_opa_gid(union ib_gid *gid)
OPA_STL_OUI);
}
+/**
+ * opa_get_lid_from_gid: Returns the last 32 bits of the gid.
+ * OPA devices use one of the gids in the gid table to also
+ * store the lid.
+ *
+ * @gid: The Global identifier
+ */
+static inline u32 opa_get_lid_from_gid(union ib_gid *gid)
+{
+ return be64_to_cpu(gid->global.interface_id) & 0xFFFFFFFF;
+}
+
#endif /* IB_ADDR_H */
--
1.8.2
--
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
^ permalink raw reply related
* [RFC PATCH 06/11] IB/mad: Ensure DR MADs are correctly specified when using OPA devices
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Don Hiatt, Dasaratharaman Chandramouli
In-Reply-To: <1474652674-13110-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Pure DR MADs do not need OPA GIDs to be specified in the GRH since
they do not rely on LID information.
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/mad.c | 100 +++++++++++++++++++++++++++++++++++++-----
include/rdma/ib_addr.h | 14 ++++++
2 files changed, 102 insertions(+), 12 deletions(-)
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 2d49228f28b2..752bd91a1cc9 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -41,6 +41,7 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <rdma/ib_cache.h>
+#include <rdma/ib_addr.h>
#include "mad_priv.h"
#include "mad_rmpp.h"
@@ -731,6 +732,76 @@ static size_t mad_priv_dma_size(const struct ib_mad_private *mp)
return sizeof(struct ib_grh) + mp->mad_size;
}
+static int verify_mad_ah(struct ib_mad_agent_private *mad_agent_priv,
+ struct ib_mad_send_wr_private *mad_send_wr)
+{
+ struct ib_device *ib_dev = mad_agent_priv->qp_info->port_priv->device;
+ u8 port = mad_agent_priv->qp_info->port_priv->port_num;
+ struct ib_smp *smp = mad_send_wr->send_buf.mad;
+ struct opa_smp *opa_smp = (struct opa_smp *)smp;
+ u32 opa_drslid = be32_to_cpu(opa_smp->route.dr.dr_slid);
+ u32 opa_drdlid = be32_to_cpu(opa_smp->route.dr.dr_dlid);
+
+ bool dr_slid_is_permissive = (OPA_LID_PERMISSIVE ==
+ opa_smp->route.dr.dr_slid);
+ bool dr_dlid_is_permissive = (OPA_LID_PERMISSIVE ==
+ opa_smp->route.dr.dr_dlid);
+ bool drslid_is_ib_ucast = !(opa_drslid & 0xFFFFC000);
+ bool drdlid_is_ib_ucast = !(opa_drdlid & 0xFFFFC000);
+ bool drslid_is_ext = !drslid_is_ib_ucast && !dr_slid_is_permissive;
+ bool drdlid_is_ext = !drdlid_is_ib_ucast && !dr_dlid_is_permissive;
+ bool grh_present = false;
+ struct ib_ah_attr attr;
+ union ib_gid sgid;
+ int ret = 0;
+
+ ret = ib_query_ah(mad_send_wr->send_buf.ah, &attr);
+ if (ret)
+ return ret;
+ grh_present = (attr.ah_flags & IB_AH_GRH);
+ if (grh_present) {
+ ret = ib_query_gid(ib_dev, port, attr.grh.sgid_index,
+ &sgid, NULL);
+ if (ret)
+ return ret;
+ }
+
+ if (smp->class_version == OPA_SMP_CLASS_VERSION) {
+ /*
+ * Conditions when GRH info should not be specified
+ * 1. both dr_slid and dr_dlid are permissve (Pure DR)
+ * 2. both dr_slid and dr_dlid are less than 0xc000.
+ *
+ * Conditions when GRH info should be specified
+ * 1. dr_dlid is not permissive and above 0xbfff
+ * OR
+ * 2. dr_slid is not permissive and above 0xbfff
+ */
+ if (grh_present) {
+ if ((dr_slid_is_permissive &&
+ dr_dlid_is_permissive) ||
+ (drslid_is_ib_ucast && drdlid_is_ib_ucast))
+ if (ib_is_opa_gid(&attr.grh.dgid) &&
+ ib_is_opa_gid(&sgid))
+ return -EINVAL;
+ if (drslid_is_ext && !ib_is_opa_gid(&sgid))
+ return -EINVAL;
+ if (drdlid_is_ext &&
+ !ib_is_opa_gid(&attr.grh.dgid))
+ return -EINVAL;
+ } else { /* There is no GRH */
+ if (drslid_is_ext || drdlid_is_ext)
+ return -EINVAL;
+ }
+ } else {
+ if (grh_present)
+ if (ib_is_opa_gid(&attr.grh.dgid) &&
+ ib_is_opa_gid(&sgid))
+ return -EINVAL;
+ }
+ return 0;
+}
+
/*
* Return 0 if SMP is to be sent
* Return 1 if SMP was consumed locally (whether or not solicited)
@@ -754,8 +825,12 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
size_t mad_size = port_mad_size(mad_agent_priv->qp_info->port_priv);
u16 out_mad_pkey_index = 0;
u16 drslid;
- bool opa = rdma_cap_opa_mad(mad_agent_priv->qp_info->port_priv->device,
- mad_agent_priv->qp_info->port_priv->port_num);
+ bool opa_mad =
+ rdma_cap_opa_mad(mad_agent_priv->qp_info->port_priv->device,
+ mad_agent_priv->qp_info->port_priv->port_num);
+ bool opa_ah =
+ rdma_cap_opa_ah(mad_agent_priv->qp_info->port_priv->device,
+ mad_agent_priv->qp_info->port_priv->port_num);
if (rdma_cap_ib_switch(device) &&
smp->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE)
@@ -763,13 +838,21 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
else
port_num = mad_agent_priv->agent.port_num;
+ if (opa_mad && opa_ah) {
+ ret = verify_mad_ah(mad_agent_priv, mad_send_wr);
+ if (ret) {
+ dev_err(&device->dev,
+ "Error verifying MAD format\n");
+ goto out;
+ }
+ }
/*
* Directed route handling starts if the initial LID routed part of
* a request or the ending LID routed part of a response is empty.
* If we are at the start of the LID routed part, don't update the
* hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec.
*/
- if (opa && smp->class_version == OPA_SMP_CLASS_VERSION) {
+ if (opa_mad && smp->class_version == OPA_SMP_CLASS_VERSION) {
u32 opa_drslid;
if ((opa_get_smp_direction(opa_smp)
@@ -783,13 +866,6 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
goto out;
}
opa_drslid = be32_to_cpu(opa_smp->route.dr.dr_slid);
- if (opa_drslid != be32_to_cpu(OPA_LID_PERMISSIVE) &&
- opa_drslid & 0xffff0000) {
- ret = -EINVAL;
- dev_err(&device->dev, "OPA Invalid dr_slid 0x%x\n",
- opa_drslid);
- goto out;
- }
drslid = (u16)(opa_drslid & 0x0000ffff);
/* Check to post send on QP or process locally */
@@ -834,7 +910,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
send_wr->pkey_index,
send_wr->port_num, &mad_wc);
- if (opa && smp->base_version == OPA_MGMT_BASE_VERSION) {
+ if (opa_mad && smp->base_version == OPA_MGMT_BASE_VERSION) {
mad_wc.byte_len = mad_send_wr->send_buf.hdr_len
+ mad_send_wr->send_buf.data_len
+ sizeof(struct ib_grh);
@@ -891,7 +967,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
}
local->mad_send_wr = mad_send_wr;
- if (opa) {
+ if (opa_mad) {
local->mad_send_wr->send_wr.pkey_index = out_mad_pkey_index;
local->return_wc_byte_len = mad_size;
}
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index e6293338dfb1..0d4fa0cdf0ab 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -333,4 +333,18 @@ static inline struct net_device *rdma_vlan_dev_real_dev(const struct net_device
vlan_dev_real_dev(dev) : NULL;
}
+/**
+ * ib_is_opa_gid: Returns true if the top 24 bits of the gid
+ * contains the OPA_STL_OUI identifier. This identifies that
+ * the provided gid is a special purpose GID meant to carry
+ * extended LID information.
+ *
+ * @gid: The Global identifier
+ */
+static inline bool ib_is_opa_gid(union ib_gid *gid)
+{
+ return ((be64_to_cpu(gid->global.interface_id) >> 40) ==
+ OPA_STL_OUI);
+}
+
#endif /* IB_ADDR_H */
--
1.8.2
--
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
^ permalink raw reply related
* [RFC PATCH 05/11] IB/core: Change lid size in struct ib_wc from 16 to 32 bits
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Don Hiatt, Dasaratharaman Chandramouli
In-Reply-To: <1474652674-13110-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
lid field in ib_wc is increased to 32 bits. This enables core
components to use the larger addresses if needed.
The user ABI is unchanged and return 16 bit values when queried.
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/cm.c | 4 ++--
drivers/infiniband/core/mad_rmpp.c | 4 ++--
drivers/infiniband/core/user_mad.c | 2 +-
drivers/infiniband/core/uverbs_cmd.c | 2 +-
drivers/infiniband/hw/hfi1/hfi.h | 2 +-
drivers/infiniband/hw/hfi1/mad.c | 2 +-
drivers/infiniband/hw/mlx4/mad.c | 6 +++---
drivers/infiniband/hw/mlx5/mad.c | 2 +-
drivers/infiniband/hw/mthca/mthca_cmd.c | 4 ++--
drivers/infiniband/hw/mthca/mthca_mad.c | 2 +-
drivers/infiniband/sw/rdmavt/cq.c | 2 +-
include/rdma/ib_verbs.h | 2 +-
12 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index c99525512b34..137c4c27469e 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -1576,7 +1576,7 @@ static void cm_process_routed_req(struct cm_req_msg *req_msg, struct ib_wc *wc)
{
if (!cm_req_get_primary_subnet_local(req_msg)) {
if (req_msg->primary_local_lid == IB_LID_PERMISSIVE) {
- req_msg->primary_local_lid = cpu_to_be16(wc->slid);
+ req_msg->primary_local_lid = cpu_to_be16((u16)wc->slid);
cm_req_set_primary_sl(req_msg, wc->sl);
}
@@ -1586,7 +1586,7 @@ static void cm_process_routed_req(struct cm_req_msg *req_msg, struct ib_wc *wc)
if (!cm_req_get_alt_subnet_local(req_msg)) {
if (req_msg->alt_local_lid == IB_LID_PERMISSIVE) {
- req_msg->alt_local_lid = cpu_to_be16(wc->slid);
+ req_msg->alt_local_lid = cpu_to_be16((u16)wc->slid);
cm_req_set_alt_sl(req_msg, wc->sl);
}
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c
index 382941b46e43..1fc9469b5e66 100644
--- a/drivers/infiniband/core/mad_rmpp.c
+++ b/drivers/infiniband/core/mad_rmpp.c
@@ -316,7 +316,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent,
mad_hdr = &mad_recv_wc->recv_buf.mad->mad_hdr;
rmpp_recv->tid = mad_hdr->tid;
rmpp_recv->src_qp = mad_recv_wc->wc->src_qp;
- rmpp_recv->slid = mad_recv_wc->wc->slid;
+ rmpp_recv->slid = (u16)mad_recv_wc->wc->slid;
rmpp_recv->mgmt_class = mad_hdr->mgmt_class;
rmpp_recv->class_version = mad_hdr->class_version;
rmpp_recv->method = mad_hdr->method;
@@ -337,7 +337,7 @@ find_rmpp_recv(struct ib_mad_agent_private *agent,
list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
if (rmpp_recv->tid == mad_hdr->tid &&
rmpp_recv->src_qp == mad_recv_wc->wc->src_qp &&
- rmpp_recv->slid == mad_recv_wc->wc->slid &&
+ rmpp_recv->slid == (u16)mad_recv_wc->wc->slid &&
rmpp_recv->mgmt_class == mad_hdr->mgmt_class &&
rmpp_recv->class_version == mad_hdr->class_version &&
rmpp_recv->method == mad_hdr->method)
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 415a3185cde7..2a0b92866116 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -229,7 +229,7 @@ static void recv_handler(struct ib_mad_agent *agent,
packet->mad.hdr.status = 0;
packet->mad.hdr.length = hdr_size(file) + mad_recv_wc->mad_len;
packet->mad.hdr.qpn = cpu_to_be32(mad_recv_wc->wc->src_qp);
- packet->mad.hdr.lid = cpu_to_be16(mad_recv_wc->wc->slid);
+ packet->mad.hdr.lid = cpu_to_be16((u16)mad_recv_wc->wc->slid);
packet->mad.hdr.sl = mad_recv_wc->wc->sl;
packet->mad.hdr.path_bits = mad_recv_wc->wc->dlid_path_bits;
packet->mad.hdr.pkey_index = mad_recv_wc->wc->pkey_index;
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 286ba8ca8cbd..4721f8639e68 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1619,7 +1619,7 @@ static int copy_wc_to_user(void __user *dest, struct ib_wc *wc)
tmp.src_qp = wc->src_qp;
tmp.wc_flags = wc->wc_flags;
tmp.pkey_index = wc->pkey_index;
- tmp.slid = wc->slid;
+ tmp.slid = (u16)wc->slid;
tmp.sl = wc->sl;
tmp.dlid_path_bits = wc->dlid_path_bits;
tmp.port_num = wc->port_num;
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index 7eef11b316ff..57ebbec2840c 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -1448,7 +1448,7 @@ static int ingress_pkey_table_search(struct hfi1_pportdata *ppd, u16 pkey)
* the 'error info' for this failure.
*/
static void ingress_pkey_table_fail(struct hfi1_pportdata *ppd, u16 pkey,
- u16 slid)
+ u32 slid)
{
struct hfi1_devdata *dd = ppd->dd;
diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
index 9487c9bb8920..865f5ee4855f 100644
--- a/drivers/infiniband/hw/hfi1/mad.c
+++ b/drivers/infiniband/hw/hfi1/mad.c
@@ -3974,7 +3974,7 @@ static int opa_local_smp_check(struct hfi1_ibport *ibp,
const struct ib_wc *in_wc)
{
struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
- u16 slid = in_wc->slid;
+ u32 slid = in_wc->slid;
u16 pkey;
if (in_wc->pkey_index >= ARRAY_SIZE(ppd->pkeys))
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index 39c098a9c3d5..b420f77de1d4 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -167,7 +167,7 @@ int mlx4_MAD_IFC(struct mlx4_ib_dev *dev, int mad_ifc_flags,
op_modifier |= 0x4;
- in_modifier |= in_wc->slid << 16;
+ in_modifier |= (u16)in_wc->slid << 16;
}
err = mlx4_cmd_box(dev->dev, inmailbox->dma, outmailbox->dma, in_modifier,
@@ -572,7 +572,7 @@ int mlx4_ib_send_to_slave(struct mlx4_ib_dev *dev, int slave, u8 port,
memcpy((char *)&tun_mad->hdr.slid_mac_47_32, &(wc->smac[4]), 2);
} else {
tun_mad->hdr.sl_vid = cpu_to_be16(((u16)(wc->sl)) << 12);
- tun_mad->hdr.slid_mac_47_32 = cpu_to_be16(wc->slid);
+ tun_mad->hdr.slid_mac_47_32 = cpu_to_be16((u16)wc->slid);
}
ib_dma_sync_single_for_device(&dev->ib_dev,
@@ -760,7 +760,7 @@ static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
}
}
- slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
+ slid = in_wc ? (u16)in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0) {
forward_trap(to_mdev(ibdev), port_num, in_mad);
diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c
index 364aab9f3c9e..b42b26ba3a95 100644
--- a/drivers/infiniband/hw/mlx5/mad.c
+++ b/drivers/infiniband/hw/mlx5/mad.c
@@ -66,7 +66,7 @@ static int process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
u16 slid;
int err;
- slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
+ slid = in_wc ? (u16)in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0)
return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index c7f49bbb0c72..d07f389aefb6 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -1913,7 +1913,7 @@ int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey,
(in_wc->wc_flags & IB_WC_GRH ? 0x80 : 0);
MTHCA_PUT(inbox, val, MAD_IFC_G_PATH_OFFSET);
- MTHCA_PUT(inbox, in_wc->slid, MAD_IFC_RLID_OFFSET);
+ MTHCA_PUT(inbox, (u16)in_wc->slid, MAD_IFC_RLID_OFFSET);
MTHCA_PUT(inbox, in_wc->pkey_index, MAD_IFC_PKEY_OFFSET);
if (in_grh)
@@ -1921,7 +1921,7 @@ int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey,
op_modifier |= 0x4;
- in_modifier |= in_wc->slid << 16;
+ in_modifier |= (u16)in_wc->slid << 16;
}
err = mthca_cmd_box(dev, inmailbox->dma, outmailbox->dma,
diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c
index ad63fa406d45..90706e3ec92c 100644
--- a/drivers/infiniband/hw/mthca/mthca_mad.c
+++ b/drivers/infiniband/hw/mthca/mthca_mad.c
@@ -203,7 +203,7 @@ int mthca_process_mad(struct ib_device *ibdev,
u16 *out_mad_pkey_index)
{
int err;
- u16 slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
+ u16 slid = in_wc ? (u16)in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
u16 prev_lid = 0;
struct ib_port_attr pattr;
const struct ib_mad *in_mad = (const struct ib_mad *)in;
diff --git a/drivers/infiniband/sw/rdmavt/cq.c b/drivers/infiniband/sw/rdmavt/cq.c
index f2f229efbe64..5236468684c9 100644
--- a/drivers/infiniband/sw/rdmavt/cq.c
+++ b/drivers/infiniband/sw/rdmavt/cq.c
@@ -105,7 +105,7 @@ void rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited)
wc->uqueue[head].src_qp = entry->src_qp;
wc->uqueue[head].wc_flags = entry->wc_flags;
wc->uqueue[head].pkey_index = entry->pkey_index;
- wc->uqueue[head].slid = entry->slid;
+ wc->uqueue[head].slid = (u16)entry->slid;
wc->uqueue[head].sl = entry->sl;
wc->uqueue[head].dlid_path_bits = entry->dlid_path_bits;
wc->uqueue[head].port_num = entry->port_num;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 75ddef64fea7..69d7e39c4f85 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -882,7 +882,7 @@ struct ib_wc {
u32 src_qp;
int wc_flags;
u16 pkey_index;
- u16 slid;
+ u32 slid;
u8 sl;
u8 dlid_path_bits;
u8 port_num; /* valid only for DR SMPs on switches */
--
1.8.2
--
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
^ permalink raw reply related
* [RFC PATCH 04/11] IB/core: Change lid size in struct ib_port_attr from 16 to 32 bits
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Dasaratharaman Chandramouli, Don Hiatt
In-Reply-To: <1474652674-13110-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
lid field in port_attr is increased to 32 bits. This enables core
components to use the larger addresses if needed.
The user ABI is unchanged and return 16 bit values when queried.
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/uverbs_cmd.c | 8 +++++---
drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +-
drivers/infiniband/hw/mlx4/mad.c | 2 +-
drivers/infiniband/hw/mthca/mthca_mad.c | 2 +-
drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 2 +-
drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +-
include/rdma/ib_verbs.h | 2 +-
7 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 4cb5238edceb..286ba8ca8cbd 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -515,11 +515,13 @@ 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;
- if (rdma_cap_opa_ah(ib_dev, cmd.port_num))
+ if (rdma_cap_opa_ah(ib_dev, cmd.port_num)) {
resp.sm_lid = OPA_TO_IB_UCAST_LID(attr.sm_lid);
- else
+ resp.lid = OPA_TO_IB_UCAST_LID(attr.lid);
+ } else {
resp.sm_lid = (u16)attr.sm_lid;
+ 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 c74ef2620b85..1b0a9abbe0ca 100644
--- a/drivers/infiniband/hw/mlx4/alias_GUID.c
+++ b/drivers/infiniband/hw/mlx4/alias_GUID.c
@@ -527,7 +527,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 9c2e53d28f98..39c098a9c3d5 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -794,7 +794,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 7c3f2fb44ba5..ad63fa406d45 100644
--- a/drivers/infiniband/hw/mthca/mthca_mad.c
+++ b/drivers/infiniband/hw/mthca/mthca_mad.c
@@ -254,7 +254,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/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index d3394b6add24..bff73b53bff8 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -581,7 +581,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
port_attr.state);
return;
}
- priv->local_lid = port_attr.lid;
+ priv->local_lid = (u16)port_attr.lid;
netif_addr_lock_bh(dev);
if (!test_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags)) {
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 87c911804d62..c14071afc78a 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -515,7 +515,7 @@ static int srpt_refresh_port(struct srpt_port *sport)
goto err_query_port;
sport->sm_lid = (u16)port_attr.sm_lid;
- sport->lid = port_attr.lid;
+ sport->lid = (u16)port_attr.lid;
ret = ib_query_gid(sport->sdev->device, sport->port, 0, &sport->gid,
NULL);
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index b4c070a3ecdf..75ddef64fea7 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -508,7 +508,7 @@ struct ib_port_attr {
u32 bad_pkey_cntr;
u32 qkey_viol_cntr;
u16 pkey_tbl_len;
- u16 lid;
+ u32 lid;
u32 sm_lid;
u8 lmc;
u8 max_vl_num;
--
1.8.2
--
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
^ permalink raw reply related
* [RFC PATCH 03/11] IB/sa: Modify SM Address handle to program GRH when using large lids
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Don Hiatt, Dasaratharaman Chandramouli
In-Reply-To: <1474652674-13110-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
When either the port lid or the sm lid is above the ib unicast lid
space, the SMI creates an address handle with the revelant GRH
information.
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/sa_query.c | 20 +++++++++++++++++++-
include/rdma/ib_addr.h | 2 ++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index b9bf7aa055e7..0f5fdfb787fb 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -958,7 +958,6 @@ static void update_sm_ah(struct work_struct *work)
pr_err("Couldn't find index for default PKey\n");
memset(&ah_attr, 0, sizeof ah_attr);
- ah_attr.dlid = port_attr.sm_lid;
ah_attr.sl = port_attr.sm_sl;
ah_attr.port_num = port->port_num;
if (port_attr.grh_required) {
@@ -967,6 +966,25 @@ static void update_sm_ah(struct work_struct *work)
ah_attr.grh.dgid.global.interface_id = cpu_to_be64(IB_SA_WELL_KNOWN_GUID);
}
+ if (rdma_cap_opa_ah(port->agent->device, port->port_num)) {
+ ah_attr.dlid = OPA_TO_IB_UCAST_LID(port_attr.sm_lid);
+ if ((port_attr.sm_lid >= be16_to_cpu(IB_MULTICAST_LID_BASE)) ||
+ (port_attr.lid >= be16_to_cpu(IB_MULTICAST_LID_BASE))) {
+ if (port_attr.grh_required)
+ pr_warn("Overwriting GRH specified in SM AH\n");
+ ah_attr.ah_flags = IB_AH_GRH;
+ ah_attr.grh.hop_limit = 1;
+ ah_attr.grh.sgid_index = 0;
+ /* Same prefix as sgid */
+ ah_attr.grh.dgid.global.subnet_prefix =
+ cpu_to_be64(port_attr.subnet_prefix);
+ ah_attr.grh.dgid.global.interface_id =
+ OPA_MAKE_ID(port_attr.sm_lid);
+ }
+ } else {
+ ah_attr.dlid = (u16)port_attr.sm_lid;
+ }
+
new_ah->ah = ib_create_ah(port->agent->qp->pd, &ah_attr);
if (IS_ERR(new_ah->ah)) {
pr_warn("Couldn't create new SM AH\n");
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index 04074d7e0763..e6293338dfb1 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -51,6 +51,8 @@
#define OPA_TO_IB_UCAST_LID(x) (((x) >= be16_to_cpu(IB_MULTICAST_LID_BASE)) \
? 0 : x)
+#define OPA_STL_OUI (0x00066AULL)
+#define OPA_MAKE_ID(x) (cpu_to_be64(OPA_STL_OUI << 40 | (x)))
struct rdma_addr_client {
atomic_t refcount;
--
1.8.2
--
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
^ permalink raw reply related
* [RFC PATCH 02/11] IB/core: Change port_attr.sm_lid from 16 to 32 bits
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Dasaratharaman Chandramouli, Don Hiatt
In-Reply-To: <1474652674-13110-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
sm_lid field in port_attr is increased to 32 bits. This
enables core components to use the larger addresses if needed.
The user ABI is unchanged and return 16 bit values when queried.
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/uverbs_cmd.c | 6 +++++-
drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +-
include/rdma/ib_addr.h | 3 +++
include/rdma/ib_verbs.h | 2 +-
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index f6647318138d..4cb5238edceb 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -39,6 +39,7 @@
#include <linux/sched.h>
#include <asm/uaccess.h>
+#include <rdma/ib_addr.h>
#include "uverbs.h"
#include "core_priv.h"
@@ -515,7 +516,10 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
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.sm_lid = OPA_TO_IB_UCAST_LID(attr.sm_lid);
+ else
+ resp.sm_lid = (u16)attr.sm_lid;
resp.lmc = attr.lmc;
resp.max_vl_num = attr.max_vl_num;
resp.sm_sl = attr.sm_sl;
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 883bbfe08e0e..87c911804d62 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -514,7 +514,7 @@ static int srpt_refresh_port(struct srpt_port *sport)
if (ret)
goto err_query_port;
- sport->sm_lid = port_attr.sm_lid;
+ sport->sm_lid = (u16)port_attr.sm_lid;
sport->lid = port_attr.lid;
ret = ib_query_gid(sport->sdev->device, sport->port, 0, &sport->gid,
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index 931a47ba4571..04074d7e0763 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -49,6 +49,9 @@
#include <net/ipv6.h>
#include <net/net_namespace.h>
+#define OPA_TO_IB_UCAST_LID(x) (((x) >= be16_to_cpu(IB_MULTICAST_LID_BASE)) \
+ ? 0 : x)
+
struct rdma_addr_client {
atomic_t refcount;
struct completion comp;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index a57fedbc83ed..b4c070a3ecdf 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -509,7 +509,7 @@ struct ib_port_attr {
u32 qkey_viol_cntr;
u16 pkey_tbl_len;
u16 lid;
- u16 sm_lid;
+ u32 sm_lid;
u8 lmc;
u8 max_vl_num;
u8 sm_sl;
--
1.8.2
--
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
^ permalink raw reply related
* [RFC PATCH 01/11] IB/core: Add rdma_cap_opa_ah to expose opa address handles
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Dasaratharaman Chandramouli, Don Hiatt
In-Reply-To: <1474652674-13110-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
rdma_cap_opa_ah(..) enables core components to check if the
corresponding port supports extended addresses
Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
include/rdma/ib_verbs.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index e1f96737c2a1..a57fedbc83ed 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -467,6 +467,7 @@ static inline struct rdma_hw_stats *rdma_alloc_hw_stats_struct(
/* Address format 0x000FF000 */
#define RDMA_CORE_CAP_AF_IB 0x00001000
#define RDMA_CORE_CAP_ETH_AH 0x00002000
+#define RDMA_CORE_CAP_OPA_AH 0x00004000
/* Protocol 0xFFF00000 */
#define RDMA_CORE_CAP_PROT_IB 0x00100000
@@ -2418,6 +2419,26 @@ static inline bool rdma_cap_eth_ah(const struct ib_device *device, u8 port_num)
}
/**
+ * rdma_cap_opa_ah - Check if the port of device has the capability
+ * OPA Address handle
+ * @device: Device to check
+ * @port_num: Port number to check
+ *
+ * OPA Address handles enable use of 32 bit LIDs by using a specially
+ * formatted GID field to carry the LID. This check enables kernel
+ * components to identify such a scheme so that they can then try
+ * to make use of the LID in the GID field.
+ *
+ * Return: true if we are running as a OPA device which enables
+ * 32 bit LIDs to be used in the fabric.
+ */
+static inline bool rdma_cap_opa_ah(struct ib_device *device, u8 port_num)
+{
+ return (device->port_immutable[port_num].core_cap_flags &
+ RDMA_CORE_CAP_OPA_AH) == RDMA_CORE_CAP_OPA_AH;
+}
+
+/**
* rdma_max_mad_size - Return the max MAD size required by this RDMA Port.
*
* @device: Device
--
1.8.2
--
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
^ permalink raw reply related
* [RFC PATCH 00/11] IB/core: Add 32 bit LID support
From: ira.weiny-ral2JQCrhuEAvxtiuMwx3w @ 2016-09-23 17:44 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Ira Weiny
From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
OPA devices can support more than 48K LIDs in the fabric. A node with a LID
greater than 0xbfff is called an 'extended lid'. In order to support verbs with
extended LIDs it is necessary to modify some of the RDMA data structures where
LIDs are currently only 16 bits in length.
This patch series follows on what was presented at the OFA Workshop. Rather
than breaking the current UABI we propose to extend the LID address space by
sending a 'special' GID value down the verbs stack that has the 32-bit LID
programmed in it. By having a means to differentiate a regular GID from our
'special' GID, the underlying OPA device driver is able to retrieve the 32-bit
LIDs from the GID fields instead of picking them up from the 16 bit lid fields.
Internal to the kernel data structures such as struct ib_wc, struct
ib_port_attr and related ones have been modified to use 32 bit LID fields.
These changes are specific to the kernel and do not break the current UABI.
Node <-> SM interaction in getting extended LID information
----------------------------------------------------------------------------
1. Source application determines the GID of the destination through standard
means and send a pathrecord query to the SM.
2. SM (which is OPA specific) recognizes that one or more nodes in the
pathrecord request uses extended LIDs.
3. SM issues a pathrecord response. The SGID and DGID fields in the pathrecord
response is the specially formulated GID.
4. Additionally, SM sets the hoplimit field of the pathrecord to 1.
5. Source receives the response and can determine the actual LID of the
destination, if needed, from the response.
Source Node <-> Destination Node interaction in using extended LID information
-------------------------------------------------------------------------------
1. Source uses the pathrecord response from the SM to create an address handle
to the destination (either at user or kernel space).
2. Since hoplimit field in the pathrecord is > 0, GRH fields are enabled in the
address handle.
3. Address handle information is now passed down through the RDMA stack and
reaches the driver.
4. Driver looks at the GRH fields in the address handle and determines that the
GID in the GRH is actually a special GID.
5. Driver retrieves LID from GID field and uses 16B bypass packets to send data
on the wire.
6. Driver at the receiving side determines that a GRH needs to be added to the
address handle before passing it on to the destination application.
7. Destination now receives the packet and can send back the response using the
same address handle information.
There are some obvious limitations with this scheme:
----------------------------------------------------
1. Multicast packets which always need a GRH cannot use this scheme.
Essentially multicast LIDs cannot be extended.
2. Subnet routed packets which also need a GRH cannot fully use this scheme.
Specifically the LID of the router itself cannot be extended.
The actual destination can still be extended.
3. Applications will need to use pathrecords to get destination address
information. Any other out-of-band mechanisms are not guaranteed to work.
4. As an extension to 3, applications that 'validate' pathrecord responses need
to be careful not to treat 0 LID field as an error condition.
Dasaratharaman Chandramouli (6):
IB/core: Add rdma_cap_opa_ah to expose opa address handles
IB/core: Change port_attr.sm_lid from 16 to 32 bits
IB/core: Change lid size in struct ib_port_attr from 16 to 32 bits
IB/IPoIB: Retrieve 32 bit LIDs from path records when running on OPA
devices
IB/IPoIB: Modify ipoib_get_net_dev_by_params to lookup gid table
IB/srpt: Increase lid and sm_lid to 32 bits
Don Hiatt (5):
IB/sa: Modify SM Address handle to program GRH when using large lids
IB/core: Change lid size in struct ib_wc from 16 to 32 bits
IB/mad: Ensure DR MADs are correctly specified when using OPA devices
IB/mad: Change slid in RMPP recv from 16 to 32 bits
IB/rdmavt: Modify rvt_check_ah() to account for extended LIDs
drivers/infiniband/core/cm.c | 4 +-
drivers/infiniband/core/mad.c | 100 ++++++++++++++++++++++++++----
drivers/infiniband/core/mad_rmpp.c | 18 +++++-
drivers/infiniband/core/sa_query.c | 20 +++++-
drivers/infiniband/core/user_mad.c | 2 +-
drivers/infiniband/core/uverbs_cmd.c | 12 +++-
drivers/infiniband/hw/hfi1/hfi.h | 3 +-
drivers/infiniband/hw/hfi1/mad.c | 2 +-
drivers/infiniband/hw/hfi1/verbs.c | 13 ++++
drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +-
drivers/infiniband/hw/mlx4/mad.c | 8 +--
drivers/infiniband/hw/mlx5/mad.c | 2 +-
drivers/infiniband/hw/mthca/mthca_cmd.c | 4 +-
drivers/infiniband/hw/mthca/mthca_mad.c | 4 +-
drivers/infiniband/hw/qib/qib_verbs.c | 9 +++
drivers/infiniband/sw/rdmavt/ah.c | 10 ---
drivers/infiniband/sw/rdmavt/cq.c | 2 +-
drivers/infiniband/sw/rdmavt/qp.c | 9 ++-
drivers/infiniband/ulp/ipoib/ipoib.h | 4 +-
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 11 ++++
drivers/infiniband/ulp/ipoib/ipoib_main.c | 63 ++++++++++++++++++-
drivers/infiniband/ulp/srpt/ib_srpt.h | 4 +-
include/rdma/ib_addr.h | 31 +++++++++
include/rdma/ib_verbs.h | 27 +++++++-
24 files changed, 309 insertions(+), 55 deletions(-)
--
1.8.2
--
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
^ permalink raw reply
* Re: [PATCH rdma-next V3 0/6] Refactor RDMA IOCTL declarations
From: Doug Ledford @ 2016-09-23 17:34 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1472988635-31463-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2708 bytes --]
On 9/4/2016 7:30 AM, Leon Romanovsky wrote:
> Hi Doug,
>
> This patch set refactors RDMA IOCTL declarations, unifies their
> location, moves all current IOCTL exporters to one place and renames
> them to fix the differences in coding style.
>
> IOCTLs commands need to export the size of their data for their transfer
> which is usually declared as a struct defined in relevant submodule.
> These structures should be visible at the linkage stage.
>
> There are number of possible solutions to overcome this limitations.
>
> One of the options is to declare anonymous variable which will be visible
> during the linkage. As a downside, such option won't allow direct use of
> this header by other parts of code without their specific includes of
> other logically unrelated submodules.
>
> Another possible option will be to move declarations of that structures
> to that common header file. Such move will cause to bloat this file
> with different submodules declarations.
>
> Our decision was to choose direct include of other exported files with
> declarations of such structures to simplify future usage of this file.
> There is no change for legacy applications and libraries.
>
> Changes v2->v3:
> * Added Jason's Reviewed-by
> * Open-ceded ioctl indexes
>
> Changes v0->v2 (v1 was skipped):
> * Update commit messages of patch number 3 and 6.
>
> Available in the "topic/ioctl-header" topic branch of this git repo:
> git://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git
>
> Or for browsing:
> https://git.kernel.org/cgit/linux/kernel/git/leon/linux-rdma.git/log/?h=topic/ioctl-header
>
> Thanks
>
> Leon Romanovsky (6):
> RDMA/core: Commonize RDMA IOCTL declarations location
> RDMA/core: Move legacy MAD IOCTL declarations to common file
> RDMA/hfi1: Avoid redeclaration error
> RDMA/core: Move HFI1 IOCTL declarations to common file
> RDMA/core: Rename RDMA magic number
> RDMA/core: Unify style of IOCTL commands
>
> include/uapi/rdma/Kbuild | 1 +
> include/uapi/rdma/hfi/Kbuild | 1 +
> include/uapi/rdma/hfi/hfi1_ioctl.h | 173 +++++++++++++++++++++++++++++++++++
> include/uapi/rdma/hfi/hfi1_user.h | 175 +-----------------------------------
> include/uapi/rdma/ib_user_mad.h | 14 +--
> include/uapi/rdma/rdma_user_ioctl.h | 87 ++++++++++++++++++
> 6 files changed, 264 insertions(+), 187 deletions(-)
> create mode 100644 include/uapi/rdma/hfi/hfi1_ioctl.h
> create mode 100644 include/uapi/rdma/rdma_user_ioctl.h
>
> --
> 2.7.4
>
Series applied.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Jason Gunthorpe @ 2016-09-23 17:34 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford
In-Reply-To: <20160923171003.GR4088-2ukJVAZIZ/Y@public.gmane.org>
On Fri, Sep 23, 2016 at 08:10:03PM +0300, Leon Romanovsky wrote:
> I sure that this question will sound dumb for you, but can we unify all
> code under OFA's licenses (dual-license)? I don't feel comfortable with
> this multi-license situation.
It is an excellent question.
To do this we would need the OFA to talk to each of the member
companies and get them to sign some kind of legal change of copyright
document. Assuming all of the member companies agree, and all the
member companies are the exhaustive copyright owners then the code can
be placed under a single uniform license.
As I understand it all OFA members were required to agree to use a
specific licensing scheme, including specific license text when they
signed the OFA membership agreement. What we are seeing here is that
the corporate legal side agreed to something but the developers made
small errors along the way, and those errors were later copied by
other developers and spread widely. So the OFA has a basis for
requests of this nature.
For instance, a legal statement from Mellanox that all code they
contributed is available under the GPLv2 or *either* MIT or FreeBSD
license varient would allow immediately placing all Mellanox
copyrighted code under the single Default License. I expect this is
what Mellanox intended to do anyhow, the fact that ibverbs and all
their providers had an error in the COPYING file is simply
an unfortunate mistake.
These sorts of license issues are typical in historical code bases. I
would say we are in pretty good shape, from what I can tell absolutely
everything is unambiguously licensed under at least the GPLv2, or a
compatible license.
Almost everything is alternatively licensed under some kind of BSD
license. The notable exception is ipathverbs and rxe. It is also
unfortunate we have so many BSD variants.
Further, almost all C code is licensed under the dual GPLv2/OpenIB.org
(MIT) license. The kernel is similar, almost all C code is using the
MIT variant. Hence my desire to make that the license for new code in
the tree.
I would say this is a pretty good result.
My ultimate suggestion is that we push the non-default copyright into
the impacted files, eg add short licenses headers to the man pages,
etc, and then delete the extraneous COPYING files once every single
file has a correct license statement. From that point we can look at
switching individual files based on the above Legal process to the
Default License, or just leave them as is - a historical quirk.
Jason
--
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
^ permalink raw reply
* Re: [PATCH rdma-next V3 6/6] RDMA/core: Unify style of IOCTL commands
From: Doug Ledford @ 2016-09-23 17:32 UTC (permalink / raw)
To: Leon Romanovsky, Dalessandro, Dennis
Cc: matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
In-Reply-To: <20160907070109.GC3639-2ukJVAZIZ/Y@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1289 bytes --]
On 9/7/2016 3:01 AM, Leon Romanovsky wrote:
> On Tue, Sep 06, 2016 at 01:00:12PM +0000, Dalessandro, Dennis wrote:
>> On Sun, 2016-09-04 at 14:30 +0300, Leon Romanovsky wrote:
>>> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>>
>>> MAD and HFI1 have different naming convention, this patch
>>> simplifies and unifies their defines and names.
>>>
>>> As part of cleanup, the HFI1 _NUM() macro and command indexes
>>> were removed. It has a potential to break applications which use
>>> these defines directly, while shouldn't.
>>
>> Please be explicit. It's not that it has potential. It *will* break
>> applications which use these defines directly.
>
> Yes, you are right.
>
> Doug,
> What do you expect from me? Respin?
No, I reworded the commit message myself:
RDMA/core: Unify style of IOCTL commands
MAD and HFI1 have different naming convention, this patch
simplifies and unifies their defines and names.
As part of cleanup, the HFI1 _NUM() macro and command indexes were
removed (controversial). This will cause intentional (and arguably
unnecessary) breakage to the PSM user space library.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-next V3 6/6] RDMA/core: Unify style of IOCTL commands
From: Doug Ledford @ 2016-09-23 17:31 UTC (permalink / raw)
To: Leon Romanovsky
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Matan Barak, Haggai Eran
In-Reply-To: <20160905053342.GW21847-2ukJVAZIZ/Y@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1432 bytes --]
On 9/5/2016 1:33 AM, Leon Romanovsky wrote:
> On Sun, Sep 04, 2016 at 02:30:35PM +0300, Leon Romanovsky wrote:
>> From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>
>> MAD and HFI1 have different naming convention, this patch
>> simplifies and unifies their defines and names.
>>
>> As part of cleanup, the HFI1 _NUM() macro and command indexes
>> were removed. It has a potential to break applications which use
>> these defines directly, while shouldn't.
>>
>> Signed-off-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>> Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>> Reviewed-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
>> ---
>> include/uapi/rdma/rdma_user_ioctl.h | 98 ++++++++++++++-----------------------
>> 1 file changed, 38 insertions(+), 60 deletions(-)
>>
>
> <....>
>
>> /*
>> - * User IOCTLs can not go above 128 if they do then see common.h and change the
>> - * base for the snoop ioctl
>> + * General blocks assignments
>> + * It is closed on purpose do not expose it it user space
>
> Doug,
> Do you mind to change "it it" to be "it to" and save to everyone
> respin?
Fixed.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* RE: [PATCH rdma-core] Improve global COPYING files
From: Hefty, Sean @ 2016-09-23 17:23 UTC (permalink / raw)
To: Leon Romanovsky, Jason Gunthorpe
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Doug Ledford
In-Reply-To: <20160923171003.GR4088-2ukJVAZIZ/Y@public.gmane.org>
> > As you know I've sent emails to various parties on licensing issues,
> > as those issues are corrected we can update the tree and the copying
> > summary.
> >
> > We've already had success correcting one mistake from Intel and
> > Chelsio, thank you very much to those companies.
> >
> > It is important we clearly document the current situation so our
> > downstreams can properly distribute this code.
>
> I sure that this question will sound dumb for you, but can we unify all
> code under OFA's licenses (dual-license)? I don't feel comfortable with
> this multi-license situation.
If this combined repo is intended to support the plumbing for the linux-rdma subsystem, then I think it must support code that is submitted under GPL only. Much of the tradition code can remain dual-license, but new provider code, for example, should be submit-able under GPL.
--
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
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Leon Romanovsky @ 2016-09-23 17:12 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Doug Ledford
In-Reply-To: <20160923170314.GA13920-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 632 bytes --]
On Fri, Sep 23, 2016 at 11:03:14AM -0600, Jason Gunthorpe wrote:
> On Fri, Sep 23, 2016 at 04:58:48PM +0000, Hefty, Sean wrote:
> > > diff --git a/COPYING.BSD_FB b/COPYING.BSD_FB
> > > new file mode 100644
> > > index 000000000000..44237612faa3
> > > +++ b/COPYING.BSD_FB
> > > @@ -0,0 +1,22 @@
> > > + OpenIB.org BSD license (FreeBSD Variant)
> >
> > Openib.org doesn't exist. Can we just drop that term from the files?
>
> Maybe? I don't know, that is starting to go down the path that Leon
> alluded to regarding getting legal advice.
Yeah, because Leon doesn't understand (and doesn't want to understand)
this legal crap.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Leon Romanovsky @ 2016-09-23 17:10 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford
In-Reply-To: <20160923152412.GB11269-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2342 bytes --]
On Fri, Sep 23, 2016 at 09:24:12AM -0600, Jason Gunthorpe wrote:
> On Fri, Sep 23, 2016 at 11:06:55AM +0300, Leon Romanovsky wrote:
> > On Thu, Sep 22, 2016 at 10:13:40PM -0600, Jason Gunthorpe wrote:
> > > Upon deeper analysis it seems there are two variations of the 'OpenIB.org BSD
> > > license', I am calling them the MIT and FreeBSD variants. They differ only in
> > > the text of the disclaimer. The MIT version is used widely as the source
> > > license so that version should be the 'default' in the source tree, not the
> > > FreeBSD version I had selected initially.
> > >
> > > Retain the FreeBSD version as we will refer to it in future commits.
> > >
> > > Elaborate the COPYING file to discuss the license situation in
> > > more depth.
> >
> > I doubt that we have appropriate knowledge to come with meaningful
> > conclusion after "discussion". It is legal issue which should be
> > handled by relevant legal departments.
>
> Hi Leon,
>
> I think the commit message was not clear, let me try again:
>
> [PATCH] Document copyright situation and select default license
>
> This patch is not intended to change the copyright or license
> situation of any of the original code.
>
> Documentation is provided that identifies the various licenses we
> have in the source tree.
>
> The default license for new items after the 'Initial commit' merge is
> corrected to match the majority license already in use. This is the
> license we recommend all new code use. This corrects a mistake I made
> in the 'Unified CMake build system' patch which selected the wrong
> license file.
>
> Also provide specific guidance on how the 18 different COPYING files
> and per-file copyright headers are intended to be interpreted
> within the merged tree.
>
> =======
>
> As you know I've sent emails to various parties on licensing issues,
> as those issues are corrected we can update the tree and the copying
> summary.
>
> We've already had success correcting one mistake from Intel and
> Chelsio, thank you very much to those companies.
>
> It is important we clearly document the current situation so our
> downstreams can properly distribute this code.
I sure that this question will sound dumb for you, but can we unify all
code under OFA's licenses (dual-license)? I don't feel comfortable with
this multi-license situation.
>
> Jason
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: libmlx5 list.h
From: Leon Romanovsky @ 2016-09-23 17:04 UTC (permalink / raw)
To: Christoph Hellwig
Cc: yishaih-VPRAkNaXOzVWk0Htik3J/w, eli-VPRAkNaXOzVWk0Htik3J/w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20160923155901.GA17362-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 815 bytes --]
On Fri, Sep 23, 2016 at 08:59:01AM -0700, Christoph Hellwig wrote:
> Hi all,
>
> libmlx5 comes with a partial copy of the kernel list.h despite claiming
> to be available under a BSD license. As far as I know the kernel
> list.h implementation never has been available under anything but the
> GPLv2.
1. BSD list.h implementation [1] is very similar to the linux kernel version.
2. I'm working to create separate directory to put common code (min,
max, lists) into one place with proper license.
Thanks
[1]
https://github.com/lattera/freebsd/blob/master/sys/ofed/include/linux/list.h
> --
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Jason Gunthorpe @ 2016-09-23 17:03 UTC (permalink / raw)
To: Hefty, Sean
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Doug Ledford,
Leon Romanovsky
In-Reply-To: <1828884A29C6694DAF28B7E6B8A82373AB08E609-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
On Fri, Sep 23, 2016 at 04:58:48PM +0000, Hefty, Sean wrote:
> > diff --git a/COPYING.BSD_FB b/COPYING.BSD_FB
> > new file mode 100644
> > index 000000000000..44237612faa3
> > +++ b/COPYING.BSD_FB
> > @@ -0,0 +1,22 @@
> > + OpenIB.org BSD license (FreeBSD Variant)
>
> Openib.org doesn't exist. Can we just drop that term from the files?
Maybe? I don't know, that is starting to go down the path that Leon
alluded to regarding getting legal advice.
That would be a different patch, IMHO.
Normally I'd say to avoid confusion it is good to stick with the
historical names, but in this case there are three things calling
themselves the openib.org bsd license, so I don't know :|
Jason
--
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
^ permalink raw reply
* RE: [PATCH rdma-core] Improve global COPYING files
From: Hefty, Sean @ 2016-09-23 16:58 UTC (permalink / raw)
To: Jason Gunthorpe,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Doug Ledford, Leon Romanovsky
In-Reply-To: <20160923041340.GA11269-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> diff --git a/COPYING.BSD_FB b/COPYING.BSD_FB
> new file mode 100644
> index 000000000000..44237612faa3
> --- /dev/null
> +++ b/COPYING.BSD_FB
> @@ -0,0 +1,22 @@
> + OpenIB.org BSD license (FreeBSD Variant)
Openib.org doesn't exist. Can we just drop that term from the files?
--
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
^ permalink raw reply
* Re: [PATCH rdma-next V2 0/9] Export vendors specific ABIs
From: Leon Romanovsky @ 2016-09-23 16:58 UTC (permalink / raw)
To: Doug Ledford
Cc: Christoph Hellwig, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
Jason Gunthorpe, Laurence Oberman
In-Reply-To: <701c2cd1-a47a-807d-41dc-c8057dd073bd-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 937 bytes --]
On Fri, Sep 23, 2016 at 12:42:02PM -0400, Doug Ledford wrote:
> On 9/22/2016 12:09 PM, Leon Romanovsky wrote:
> > On Thu, Sep 22, 2016 at 07:47:16AM -0700, Christoph Hellwig wrote:
> >> Although I would have removed patch 8
> >
> > I'm not sure about it, but anyway it is separate patch which can be
> > easily dropped by Doug when he will apply it.
>
> Mostly easily, yes.
>
> >> and add the Kconfig changes to
> >> each individual driver change instead.
> >
> > I want logically separate move part and export part of this patch
> > series.
>
> There's no reason to separate them. And it leaves dangling uapi header
> files that are in the uapi directory but not listed in the Kconfig. I
> squashed the Kconfig changes and also the MAINTAINERS changes down into
> the main patches, so the series is now only 7 patches.
Thanks.
>
> --
> Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> GPG Key ID: 0E572FDD
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* [PATCH TRIVIAL rdma-core] README.md: Fix umad library name
From: Hal Rosenstock @ 2016-09-23 16:56 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford, Leon Romanovsky,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
diff --git a/README.md b/README.md
index 65c7644..65514ff 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ following device nodes:
- /dev/infiniband/uverbsX (libibverbs)
- /dev/infiniband/rdma_cm (librdmacm)
- - /dev/infiniband/umadX (libumad)
+ - /dev/infiniband/umadX (libibumad)
- /dev/infiniband/ucmX (libibcm, deprecated)
The userspace component of the libibverbs RDMA kernel drivers are included
--
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
^ permalink raw reply related
* Re: [PATCH rdma-rc 4/7] IB/mlx4: Fix possible vl/sl field mismatch in LRH header in QP1 packets
From: Doug Ledford @ 2016-09-23 16:48 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Jack Morgenstein
In-Reply-To: <20160918065356.GA2923-2ukJVAZIZ/Y@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2958 bytes --]
On 9/18/2016 2:53 AM, Leon Romanovsky wrote:
> On Fri, Sep 16, 2016 at 02:01:57PM -0400, Doug Ledford wrote:
>> On 9/12/2016 12:16 PM, Leon Romanovsky wrote:
>>> From: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
>>>
>>> In MLX qp packets, the LRH (built by the driver) has both a VL field
>>> and an SL field. When building a QP1 packet, the VL field should
>>> reflect the SLtoVL mapping and not arbitrarily contain zero (as is
>>> done now). This bug causes credit problems in IB switches at
>>> high rates of QP1 packets.
>>>
>>> The fix is to cache the SL to VL mapping in the driver, and look up
>>> the VL mapped to the SL provided in the send request when sending
>>> QP1 packets.
>>>
>>> For FW versions which support generating a port_management_config_change
>>> event with subtype sl-to-vl-table-change, the driver uses that event
>>> to update its sl-to-vl mapping cache. Otherwise, the driver snoops
>>> incoming SMP mads to update the cache.
>>>
>>> There remains the case where the FW is running in secure-host mode
>>> (so no QP0 packets are delivered to the driver), and the FW does not
>>> generate the sl2vl mapping change event. To support this case, the
>>> driver updates (via querying the FW) its sl2vl mapping cache when
>>> running in secure-host mode when it receives either a Port Up event
>>> or a client-reregister event (where the port is still up, but there
>>> may have been an opensm failover).
>>> OpenSM modifies the sl2vl mapping before Port Up and Client-reregister
>>> events occur, so if there is a mapping change the driver's cache will
>>> be properly updated.
>>>
>>> Fixes: 225c7b1feef1 ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters")
>>> Signed-off-by: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
>>> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>> ---
>>> drivers/infiniband/hw/mlx4/mad.c | 64 ++++++++++++++++++-
>>> drivers/infiniband/hw/mlx4/main.c | 110 +++++++++++++++++++++++++++++++-
>>> drivers/infiniband/hw/mlx4/mlx4_ib.h | 7 ++
>>> drivers/infiniband/hw/mlx4/qp.c | 23 ++++++-
>>> drivers/net/ethernet/mellanox/mlx4/fw.c | 13 ++--
>>> include/linux/mlx4/device.h | 13 +++-
>>> 6 files changed, 220 insertions(+), 10 deletions(-)
>>
>> That's a lot more code churn than I would like to see in a late RC. I'm
>> going to drop this patch and move it to 4.9 instead. If this fixed an
>> oops or something like that, I would be more open to taking it now, but
>> the problem being resolved is credits on a switch. That isn't the sort
>> of showstopper issue that would justify this large of a patch this late
>> in the cycle.
>
> No problem, Thanks.
This is now in my 4.9-misc branch.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-next V2 0/9] Export vendors specific ABIs
From: Doug Ledford @ 2016-09-23 16:42 UTC (permalink / raw)
To: Leon Romanovsky, Christoph Hellwig
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Jason Gunthorpe,
Laurence Oberman
In-Reply-To: <20160922160924.GI4088-2ukJVAZIZ/Y@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 846 bytes --]
On 9/22/2016 12:09 PM, Leon Romanovsky wrote:
> On Thu, Sep 22, 2016 at 07:47:16AM -0700, Christoph Hellwig wrote:
>> Although I would have removed patch 8
>
> I'm not sure about it, but anyway it is separate patch which can be
> easily dropped by Doug when he will apply it.
Mostly easily, yes.
>> and add the Kconfig changes to
>> each individual driver change instead.
>
> I want logically separate move part and export part of this patch
> series.
There's no reason to separate them. And it leaves dangling uapi header
files that are in the uapi directory but not listed in the Kconfig. I
squashed the Kconfig changes and also the MAINTAINERS changes down into
the main patches, so the series is now only 7 patches.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* libmlx5 list.h
From: Christoph Hellwig @ 2016-09-23 15:59 UTC (permalink / raw)
To: yishaih-VPRAkNaXOzVWk0Htik3J/w, eli-VPRAkNaXOzVWk0Htik3J/w
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Hi all,
libmlx5 comes with a partial copy of the kernel list.h despite claiming
to be available under a BSD license. As far as I know the kernel
list.h implementation never has been available under anything but the
GPLv2.
--
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
^ permalink raw reply
* Re: [PATCH 00/23] rdma-core Trivial fixes and documentation updates
From: Doug Ledford @ 2016-09-23 15:54 UTC (permalink / raw)
To: Jason Gunthorpe, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474495729-17604-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1852 bytes --]
On 9/21/2016 6:08 PM, Jason Gunthorpe wrote:
> This is the next batch of fixes, the 23 patches are all straight forward and
> should be uncontroversial. Most are documentation updates, plus a few
> obviously correct fixes from static checkers.
>
> Please forward Acks and I will apply this to the github soonish.
>
> The tree is here:
> https://github.com/linux-rdma/rdma-core
>
> View the patches on github:
> https://github.com/linux-rdma/rdma-core/pull/2
>
> Christoph Hellwig (6):
> Add reporting bugs and submitting patches sections to README.md
> verbs: Move documentation to Documentation/
> rdmacm: Move documentation to Documentation/
> ibcm: Move documentation to Documentation/
> rxe: Move documentation to Documentation/
> srp_daemon: Move documentation to Documentation/
>
> Jason Gunthorpe (16):
> Consolidate the .gitignore files
> Move the AUTHORS files into MAINTAINERS
> mlx5: Add cmake options to replace --with-mlx5_debug/mw_debug
> ipathverbs: Recognize bashisms in truescale-serdes.cmds
> nes: Fix clang 3.6 warning
> -Wtautological-constant-out-of-range-compare
> ocrdma: Fix incorrect type of ibwc_status
> ocrdma: Fix incorrect enum constant
> verbs: Fix incorrect type of len
> verbs: Use inttypes.h format string macros
> rdmacm: Use correct format specifier for size_t
> rdmacm: Fix leading \'s in rcopy man page
> rdmacm: Fix typos
> umad: Replace .nl with .sp in man pages
> iwpmd: Install ancillary files for iwpm
> iwpmd: Remove syslog.target from service file
> srp_daemon: Use SRP_DEFAULT_START/STOP for substitution
>
> Steve Wise (1):
> iwpmd: Add man pages
Series looks good. I pushed it to rdma-core master.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* [PATCH v1] rdma_rxe: Ensure rdma_rxe init occurs at correct time
From: Stephen Bates @ 2016-09-23 15:32 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, monis-VPRAkNaXOzVWk0Htik3J/w,
dledford-H+wXaHxf7aLQT0dZR+AlfA, yonatanc-VPRAkNaXOzVWk0Htik3J/w
This patch is based off v4.8-rc6 with the recent rxe bugfix patchset
applied [1].
There is a problem when CONFIG_RDMA_RXE=y and CONFIG_IPV6=y. This
results in the rdma_rxe initialization occurring before the IPv6
services are ready. This patch delays the initialization of rdma_rxe
until after the IPv6 services are ready. This fix is based on one
proposed by Logan Gunthorpe on a much older code base [2].
[1] http://marc.info/?l=linux-rdma&m=147307739626544&w=2
[2] https://github.com/sbates130272/qemu-minimal/blob/rdma/patches/\
0001-Changes-needed-to-use-rxe-compiled-into-the-kernel.patch
Changes since v0:
Improved the commit message
Added a Reviewed-by tag from Yonatan
Signed-off-by: Stephen Bates <sbates-pv7U853sEMVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/sw/rxe/rxe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
index 08e09d9..97bc74a 100644
--- a/drivers/infiniband/sw/rxe/rxe.c
+++ b/drivers/infiniband/sw/rxe/rxe.c
@@ -392,5 +392,5 @@ static void __exit rxe_module_exit(void)
pr_info("rxe: unloaded\n");
}
-module_init(rxe_module_init);
+late_initcall(rxe_module_init);
module_exit(rxe_module_exit);
--
2.1.4
--
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
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox