From: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
eitan-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH rdma-next V2 04/10] IB/core: Support accessing SA in virtualized environment
Date: Tue, 8 Mar 2016 18:36:52 +0200 [thread overview]
Message-ID: <1457455018-17638-5-git-send-email-eli@mellanox.com> (raw)
In-Reply-To: <1457455018-17638-1-git-send-email-eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Per the ongoing standardisation process, when virtual HCAs are present
in a network, traffic is routed based on a destination GID. In order to
access the SA we use the well known SA GID.
We also add a GRH required boolean field to the port attributes which is
used to report to the verbs consumer whether this port is connected to a
virtual network. We use this field to realize whether we need to create
an address vector with GRH to access the subnet administrator. We clear
the port attributes struct before calling the hardware driver to make
sure the default remains that GRH is not required.
Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/core/sa_query.c | 5 +++++
include/rdma/ib_verbs.h | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index f334090bb612..4fb97df2caa5 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -886,6 +886,11 @@ static void update_sm_ah(struct work_struct *work)
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) {
+ ah_attr.ah_flags = IB_AH_GRH;
+ ah_attr.grh.dgid.global.subnet_prefix = cpu_to_be64(port_attr.subnet_prefix);
+ ah_attr.grh.dgid.global.interface_id = cpu_to_be64(IB_SA_WELL_KNOWN_GUID);
+ }
new_ah->ah = ib_create_ah(port->agent->qp->pd, &ah_attr);
if (IS_ERR(new_ah->ah)) {
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index b3646e30e25d..8add3db9a244 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -97,6 +97,10 @@ enum rdma_node_type {
RDMA_NODE_USNIC_UDP,
};
+enum {
+ IB_SA_WELL_KNOWN_GUID = 2,
+};
+
enum rdma_transport_type {
RDMA_TRANSPORT_IB,
RDMA_TRANSPORT_IWARP,
@@ -510,6 +514,7 @@ struct ib_port_attr {
u8 active_speed;
u8 phys_state;
u64 subnet_prefix;
+ bool grh_required;
};
enum ib_device_modify_flags {
--
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
next prev parent reply other threads:[~2016-03-08 16:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-08 16:36 [PATCH rdma-next V2 00/10] IB SR-IOV support Eli Cohen
[not found] ` <1457455018-17638-1-git-send-email-eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-03-08 16:36 ` [PATCH rdma-next V2 01/10] net/core: Add support for configuring VF GUIDs Eli Cohen
2016-03-08 16:36 ` [PATCH rdma-next V2 02/10] IB/mlx5: Fix decision on using MAD_IFC Eli Cohen
2016-03-08 16:36 ` [PATCH rdma-next V2 03/10] IB/core: Add subnet prefix to port info Eli Cohen
[not found] ` <1457455018-17638-4-git-send-email-eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-03-08 17:57 ` Jason Gunthorpe
[not found] ` <20160308175752.GD10805-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-03-08 18:04 ` Eli Cohen
2016-03-08 16:36 ` Eli Cohen [this message]
2016-03-08 16:36 ` [PATCH rdma-next V2 05/10] IB/core: Add interfaces to control VF attributes Eli Cohen
2016-03-08 16:36 ` [PATCH rdma-next V2 06/10] IB/ipoib: Add ndo operations for configuring VFs Eli Cohen
2016-03-08 16:36 ` [PATCH rdma-next V2 07/10] net/mlx5_core: Add VF param when querying vport counter Eli Cohen
2016-03-08 16:36 ` [PATCH rdma-next V2 08/10] net/mlx5_core: Implement modify HCA vport command Eli Cohen
2016-03-08 16:36 ` [PATCH rdma-next V2 09/10] IB/mlx5: Implement callbacks for manipulating VFs Eli Cohen
2016-03-08 16:36 ` [PATCH rdma-next V2 10/10] IB/ipoib: Allow mcast packets from other VFs Eli Cohen
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=1457455018-17638-5-git-send-email-eli@mellanox.com \
--to=eli-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=eitan-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=liranl-VPRAkNaXOzVWk0Htik3J/w@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