@@ -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)) {
@@ -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 {