summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/thunder/nic.h
diff options
context:
space:
mode:
authorSunil Goutham <sgoutham@cavium.com>2015-08-30 12:29:16 +0300
committerDavid S. Miller <davem@davemloft.net>2015-08-30 21:54:12 -0700
commitd77a2384988fd397cf4f71417b9d971aa435758d (patch)
tree9fbca2f38512934f9b1a5a5fc23960bf19af777a /drivers/net/ethernet/cavium/thunder/nic.h
parent92dc87697e6a71675a9e9eec04ebecd8cf4837a3 (diff)
downloadlinux-d77a2384988fd397cf4f71417b9d971aa435758d.tar.gz
linux-d77a2384988fd397cf4f71417b9d971aa435758d.tar.bz2
linux-d77a2384988fd397cf4f71417b9d971aa435758d.zip
net: thunderx: Support for internal loopback mode
Support for setting VF's corresponding BGX LMAC in internal loopback mode. This mode can be used for verifying basic HW functionality such as packet I/O, RX checksum validation, CQ/RBDR interrupts, stats e.t.c. Useful when DUT has no external network connectivity. 'loopback' mode can be enabled or disabled via ethtool. Note: This feature is not supported when no of VFs enabled are morethan no of physical interfaces i.e active BGX LMACs Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: Aleksey Makarov <aleksey.makarov@caviumnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder/nic.h')
-rw-r--r--drivers/net/ethernet/cavium/thunder/nic.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h
index 35b2ee1bc07e..d3950b20feb9 100644
--- a/drivers/net/ethernet/cavium/thunder/nic.h
+++ b/drivers/net/ethernet/cavium/thunder/nic.h
@@ -265,6 +265,7 @@ struct nicvf {
u8 node;
u8 tns_mode:1;
u8 sqs_mode:1;
+ u8 loopback_supported:1;
u16 mtu;
struct queue_set *qs;
#define MAX_SQS_PER_VF_SINGLE_NODE 5
@@ -344,6 +345,7 @@ struct nicvf {
#define NIC_MBOX_MSG_NICVF_PTR 0x13 /* Send nicvf ptr to PF */
#define NIC_MBOX_MSG_PNICVF_PTR 0x14 /* Get primary qset nicvf ptr */
#define NIC_MBOX_MSG_SNICVF_PTR 0x15 /* Send sqet nicvf ptr to PVF */
+#define NIC_MBOX_MSG_LOOPBACK 0x16 /* Set interface in loopback */
#define NIC_MBOX_MSG_CFG_DONE 0xF0 /* VF configuration done */
#define NIC_MBOX_MSG_SHUTDOWN 0xF1 /* VF is being shutdown */
@@ -353,6 +355,7 @@ struct nic_cfg_msg {
u8 node_id;
u8 tns_mode:1;
u8 sqs_mode:1;
+ u8 loopback_supported:1;
u8 mac_addr[ETH_ALEN];
};
@@ -452,6 +455,13 @@ struct nicvf_ptr {
u64 nicvf;
};
+/* Set interface in loopback mode */
+struct set_loopback {
+ u8 msg;
+ u8 vf_id;
+ bool enable;
+};
+
/* 128 bit shared memory between PF and each VF */
union nic_mbx {
struct { u8 msg; } msg;
@@ -468,6 +478,7 @@ union nic_mbx {
struct bgx_link_status link_status;
struct sqs_alloc sqs_alloc;
struct nicvf_ptr nicvf;
+ struct set_loopback lbk;
};
#define NIC_NODE_ID_MASK 0x03