Skip to contentSkip to conversation

cxgb4: add loopback ethtool self-test

PATCH Superseded Vishal Kulkarni 3 participants 4 messages Jul 22, 2020 – Jul 23, 2020

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

In this test, loopback pkt is created and sent on default queue.

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
#1 lore raw
Quoted 4 lines · On Wed, 22 Jul 2020 19:28:44 +0530 Vishal Kulkarni wrote:

In this test, loopback pkt is created and sent on default queue.

v2:
- Add only loopback self-test.

Thanks for dropping the rest of the patches. Is it worth specifying what level of loopback this test is? PCI / MAC / PHY / other?

#2 lore raw
Quoted 8 lines · Jakub Kicinski
Quoted 4 lines · On Wed, 22 Jul 2020 19:28:44 +0530 Vishal Kulkarni wrote:

In this test, loopback pkt is created and sent on default queue.

v2:
- Add only loopback self-test.

Thanks for dropping the rest of the patches. Is it worth specifying what level of loopback this test is? PCI / MAC / PHY / other?

Hi Jakub,

I will add details to commit message and send v3.

-Vishal