IB/core,rdmavt,hfi1,opa-vnic: Send OPA cap_mask3 in trap

Provide the ability for IB clients to modify the OPA specific
capability mask and include this mask in the subsequent trap data.

Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Michael N. Henry <michael.n.henry@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Vishwanathapura, Niranjana
2017-06-01 17:04:02 -07:00
committed by Doug Ledford
parent bb7dde8784
commit cb49366f36
7 changed files with 44 additions and 11 deletions

View File

@@ -52,7 +52,9 @@
#include <linux/module.h>
#include <rdma/ib_addr.h>
#include <rdma/ib_smi.h>
#include <rdma/ib_verbs.h>
#include <rdma/opa_smi.h>
#include <rdma/opa_port_info.h>
#include "opa_vnic_internal.h"
@@ -979,6 +981,27 @@ static int vema_register(struct opa_vnic_ctrl_port *cport)
return 0;
}
/**
* opa_vnic_ctrl_config_dev -- This function sends a trap to the EM
* by way of ib_modify_port to indicate support for ethernet on the
* fabric.
* @cport: pointer to control port
* @en: enable or disable ethernet on fabric support
*/
static void opa_vnic_ctrl_config_dev(struct opa_vnic_ctrl_port *cport, bool en)
{
struct ib_port_modify pm = { 0 };
int i;
if (en)
pm.set_port_cap_mask = OPA_CAP_MASK3_IsEthOnFabricSupported;
else
pm.clr_port_cap_mask = OPA_CAP_MASK3_IsEthOnFabricSupported;
for (i = 1; i <= cport->num_ports; i++)
ib_modify_port(cport->ibdev, i, IB_PORT_OPA_MASK_CHG, &pm);
}
/**
* opa_vnic_vema_add_one -- Handle new ib device
* @device: ib device pointer
@@ -1007,6 +1030,7 @@ static void opa_vnic_vema_add_one(struct ib_device *device)
c_info("VNIC client initialized\n");
ib_set_client_data(device, &opa_vnic_client, cport);
opa_vnic_ctrl_config_dev(cport, true);
}
/**
@@ -1025,6 +1049,7 @@ static void opa_vnic_vema_rem_one(struct ib_device *device,
return;
c_info("removing VNIC client\n");
opa_vnic_ctrl_config_dev(cport, false);
vema_unregister(cport);
kfree(cport);
}