From: Jakub Kicinski <kuba@kernel.org>
To: danielj@nvidia.com
Cc: Jakub Kicinski <kuba@kernel.org>,
mst@redhat.com, netdev@vger.kernel.org, pabeni@redhat.com,
jasowang@redhat.com
Subject: Re: [net-next,v16,05/12] virtio_net: Query and set flow filter caps
Date: Thu, 22 Jan 2026 17:43:38 -0800 [thread overview]
Message-ID: <20260123014338.3007350-1-kuba@kernel.org> (raw)
In-Reply-To: <20260121220652.894364-6-danielj@nvidia.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
virtio_net: Query and set flow filter caps
This patch adds flow filter capability support to virtio_net. It queries
and sets flow filter capabilities during probe and restore, with cleanup
during freeze and remove.
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index db88dcaefb20..03bd3d2c2b0e 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
[ ... ]
> @@ -5727,10 +5934,31 @@ static int virtnet_restore_up(struct virtio_device *vdev)
> return err;
> }
>
> + /* Initialize flow filters. Not supported is an acceptable and common
> + * return code
> + */
> + rtnl_lock();
> + err = virtnet_ff_init(&vi->ff, vi->vdev);
> + if (err && err != -EOPNOTSUPP) {
> + if (netif_running(vi->dev))
> + virtnet_close(vi->dev);
> +
> + /* disable_rx_mmode_work takes the rtnl_lock, so just set the
> + * flag here while holding the lock.
> + *
> + * remove_vq_common resets the device and frees the vqs.
> + */
> + vi->rx_mode_work_enabled = false;
> + rtnl_unlock();
> + remove_vq_common(vi);
> + return err;
If virtnet_ff_init() fails here, remove_vq_common() frees vi->rq, vi->sq,
and vi->ctrl via virtnet_free_queues(), but the netdevice remains
registered. Could this leave the device in an inconsistent state where
subsequent operations (like virtnet_open() triggered by bringing the
interface up) would access freed memory through vi->rq[i]?
The error return propagates up to virtnet_restore() which just returns
the error without further cleanup. If userspace then tries to use the
still-registered netdevice, virtnet_open() would call try_fill_recv()
which dereferences vi->rq.
> + }
> + rtnl_unlock();
> +
> netif_tx_lock_bh(vi->dev);
> netif_device_attach(vi->dev);
> netif_tx_unlock_bh(vi->dev);
> - return err;
> + return 0;
> }
--
pw-bot: cr
next prev parent reply other threads:[~2026-01-23 1:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 22:06 [PATCH net-next v16 00/12] virtio_net: Add ethtool flow rules support Daniel Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 01/12] virtio_pci: Remove supported_cap size build assert Daniel Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 02/12] virtio: Add config_op for admin commands Daniel Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 03/12] virtio: Expose generic device capability operations Daniel Jurgens
2026-01-22 17:32 ` Michael S. Tsirkin
2026-01-21 22:06 ` [PATCH net-next v16 04/12] virtio: Expose object create and destroy API Daniel Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 05/12] virtio_net: Query and set flow filter caps Daniel Jurgens
2026-01-23 1:43 ` Jakub Kicinski [this message]
2026-01-29 17:51 ` [net-next,v16,05/12] " Dan Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 06/12] virtio_net: Create a FF group for ethtool steering Daniel Jurgens
2026-01-22 21:51 ` Michael S. Tsirkin
2026-01-29 17:08 ` Dan Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 07/12] virtio_net: Implement layer 2 ethtool flow rules Daniel Jurgens
2026-01-23 1:45 ` [net-next,v16,07/12] " Jakub Kicinski
2026-01-21 22:06 ` [PATCH net-next v16 08/12] virtio_net: Use existing classifier if possible Daniel Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 09/12] virtio_net: Implement IPv4 ethtool flow rules Daniel Jurgens
2026-01-22 17:21 ` Michael S. Tsirkin
2026-01-29 18:46 ` Dan Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 10/12] virtio_net: Add support for IPv6 ethtool steering Daniel Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 11/12] virtio_net: Add support for TCP and UDP ethtool rules Daniel Jurgens
2026-01-21 22:06 ` [PATCH net-next v16 12/12] virtio_net: Add get ethtool flow rules ops Daniel Jurgens
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=20260123014338.3007350-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=danielj@nvidia.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@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 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.