From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: nic_swsd@realtek.com, alexander.h.duyck@redhat.com,
David Miller <davem@davemloft.net>,
dhowells@redhat.com, paulmck@linux.vnet.ibm.com,
will.deacon@arm.com, peterz@infradead.org,
netdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: net: r8169: a question of memory barrier in the r8169 driver
Date: Fri, 19 Jan 2018 09:24:55 +0800 [thread overview]
Message-ID: <31c256b2-b527-89b1-168b-b2a529811d74@gmail.com> (raw)
In-Reply-To: <20180119011101.GA15920@electric-eye.fr.zoreil.com>
On 2018/1/19 9:11, Francois Romieu wrote:
> Jia-Ju Bai <baijiaju1990@gmail.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.
>
Thanks for reply.
I didn't clearly understand your meaning...
I wonder whether there is a possible data race and whether a "smp_mb" is
needed before this code?
By the way, do you mean that this code can be removed?
Thanks,
Jia-Ju Bai
next prev parent reply other threads:[~2018-01-19 1:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-18 14:06 Jia-Ju Bai
2018-01-18 15:06 ` Peter Zijlstra
2018-01-19 1:11 ` Francois Romieu
2018-01-19 17:14 ` Peter Zijlstra
2018-01-20 0:00 ` Francois Romieu
2018-01-19 1:11 ` Francois Romieu
2018-01-19 1:24 ` Jia-Ju Bai [this message]
2018-01-19 23:59 ` Francois Romieu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31c256b2-b527-89b1-168b-b2a529811d74@gmail.com \
--to=baijiaju1990@gmail.com \
--cc=alexander.h.duyck@redhat.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=romieu@fr.zoreil.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®