[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180119011101.GA15920@electric-eye.fr.zoreil.com>
Date: Fri, 19 Jan 2018 02:11:01 +0100
From: Francois Romieu <romieu@...zoreil.com>
To: Jia-Ju Bai <baijiaju1990@...il.com>
Cc: nic_swsd@...ltek.com, alexander.h.duyck@...hat.com,
David Miller <davem@...emloft.net>, dhowells@...hat.com,
paulmck@...ux.vnet.ibm.com, will.deacon@....com,
peterz@...radead.org, netdev@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: net: r8169: a question of memory barrier in the r8169 driver
Jia-Ju Bai <baijiaju1990@...il.com> :
[...]
> The function rtl8169_start_xmit reads tp->dirty_tx in TX_FRAGS_READY_FOR:
> if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
> netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
> goto err_stop_0;
> }
> But there is no memory barrier around this code.
>
> Is there a possible data race here?
This code would not even be needed if rtl8169_start_xmit was only your
usual ndo_start_xmit handler: Realtek {ab / re}used it for GSO handling
(see r8169_csum_workaround).
If the test is not a no-op in this GSO context, it's racy.
--
Ueimor
Powered by blists - more mailing lists