bnxt_en: Flush XDP for bnxt_poll_nitroa0()'s NAPI
[ Upstream commit edc0140cc3b7b91874ebe70eb7d2a851e8817ccc ]
bnxt_poll_nitroa0() invokes bnxt_rx_pkt() which can run a XDP program
which in turn can return XDP_REDIRECT. bnxt_rx_pkt() is also used by
__bnxt_poll_work() which flushes (xdp_do_flush()) the packets after each
round. bnxt_poll_nitroa0() lacks this feature.
xdp_do_flush() should be invoked before leaving the NAPI callback.
Invoke xdp_do_flush() after a redirect in bnxt_poll_nitroa0() NAPI.
Cc: Michael Chan <michael.chan@broadcom.com>
Fixes: f18c2b77b2
("bnxt_en: optimized XDP_REDIRECT support")
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
78106529b3
commit
466e88548e
@@ -2404,6 +2404,7 @@ static int bnxt_poll_nitroa0(struct napi_struct *napi, int budget)
|
|||||||
struct rx_cmp_ext *rxcmp1;
|
struct rx_cmp_ext *rxcmp1;
|
||||||
u32 cp_cons, tmp_raw_cons;
|
u32 cp_cons, tmp_raw_cons;
|
||||||
u32 raw_cons = cpr->cp_raw_cons;
|
u32 raw_cons = cpr->cp_raw_cons;
|
||||||
|
bool flush_xdp = false;
|
||||||
u32 rx_pkts = 0;
|
u32 rx_pkts = 0;
|
||||||
u8 event = 0;
|
u8 event = 0;
|
||||||
|
|
||||||
@@ -2438,6 +2439,8 @@ static int bnxt_poll_nitroa0(struct napi_struct *napi, int budget)
|
|||||||
rx_pkts++;
|
rx_pkts++;
|
||||||
else if (rc == -EBUSY) /* partial completion */
|
else if (rc == -EBUSY) /* partial completion */
|
||||||
break;
|
break;
|
||||||
|
if (event & BNXT_REDIRECT_EVENT)
|
||||||
|
flush_xdp = true;
|
||||||
} else if (unlikely(TX_CMP_TYPE(txcmp) ==
|
} else if (unlikely(TX_CMP_TYPE(txcmp) ==
|
||||||
CMPL_BASE_TYPE_HWRM_DONE)) {
|
CMPL_BASE_TYPE_HWRM_DONE)) {
|
||||||
bnxt_hwrm_handler(bp, txcmp);
|
bnxt_hwrm_handler(bp, txcmp);
|
||||||
@@ -2457,6 +2460,8 @@ static int bnxt_poll_nitroa0(struct napi_struct *napi, int budget)
|
|||||||
|
|
||||||
if (event & BNXT_AGG_EVENT)
|
if (event & BNXT_AGG_EVENT)
|
||||||
bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
|
bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
|
||||||
|
if (flush_xdp)
|
||||||
|
xdp_do_flush();
|
||||||
|
|
||||||
if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) {
|
if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) {
|
||||||
napi_complete_done(napi, rx_pkts);
|
napi_complete_done(napi, rx_pkts);
|
||||||
|
Reference in New Issue
Block a user