From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>,
Gia-Khanh Nguyen <gia-khanh.nguyen@oracle.com>
Subject: Re: [PATCH net-next v3 3/3] virtio-net: synchronize operstate with admin state on up/down
Date: Wed, 17 Jul 2024 14:53:00 +0800 [thread overview]
Message-ID: <CACGkMEtntsAyddgrtxrbQe407dZkitac4ogC7cASF=iYgsum_A@mail.gmail.com> (raw)
In-Reply-To: <20240717015904-mutt-send-email-mst@kernel.org>
On Wed, Jul 17, 2024 at 2:00 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Wed, Jul 17, 2024 at 09:19:02AM +0800, Jason Wang wrote:
> > On Wed, Jul 10, 2024 at 11:03 AM Jason Wang <jasowang@redhat.com> wrote:
> > >
> > > On Tue, Jul 9, 2024 at 9:28 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > >
> > > > On Tue, Jul 09, 2024 at 04:02:14PM +0800, Jason Wang wrote:
> > > > > This patch synchronize operstate with admin state per RFC2863.
> > > > >
> > > > > This is done by trying to toggle the carrier upon open/close and
> > > > > synchronize with the config change work. This allows propagate status
> > > > > correctly to stacked devices like:
> > > > >
> > > > > ip link add link enp0s3 macvlan0 type macvlan
> > > > > ip link set link enp0s3 down
> > > > > ip link show
> > > > >
> > > > > Before this patch:
> > > > >
> > > > > 3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
> > > > > link/ether 00:00:05:00:00:09 brd ff:ff:ff:ff:ff:ff
> > > > > ......
> > > > > 5: macvlan0@enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
> > > > > link/ether b2:a9:c5:04:da:53 brd ff:ff:ff:ff:ff:ff
> > > > >
> > > > > After this patch:
> > > > >
> > > > > 3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
> > > > > link/ether 00:00:05:00:00:09 brd ff:ff:ff:ff:ff:ff
> > > > > ...
> > > > > 5: macvlan0@enp0s3: <NO-CARRIER,BROADCAST,MULTICAST,UP,M-DOWN> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
> > > > > link/ether b2:a9:c5:04:da:53 brd ff:ff:ff:ff:ff:ff
> > > >
> > > > I think that the commit log is confusing. It seems to say that
> > > > the issue fixed is synchronizing state with hardware
> > > > config change.
> > > > But your example does not show any
> > > > hardware change. Isn't this example really just
> > > > a side effect of setting carrier off on close?
> > >
> > > The main goal for this patch is to make virtio-net follow RFC2863. The
> > > main thing that is missed is to synchronize the operstate with admin
> > > state, if we do this, we get several good results, one of the obvious
> > > one is to allow virtio-net to propagate status to the upper layer, for
> > > example if the admin state of the lower virtio-net is down it should
> > > be propagated to the macvlan on top, so I give the example of using a
> > > stacked device. I'm not we had others but the commit log is probably
> > > too small to say all of it.
> >
> > Michael, any more comments on this?
> >
> > Thans
>
>
> Still don't get it, sorry.
> > > > > This is done by trying to toggle the carrier upon open/close and
> > > > > synchronize with the config change work.
> What does this sentence mean? What is not synchronized with config
> change that needs to be?
I meant,
1) maclvan depends on the linkwatch to transfer operstate from the
lower device to itself.
2) ndo_open()/close() will not trigger the linkwatch so we need to do
it by ourselves in virtio-net to make sure macvlan get the correct
opersate
3) consider config change work can change the state so ndo_close()
needs to synchronize with it
Thanks
next prev parent reply other threads:[~2024-07-17 6:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 8:02 [PATCH net-next v3 0/3] virtio-net: synchronize op/admin state Jason Wang
2024-07-09 8:02 ` [PATCH net-next v3 1/3] virtio: rename virtio_config_enabled to virtio_config_core_enabled Jason Wang
2024-07-09 8:13 ` Xuan Zhuo
2024-07-09 8:02 ` [PATCH net-next v3 2/3] virtio: allow driver to disable the configure change notification Jason Wang
2024-07-09 8:13 ` Xuan Zhuo
2024-07-09 8:14 ` Xuan Zhuo
2024-07-09 8:02 ` [PATCH net-next v3 3/3] virtio-net: synchronize operstate with admin state on up/down Jason Wang
2024-07-09 8:14 ` Xuan Zhuo
2024-07-09 8:14 ` Xuan Zhuo
2024-07-09 13:27 ` Michael S. Tsirkin
2024-07-10 3:03 ` Jason Wang
2024-07-17 1:19 ` Jason Wang
2024-07-17 6:00 ` Michael S. Tsirkin
2024-07-17 6:53 ` Jason Wang [this message]
2024-07-19 1:02 ` Jason Wang
2024-07-19 1:19 ` Michael S. Tsirkin
2024-07-22 7:24 ` Jason Wang
2024-07-26 7:24 ` Michael S. Tsirkin
2024-07-29 1:59 ` Jason Wang
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='CACGkMEtntsAyddgrtxrbQe407dZkitac4ogC7cASF=iYgsum_A@mail.gmail.com' \
--to=jasowang@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=gia-khanh.nguyen@oracle.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=venkat.x.venkatsubra@oracle.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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).