Commit fa3e93e8 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnxt_en: Refactor tx completion path.

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: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5f449249
...@@ -1765,7 +1765,7 @@ static int bnxt_poll_work(struct bnxt *bp, struct bnxt_napi *bnapi, int budget) ...@@ -1765,7 +1765,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); BNXT_CP_DB(cpr->cp_doorbell, cpr->cp_raw_cons);
if (tx_pkts) if (tx_pkts)
bnxt_tx_int(bp, bnapi, tx_pkts); bnapi->tx_int(bp, bnapi, tx_pkts);
if (event & BNXT_RX_EVENT) { if (event & BNXT_RX_EVENT) {
struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; struct bnxt_rx_ring_info *rxr = bnapi->rx_ring;
...@@ -3048,6 +3048,9 @@ static int bnxt_alloc_mem(struct bnxt *bp, bool irq_re_init) ...@@ -3048,6 +3048,9 @@ static int bnxt_alloc_mem(struct bnxt *bp, bool irq_re_init)
if (i >= bp->tx_nr_rings_xdp) if (i >= bp->tx_nr_rings_xdp)
bp->tx_ring[i].txq_index = i - bp->tx_ring[i].txq_index = i -
bp->tx_nr_rings_xdp; 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); rc = bnxt_alloc_stats(bp);
......
...@@ -664,6 +664,11 @@ struct bnxt_napi { ...@@ -664,6 +664,11 @@ struct bnxt_napi {
struct bnxt_rx_ring_info *rx_ring; struct bnxt_rx_ring_info *rx_ring;
struct bnxt_tx_ring_info *tx_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; bool in_reset;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment