qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Alexander Bulekov <alxndr@bu.edu>
Cc: dmitry.fleytman@gmail.com, mst@redhat.com, liq3ea@gmail.com,
	liq3ea@163.com, qemu-devel@nongnu.org,
	Michael Tokarev <mjt@tls.msk.ru>,
	stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [PATCH 1/2] net: forbid the reentrant RX
Date: Thu, 3 Sep 2020 11:56:27 +0800	[thread overview]
Message-ID: <9a6be1f3-84dd-d710-1a18-50e7972c30a2@redhat.com> (raw)
In-Reply-To: <20200902155614.aubuw5ygll35p3vp@mozz.bu.edu>


On 2020/9/2 下午11:56, Alexander Bulekov wrote:
> On 200728 1200, Jason Wang wrote:
>> On 2020/7/22 下午4:57, Jason Wang wrote:
>>> The memory API allows DMA into NIC's MMIO area. This means the NIC's
>>> RX routine must be reentrant. Instead of auditing all the NIC, we can
>>> simply detect the reentrancy and return early. The queue->delivering
>>> is set and cleared by qemu_net_queue_deliver() for other queue helpers
>>> to know whether the delivering in on going (NIC's receive is being
>>> called). We can check it and return early in qemu_net_queue_flush() to
>>> forbid reentrant RX.
>>>
>>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>>> ---
>>>    net/queue.c | 3 +++
>>>    1 file changed, 3 insertions(+)
>>>
>>> diff --git a/net/queue.c b/net/queue.c
>>> index 0164727e39..19e32c80fd 100644
>>> --- a/net/queue.c
>>> +++ b/net/queue.c
>>> @@ -250,6 +250,9 @@ void qemu_net_queue_purge(NetQueue *queue, NetClientState *from)
>>>    bool qemu_net_queue_flush(NetQueue *queue)
>>>    {
>>> +    if (queue->delivering)
>>> +        return false;
>>> +
>>>        while (!QTAILQ_EMPTY(&queue->packets)) {
>>>            NetPacket *packet;
>>>            int ret;
>>
>> Queued for rc2.
>>
>> Thanks
>>
> Hi Jason,
> I don't think this ever made it in. Are there any remaining problems?
> Thanks
> -Alex


Hi Alex:

It should have been merged:

https://git.qemu.org/?p=qemu.git;a=commit;h=22dc8663d9fc7baa22100544c600b6285a63c7a3

Thanks


>



  reply	other threads:[~2020-09-03  3:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22  8:57 [PATCH 1/2] net: forbid the reentrant RX Jason Wang
2020-07-22  8:57 ` [PATCH 2/2] e1000e: make TX reentrant Jason Wang
2020-07-22 11:24   ` Li Qiang
2020-07-23  2:22     ` Jason Wang
2020-07-22 12:53   ` Michael Tokarev
2020-07-23  2:25     ` Jason Wang
2020-07-23 12:01       ` Stefan Hajnoczi
2020-07-23 10:36   ` Peter Maydell
2020-07-24  4:00     ` Jason Wang
2020-07-28  4:00 ` [PATCH 1/2] net: forbid the reentrant RX Jason Wang
2020-09-02 15:56   ` Alexander Bulekov
2020-09-03  3:56     ` Jason Wang [this message]
2020-09-03  4:02       ` Alexander Bulekov

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=9a6be1f3-84dd-d710-1a18-50e7972c30a2@redhat.com \
    --to=jasowang@redhat.com \
    --cc=alxndr@bu.edu \
    --cc=dmitry.fleytman@gmail.com \
    --cc=liq3ea@163.com \
    --cc=liq3ea@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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;
as well as URLs for NNTP newsgroup(s).