bnxt_en: Allow some TX packets to be unprocessed in NAPI
authorMichael Chan <michael.chan@broadcom.com>
Fri, 28 Jun 2024 19:29:58 +0000 (12:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Jul 2024 10:23:20 +0000 (11:23 +0100)
commitba0155f1e9fca8e5c59c840cf5451101b8360fe6
tree51200d9a5be2e80a938448590771cc2cb87325b3
parent449da97512f3bac1520a4d649038f7357f394e5b
bnxt_en: Allow some TX packets to be unprocessed in NAPI

The driver's current logic will always free all the TX SKBs up to
txr->tx_hw_cons within NAPI.  In the next patches, we'll be adding
logic to handle TX timestamp completion and we may need to hold
some remaining TX SKBs if we don't have the timestamp completions
yet.

Modify __bnxt_poll_work_done() to clear each event bit separately to
allow bnapi->tx_int() to decide whether to clear BNXT_TX_CMP_EVENT or
not.  bnapi->tx_int() will not clear BNXT_TX_CMP_EVENT if some TX
SKBs are held waiting for TX timestamps.  Note that legacy chips will
never hold any SKBs this way.  The SKB is always deferred to the PTP
worker slow path to retrieve the timestamp from firmware.  On the new
P7 chips, the timestamp is returned by the hardware directly and we
can retrieve it directly from NAPI.

Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c