mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 23:53:55 +08:00
IB/opa-vnic: VNIC Ethernet Management Agent (VEMA) function
OPA VEMA function interfaces with the Infiniband MAD stack to exchange the management information packets with the Ethernet Manager (EM). It interfaces with the OPA VNIC netdev function to SET/GET the management information. The information exchanged with the EM includes class port details, encapsulation configuration, various counters, unicast and multicast MAC list and the MAC table. It also supports sending traps to the EM. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Sadanand Warrier <sadanand.warrier@intel.com> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
cfd34f8eb0
commit
1bd671ab3f
@ -4,4 +4,4 @@
|
|||||||
obj-$(CONFIG_INFINIBAND_OPA_VNIC) += opa_vnic.o
|
obj-$(CONFIG_INFINIBAND_OPA_VNIC) += opa_vnic.o
|
||||||
|
|
||||||
opa_vnic-y := opa_vnic_netdev.o opa_vnic_encap.o opa_vnic_ethtool.o \
|
opa_vnic-y := opa_vnic_netdev.o opa_vnic_encap.o opa_vnic_ethtool.o \
|
||||||
opa_vnic_vema_iface.o
|
opa_vnic_vema.o opa_vnic_vema_iface.o
|
||||||
|
@ -120,6 +120,17 @@ static struct vnic_stats vnic_gstrings_stats[] = {
|
|||||||
|
|
||||||
#define VNIC_STATS_LEN ARRAY_SIZE(vnic_gstrings_stats)
|
#define VNIC_STATS_LEN ARRAY_SIZE(vnic_gstrings_stats)
|
||||||
|
|
||||||
|
/* vnic_get_drvinfo - get driver info */
|
||||||
|
static void vnic_get_drvinfo(struct net_device *netdev,
|
||||||
|
struct ethtool_drvinfo *drvinfo)
|
||||||
|
{
|
||||||
|
strlcpy(drvinfo->driver, opa_vnic_driver_name, sizeof(drvinfo->driver));
|
||||||
|
strlcpy(drvinfo->version, opa_vnic_driver_version,
|
||||||
|
sizeof(drvinfo->version));
|
||||||
|
strlcpy(drvinfo->bus_info, dev_name(netdev->dev.parent),
|
||||||
|
sizeof(drvinfo->bus_info));
|
||||||
|
}
|
||||||
|
|
||||||
/* vnic_get_sset_count - get string set count */
|
/* vnic_get_sset_count - get string set count */
|
||||||
static int vnic_get_sset_count(struct net_device *netdev, int sset)
|
static int vnic_get_sset_count(struct net_device *netdev, int sset)
|
||||||
{
|
{
|
||||||
@ -162,6 +173,7 @@ static void vnic_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
|||||||
|
|
||||||
/* ethtool ops */
|
/* ethtool ops */
|
||||||
static const struct ethtool_ops opa_vnic_ethtool_ops = {
|
static const struct ethtool_ops opa_vnic_ethtool_ops = {
|
||||||
|
.get_drvinfo = vnic_get_drvinfo,
|
||||||
.get_link = ethtool_op_get_link,
|
.get_link = ethtool_op_get_link,
|
||||||
.get_strings = vnic_get_strings,
|
.get_strings = vnic_get_strings,
|
||||||
.get_sset_count = vnic_get_sset_count,
|
.get_sset_count = vnic_get_sset_count,
|
||||||
|
@ -164,10 +164,12 @@ struct __opa_veswport_trap {
|
|||||||
* struct opa_vnic_ctrl_port - OPA virtual NIC control port
|
* struct opa_vnic_ctrl_port - OPA virtual NIC control port
|
||||||
* @ibdev: pointer to ib device
|
* @ibdev: pointer to ib device
|
||||||
* @ops: opa vnic control operations
|
* @ops: opa vnic control operations
|
||||||
|
* @num_ports: number of opa ports
|
||||||
*/
|
*/
|
||||||
struct opa_vnic_ctrl_port {
|
struct opa_vnic_ctrl_port {
|
||||||
struct ib_device *ibdev;
|
struct ib_device *ibdev;
|
||||||
struct opa_vnic_ctrl_ops *ops;
|
struct opa_vnic_ctrl_ops *ops;
|
||||||
|
u8 num_ports;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -187,6 +189,8 @@ struct opa_vnic_ctrl_port {
|
|||||||
* @mactbl_lock: mac table lock
|
* @mactbl_lock: mac table lock
|
||||||
* @stats_lock: statistics lock
|
* @stats_lock: statistics lock
|
||||||
* @flow_tbl: flow to default port redirection table
|
* @flow_tbl: flow to default port redirection table
|
||||||
|
* @trap_timeout: trap timeout
|
||||||
|
* @trap_count: no. of traps allowed within timeout period
|
||||||
*/
|
*/
|
||||||
struct opa_vnic_adapter {
|
struct opa_vnic_adapter {
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
@ -213,6 +217,9 @@ struct opa_vnic_adapter {
|
|||||||
struct mutex stats_lock;
|
struct mutex stats_lock;
|
||||||
|
|
||||||
u8 flow_tbl[OPA_VNIC_FLOW_TBL_SIZE];
|
u8 flow_tbl[OPA_VNIC_FLOW_TBL_SIZE];
|
||||||
|
|
||||||
|
unsigned long trap_timeout;
|
||||||
|
u8 trap_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Same as opa_veswport_mactable_entry, but without bitwise attribute */
|
/* Same as opa_veswport_mactable_entry, but without bitwise attribute */
|
||||||
@ -247,6 +254,8 @@ struct opa_vnic_mac_tbl_node {
|
|||||||
dev_err(&cport->ibdev->dev, format, ## arg)
|
dev_err(&cport->ibdev->dev, format, ## arg)
|
||||||
#define c_info(format, arg...) \
|
#define c_info(format, arg...) \
|
||||||
dev_info(&cport->ibdev->dev, format, ## arg)
|
dev_info(&cport->ibdev->dev, format, ## arg)
|
||||||
|
#define c_dbg(format, arg...) \
|
||||||
|
dev_dbg(&cport->ibdev->dev, format, ## arg)
|
||||||
|
|
||||||
/* The maximum allowed entries in the mac table */
|
/* The maximum allowed entries in the mac table */
|
||||||
#define OPA_VNIC_MAC_TBL_MAX_ENTRIES 2048
|
#define OPA_VNIC_MAC_TBL_MAX_ENTRIES 2048
|
||||||
@ -281,6 +290,9 @@ struct opa_vnic_mac_tbl_node {
|
|||||||
!obj && (bkt) < OPA_VNIC_MAC_TBL_SIZE; (bkt)++) \
|
!obj && (bkt) < OPA_VNIC_MAC_TBL_SIZE; (bkt)++) \
|
||||||
hlist_for_each_entry(obj, &name[bkt], member)
|
hlist_for_each_entry(obj, &name[bkt], member)
|
||||||
|
|
||||||
|
extern char opa_vnic_driver_name[];
|
||||||
|
extern const char opa_vnic_driver_version[];
|
||||||
|
|
||||||
struct opa_vnic_adapter *opa_vnic_add_netdev(struct ib_device *ibdev,
|
struct opa_vnic_adapter *opa_vnic_add_netdev(struct ib_device *ibdev,
|
||||||
u8 port_num, u8 vport_num);
|
u8 port_num, u8 vport_num);
|
||||||
void opa_vnic_rem_netdev(struct opa_vnic_adapter *adapter);
|
void opa_vnic_rem_netdev(struct opa_vnic_adapter *adapter);
|
||||||
@ -310,9 +322,8 @@ void opa_vnic_get_per_veswport_info(struct opa_vnic_adapter *adapter,
|
|||||||
void opa_vnic_set_per_veswport_info(struct opa_vnic_adapter *adapter,
|
void opa_vnic_set_per_veswport_info(struct opa_vnic_adapter *adapter,
|
||||||
struct opa_per_veswport_info *info);
|
struct opa_per_veswport_info *info);
|
||||||
void opa_vnic_vema_report_event(struct opa_vnic_adapter *adapter, u8 event);
|
void opa_vnic_vema_report_event(struct opa_vnic_adapter *adapter, u8 event);
|
||||||
struct opa_vnic_adapter *opa_vnic_add_vport(struct opa_vnic_ctrl_port *cport,
|
|
||||||
u8 port_num, u8 vport_num);
|
|
||||||
void opa_vnic_rem_vport(struct opa_vnic_adapter *adapter);
|
|
||||||
void opa_vnic_set_ethtool_ops(struct net_device *netdev);
|
void opa_vnic_set_ethtool_ops(struct net_device *netdev);
|
||||||
|
void opa_vnic_vema_send_trap(struct opa_vnic_adapter *adapter,
|
||||||
|
struct __opa_veswport_trap *data, u32 lid);
|
||||||
|
|
||||||
#endif /* _OPA_VNIC_INTERNAL_H */
|
#endif /* _OPA_VNIC_INTERNAL_H */
|
||||||
|
1078
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
Normal file
1078
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -70,7 +70,7 @@ void opa_vnic_vema_report_event(struct opa_vnic_adapter *adapter, u8 event)
|
|||||||
trap_data.veswportindex = adapter->vport_num;
|
trap_data.veswportindex = adapter->vport_num;
|
||||||
trap_data.opcode = event;
|
trap_data.opcode = event;
|
||||||
|
|
||||||
/* Need to send trap here */
|
opa_vnic_vema_send_trap(adapter, &trap_data, info->vport.encap_slid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user