]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Refactor tx completion path.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 6 Feb 2017 21:55:41 +0000 (16:55 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 21:35:35 +0000 (13:35 -0800)
Orabug: 25645429

XDP_TX requires a different function to handle completion.  Add a
function pointer to handle tx completion logic.  Regular TX rings
will be assigned the current bnxt_tx_int() for the ->tx_int()
function pointer.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fa3e93e86cc3d1809fba67cb138883ed4bb74a5f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index 3db2d45c51c2c9de28e83a6c7135a99c7e0d7067..47ef4f1d8eab661a8e7c25e5d645dbe1785149e1 100644 (file)
@@ -1769,7 +1769,7 @@ static int bnxt_poll_work(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
        BNXT_CP_DB(cpr->cp_doorbell, cpr->cp_raw_cons);
 
        if (tx_pkts)
-               bnxt_tx_int(bp, bnapi, tx_pkts);
+               bnapi->tx_int(bp, bnapi, tx_pkts);
 
        if (event & BNXT_RX_EVENT) {
                struct bnxt_rx_ring_info *rxr = bnapi->rx_ring;
@@ -3049,6 +3049,9 @@ static int bnxt_alloc_mem(struct bnxt *bp, bool irq_re_init)
                        if (i >= bp->tx_nr_rings_xdp)
                                bp->tx_ring[i].txq_index = i -
                                        bp->tx_nr_rings_xdp;
+                       else
+                               bp->bnapi[j]->flags |= BNXT_NAPI_FLAG_XDP;
+                       bp->bnapi[j]->tx_int = bnxt_tx_int;
                }
 
                rc = bnxt_alloc_stats(bp);
index 4c3289a7fea8a6a549c87aa59ec9e1a2c5e0ad7e..6dc43f5a750904d7ce8a8c29a67d5c0a51359d64 100644 (file)
@@ -664,6 +664,11 @@ struct bnxt_napi {
        struct bnxt_rx_ring_info        *rx_ring;
        struct bnxt_tx_ring_info        *tx_ring;
 
+       void                    (*tx_int)(struct bnxt *, struct bnxt_napi *,
+                                         int);
+       u32                     flags;
+#define BNXT_NAPI_FLAG_XDP     0x1
+
        bool                    in_reset;
 };