]> git.karo-electronics.de Git - linux-beck.git/commitdiff
IB/core: Support accessing SA in virtualized environment
authorEli Cohen <eli@mellanox.com>
Fri, 11 Mar 2016 20:58:37 +0000 (22:58 +0200)
committerDoug Ledford <dledford@redhat.com>
Mon, 21 Mar 2016 20:34:06 +0000 (16:34 -0400)
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@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/sa_query.c
include/rdma/ib_verbs.h

index 8e3bf6c8d3c3ef120e3e93145583af0006eba53e..d2214a55ac4ac4bab9aa4f9c7540745f96ab02ec 100644 (file)
@@ -885,6 +885,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)) {
index 7239b9a4499e857d251158b4616527ea23ddc985..3a5a66b7a33f21cafc73e755acf2ed6c5d15cbce 100644 (file)
@@ -97,6 +97,11 @@ enum rdma_node_type {
        RDMA_NODE_USNIC_UDP,
 };
 
+enum {
+       /* set the local administered indication */
+       IB_SA_WELL_KNOWN_GUID   = BIT_ULL(57) | 2,
+};
+
 enum rdma_transport_type {
        RDMA_TRANSPORT_IB,
        RDMA_TRANSPORT_IWARP,
@@ -510,6 +515,7 @@ struct ib_port_attr {
        u8                      active_width;
        u8                      active_speed;
        u8                      phys_state;
+       bool                    grh_required;
 };
 
 enum ib_device_modify_flags {