All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: P J P <ppandit@redhat.com>, Stefan Hajnoczi <stefanha@gmail.com>
Cc: Li Qiang <pangpei.lq@antfin.com>,
	Sven Schnelle <svens@stackframe.org>,
	Qemu Developers <qemu-devel@nongnu.org>,
	Ziming Zhang <ezrakiez@gmail.com>
Subject: Re: [PATCH v3 2/2] net: tulip: add .can_recieve routine
Date: Tue, 17 Mar 2020 13:50:06 +0800	[thread overview]
Message-ID: <27df2e70-936f-f989-7b6b-a00772dea0cd@redhat.com> (raw)
In-Reply-To: <nycvar.YSQ.7.76.2003162325500.5086@xnncv>


On 2020/3/17 上午2:01, P J P wrote:
>    Hello Stefan, Jason,
>
> +-- On Fri, 6 Mar 2020, Stefan Hajnoczi wrote --+
> | > +static int
> | > +tulip_can_receive(NetClientState *nc)
> | > +{
> | > +    TULIPState *s = qemu_get_nic_opaque(nc);
> | > +
> | > +    if (s->rx_frame_len || tulip_rx_stopped(s)) {
> | > +        return false;
> | > +    }
> | > +
> | > +    return true;
> | > +}
> |
> | Are the required qemu_flush_queued_packets() calls in place so that
> | packet transfer wakes up again when .can_receive() transitions from
> | false to true?
>
>    Yes, qemu_flush_queued_packets() calls are in tulip_write(). Do we need to
> call tulip_can_receive() before each call?


Probably not, just need to make sure the check in tulip_rx_stopped(s) 
matches the action that triggers qemu_flush_queued_packets() in 
tulip_write() is sufficient.

This to make sure net core can restore the receiving.

Btw, what's the point of checking rx_frame_len here?

Thanks


>
> Thank you.
> --
> Prasad J Pandit / Red Hat Product Security Team
> 8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D



  reply	other threads:[~2020-03-17  5:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 10:47 [PATCH v3 0/2] net: tulip: add checks to avoid OOB access P J P
2020-03-03 10:47 ` [PATCH v3 1/2] net: tulip: check frame size and r/w data length P J P
2020-03-03 10:47 ` [PATCH v3 2/2] net: tulip: add .can_recieve routine P J P
2020-03-06 13:08   ` Stefan Hajnoczi
2020-03-16 18:01     ` P J P
2020-03-17  5:50       ` Jason Wang [this message]
2020-03-17 10:49         ` P J P
2020-03-18  2:07           ` Jason Wang
2020-03-19  9:58             ` P J P
2020-03-03 10:54 ` [PATCH v3 0/2] net: tulip: add checks to avoid OOB access no-reply
2020-03-05 12:16   ` P J P
2020-03-03 10:54 ` no-reply
2020-03-03 10:54 ` no-reply
2020-03-03 10:56 ` no-reply

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=27df2e70-936f-f989-7b6b-a00772dea0cd@redhat.com \
    --to=jasowang@redhat.com \
    --cc=ezrakiez@gmail.com \
    --cc=pangpei.lq@antfin.com \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=svens@stackframe.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.