r8169: improve rtl_tx
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 11 Nov 2020 21:56:29 +0000 (22:56 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Nov 2020 00:29:07 +0000 (16:29 -0800)
commitca1ab89cd2d654661f559bd83ad9fc7323cb6c86
tree44ec58b5f5767af3a429cf61950d2e44378303c6
parent95f3c5458dfa5856bb110e31d156e00d894d0134
r8169: improve rtl_tx

We can simplify the for() condition and eliminate variable tx_left.
The change also considers that tp->cur_tx may be incremented by a
racing rtl8169_start_xmit().
In addition replace the write to tp->dirty_tx and the following
smp_mb() with an equivalent call to smp_store_mb(). This implicitly
adds a WRITE_ONCE() to the write.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/c2e19e5e-3d3f-d663-af32-13c3374f5def@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/realtek/r8169_main.c