Skip to contentSkip to conversation

cxgb4: add loopback ethtool self-test

PATCH Applied Vishal Kulkarni 3 participants 3 messages Jul 23, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 cxgb4: add loopback ethtool self-test

In this test, loopback pkt is created and sent on default queue. The packet goes until the Multi Port Switch (MPS) just before the MAC and based on the specified channel number, it either goes outside the wire on one of the physical ports or looped back to Rx path by MPS. In this case, we're specifying loopback channel, instead of physical ports, so the packet gets looped back to Rx path, instead of getting transmitted on the wire.

v3:
- Modify commit message to include test details.
v2:
- Add only loopback self-test.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    |   8 ++
 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    |  52 +++++++++
 drivers/net/ethernet/chelsio/cxgb4/sge.c      | 107 +++++++++++++++++-
 3 files changed, 166 insertions(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +8 -0
index c59e9ccc2f18..adbc0d088070 100644
@@ -532,6 +532,12 @@ static inline struct mbox_cmd *mbox_cmd_log_entry(struct mbox_cmd_log *log,
 		FW_HDR_FW_VER_BUILD_G(chip##FW_VERSION_BUILD))
 #define FW_INTFVER(chip, intf) (FW_HDR_INTFVER_##intf)
 
+struct cxgb4_ethtool_lb_test {
+	struct completion completion;
+	int result;
+	int loopback;
+};
+
 struct fw_info {
 	u8 chip;
 	char *fs_name;
@@ -685,6 +691,7 @@ struct port_info {
 	u16 nmirrorqsets;
 	u32 vi_mirror_count;
 	struct mutex vi_mirror_mutex; /* Sync access to Mirror VI info */
+	struct cxgb4_ethtool_lb_test ethtool_lb;
 };
 
 struct dentry;
@@ -1595,6 +1602,7 @@ void t4_free_sge_resources(struct adapter *adap);
 void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q);
 irq_handler_t t4_intr_handler(struct adapter *adap);
 netdev_tx_t t4_start_xmit(struct sk_buff *skb, struct net_device *dev);
+int cxgb4_selftest_lb_pkt(struct net_device *netdev);
 int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
 		     const struct pkt_gl *gl);
 int t4_mgmt_tx(struct adapter *adap, struct sk_buff *skb);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +52 -0

82 lines not on this page · raw message

drivers/net/ethernet/chelsio/cxgb4/sge.c +106 -1

137 lines not on this page · raw message

Signature · 1 line
2.21.1
maintainer Acked-by on v3 1/1
#1 lore raw
Quoted 8 lines · On Thu, 23 Jul 2020 18:19:50 +0530 Vishal Kulkarni wrote:

In this test, loopback pkt is created and sent on default queue. The packet goes until the Multi Port Switch (MPS) just before the MAC and based on the specified channel number, it either goes outside the wire on one of the physical ports or looped back to Rx path by MPS. In this case, we're specifying loopback channel, instead of physical ports, so the packet gets looped back to Rx path, instead of getting transmitted on the wire.

Quoted 6 lines

v3:
- Modify commit message to include test details.
v2:
- Add only loopback self-test.

maintainer Applied
#2 lore raw
In reply to Vishal Kulkarni

From: Vishal Kulkarni <[email protected]>
Date: Thu, 23 Jul 2020 18:19:50 +0530

Quoted 8 lines

In this test, loopback pkt is created and sent on default queue. The packet goes until the Multi Port Switch (MPS) just before the MAC and based on the specified channel number, it either goes outside the wire on one of the physical ports or looped back to Rx path by MPS. In this case, we're specifying loopback channel, instead of physical ports, so the packet gets looped back to Rx path, instead of getting transmitted on the wire.

Quoted 6 lines

v3:
- Modify commit message to include test details.
v2:
- Add only loopback self-test.

Applied.