]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Add ethtool mac loopback self test (reapply).
authorMichael Chan <michael.chan@broadcom.com>
Tue, 4 Apr 2017 22:14:13 +0000 (18:14 -0400)
committerBrian Maly <brian.maly@oracle.com>
Mon, 8 Oct 2018 16:20:37 +0000 (12:20 -0400)
The mac loopback self test operates in polling mode.  To support that,
we need to add functions to open and close the NIC half way.  The half
open mode allows the rings to operate without IRQ and NAPI.  We
use the XDP transmit function to send the loopback packet.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ Upstream commit f7dc1ea6c4c1f31371b7098d6fae0d49dc6cdff1 ]
Orabug: 27988326

Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h

index 08dad14ac10124c8951d9541ad7a810c215588ee..08fd62e8f1fcfce373258fc7620b667aed2ed558 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 #include "bnxt_hsi.h"
 #include "bnxt.h"
+#include "bnxt_xdp.h"
 #include "bnxt_ethtool.h"
 #include "bnxt_nvm_defs.h"     /* NVRAM content constant and structure defs */
 #include "bnxt_fw_hdr.h"       /* Firmware hdr constant and structure defs */
@@ -2601,6 +2602,7 @@ static int bnxt_run_loopback(struct bnxt *bp)
                dev_kfree_skb(skb);
                return -EIO;
        }
+       bnxt_xmit_xdp(bp, txr, map, pkt_size, 0);
 
        /* Sync BD data before updating doorbell */
        wmb();
index d1e0d5ab3ddcc54056e8a7c707ced60f4f325ccc..dba47894ed78016c35d73886feb78b9376012bde 100644 (file)
@@ -23,8 +23,8 @@
 #include "bnxt.h"
 #include "bnxt_xdp.h"
 
-static void bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
-                         dma_addr_t mapping, u32 len, u16 rx_prod)
+void bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
+                  dma_addr_t mapping, u32 len, u16 rx_prod)
 {
        struct bnxt_sw_tx_bd *tx_buf;
        struct tx_bd_ext *txbd1;
index f10bdbbc4ce6c2bb84ddf3586603ec70c20328ef..03416c5919d614d5a1bce57e94e76b2c547c01a5 100644 (file)
@@ -12,6 +12,8 @@
 
 struct netdev_xdp;
 
+void bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
+                  dma_addr_t mapping, u32 len, u16 rx_prod);
 void bnxt_tx_int_xdp(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts);
 #ifdef HAVE_NDO_XDP
 bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,