summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h
diff options
context:
space:
mode:
authorVishwanathapura, Niranjana <niranjana.vishwanathapura@intel.com>2017-04-12 20:29:23 -0700
committerDoug Ledford <dledford@redhat.com>2017-04-20 12:01:38 -0400
commit72dc7614406e884aeae8c1554bf267943a0acaba (patch)
tree592bc3d716c5239008d549b259f9c7340148b3dc /drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h
parent7d6f728c677e9d01b42d3cc9eb9ef40a2de92ea3 (diff)
downloadblackbird-obmc-linux-72dc7614406e884aeae8c1554bf267943a0acaba.tar.gz
blackbird-obmc-linux-72dc7614406e884aeae8c1554bf267943a0acaba.zip
IB/opa-vnic: VNIC Ethernet Management (EM) structure definitions
Define VNIC EM MAD structures and the associated macros. These structures are used for information exchange between VNIC EM agent (EMA) on the host and the Ethernet manager. These include the virtual ethernet switch (vesw) port information, vesw port mac table, summay and error counters, vesw port interface mac lists and the EMA trap. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Signed-off-by: Sadanand Warrier <sadanand.warrier@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h')
-rw-r--r--drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h b/drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h
index 83ffa911ad1a..91c39bac0dc6 100644
--- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h
+++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_internal.h
@@ -72,6 +72,8 @@ struct opa_vnic_adapter;
/**
* struct __opa_vesw_info - OPA vnic virtual switch info
+ *
+ * Same as opa_vesw_info without bitwise attribute.
*/
struct __opa_vesw_info {
u16 fabric_id;
@@ -95,6 +97,8 @@ struct __opa_vesw_info {
/**
* struct __opa_per_veswport_info - OPA vnic per port info
+ *
+ * Same as opa_per_veswport_info without bitwise attribute.
*/
struct __opa_per_veswport_info {
u32 port_num;
@@ -133,6 +137,8 @@ struct __opa_per_veswport_info {
/**
* struct __opa_veswport_info - OPA vnic port info
+ *
+ * Same as opa_veswport_info without bitwise attribute.
*/
struct __opa_veswport_info {
struct __opa_vesw_info vesw;
@@ -140,6 +146,21 @@ struct __opa_veswport_info {
};
/**
+ * struct __opa_veswport_trap - OPA vnic trap info
+ *
+ * Same as opa_veswport_trap without bitwise attribute.
+ */
+struct __opa_veswport_trap {
+ u16 fabric_id;
+ u16 veswid;
+ u32 veswportnum;
+ u16 opaportnum;
+ u8 veswportindex;
+ u8 opcode;
+ u32 reserved;
+} __packed;
+
+/**
* struct opa_vnic_adapter - OPA VNIC netdev private data structure
* @netdev: pointer to associated netdev
* @ibdev: ib device
@@ -175,6 +196,18 @@ struct opa_vnic_adapter {
#define v_warn(format, arg...) \
netdev_warn(adapter->netdev, format, ## arg)
+/* The maximum allowed entries in the mac table */
+#define OPA_VNIC_MAC_TBL_MAX_ENTRIES 2048
+/* Limit of smac entries in mac table */
+#define OPA_VNIC_MAX_SMAC_LIMIT 256
+
+/* The last octet of the MAC address is used as the key to the hash table */
+#define OPA_VNIC_MAC_HASH_IDX 5
+
+/* The VNIC MAC hash table is of size 2^8 */
+#define OPA_VNIC_MAC_TBL_HASH_BITS 8
+#define OPA_VNIC_MAC_TBL_SIZE BIT(OPA_VNIC_MAC_TBL_HASH_BITS)
+
struct opa_vnic_adapter *opa_vnic_add_netdev(struct ib_device *ibdev,
u8 port_num, u8 vport_num);
void opa_vnic_rem_netdev(struct opa_vnic_adapter *adapter);
OpenPOWER on IntegriCloud