OSDN Git Service

bnxt: use new queue try_stop/try_wake macros
authorJakub Kicinski <kuba@kernel.org>
Fri, 7 Apr 2023 01:25:35 +0000 (18:25 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 11 Apr 2023 00:56:18 +0000 (17:56 -0700)
commit08a096780d9239e69909c48f4b1fcd99c860b2ef
tree26ace3f1c368bdfa92f1bc5a590337e8750788e4
parent9ded5bc77fe5f396a58da95627695a89a427c962
bnxt: use new queue try_stop/try_wake macros

Convert bnxt to use new macros rather than open code the logic.
Two differences:
(1) bnxt_tx_int() will now only issue a memory barrier if it sees
    enough space on the ring to wake the queue. This should be fine,
    the mb() is between the writes to the ring pointers and checking
    queue state.
(2) we'll start the queue instead of waking on race, this should
    be safe inside the xmit handler.

Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c