Netdev List
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Shahar Shitrit <shshitrit@nvidia.com>
Cc: netdev@vger.kernel.org, jasowang@redhat.com, pabeni@redhat.com,
	virtualization@lists.linux.dev, parav@nvidia.com,
	yohadt@nvidia.com, xuanzhuo@linux.alibaba.com,
	eperezma@redhat.com, jgg@ziepe.ca, kevin.tian@intel.com,
	kuba@kernel.org, andrew+netdev@lunn.ch, edumazet@google.com,
	danielj@nvidia.com
Subject: Re: [PATCH net-next v21 01/13] virtio_pci: Remove supported_cap size build assert
Date: Mon, 3 Aug 2026 11:59:12 -0400	[thread overview]
Message-ID: <20260803115219-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260803140721.1871678-2-shshitrit@nvidia.com>

patch is ok. commit log isnt:


supported_cap is not a thing.

better subj:

 remove supported_caps cache and build assert


On Mon, Aug 03, 2026 at 05:07:09PM +0300, Shahar Shitrit wrote:
> From: Daniel Jurgens <danielj@nvidia.com>
> 
> The cap ID list can be more than 64 bits.

what does "can be" mean? I think what u mean
following patches make ....

> Remove the build assert.


> Also
> remove caching of the supported caps, it wasn't used.

it's not "also". in fact we remove supported_caps and then
the rest of the code handles data->supported_caps of any
size, transparently.


> Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
> Reviewed-by: Parav Pandit <parav@nvidia.com>
> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
> ---
>  drivers/virtio/virtio_pci_common.h |  1 -
>  drivers/virtio/virtio_pci_modern.c | 10 +++-------
>  2 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h
> index 8cd01de27baf..fc26e035e7a6 100644
> --- a/drivers/virtio/virtio_pci_common.h
> +++ b/drivers/virtio/virtio_pci_common.h
> @@ -48,7 +48,6 @@ struct virtio_pci_admin_vq {
>  	/* Protects virtqueue access. */
>  	spinlock_t lock;
>  	u64 supported_cmds;
> -	u64 supported_caps;
>  	u8 max_dev_parts_objects;
>  	struct ida dev_parts_ida;
>  	/* Name of the admin queue: avq.$vq_index. */
> diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
> index 6d8ae2a6a8ca..ef4a64eb9982 100644
> --- a/drivers/virtio/virtio_pci_modern.c
> +++ b/drivers/virtio/virtio_pci_modern.c
> @@ -304,10 +304,10 @@ virtio_pci_admin_cmd_dev_parts_objects_enable(struct virtio_device *virtio_dev)
>  
>  static void virtio_pci_admin_cmd_cap_init(struct virtio_device *virtio_dev)
>  {
> -	struct virtio_pci_device *vp_dev = to_vp_device(virtio_dev);
>  	struct virtio_admin_cmd_query_cap_id_result *data;
>  	struct virtio_admin_cmd cmd = {};
>  	struct scatterlist result_sg;
> +	u64 caps;
>  	int ret;
>  
>  	data = kzalloc_obj(*data);
> @@ -323,12 +323,8 @@ static void virtio_pci_admin_cmd_cap_init(struct virtio_device *virtio_dev)
>  	if (ret)
>  		goto end;
>  
> -	/* Max number of caps fits into a single u64 */
> -	BUILD_BUG_ON(sizeof(data->supported_caps) > sizeof(u64));
> -
> -	vp_dev->admin_vq.supported_caps = le64_to_cpu(data->supported_caps[0]);
> -
> -	if (!(vp_dev->admin_vq.supported_caps & (1 << VIRTIO_DEV_PARTS_CAP)))
> +	caps = le64_to_cpu(data->supported_caps[0]);
> +	if (!(caps & BIT_ULL(VIRTIO_DEV_PARTS_CAP)))
>  		goto end;
>  
>  	virtio_pci_admin_cmd_dev_parts_objects_enable(virtio_dev);
> -- 
> 2.49.0


  reply	other threads:[~2026-08-03 15:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 14:07 [PATCH net-next v21 00/13] virtio_net: Add ethtool flow rules support Shahar Shitrit
2026-08-03 14:07 ` [PATCH net-next v21 01/13] virtio_pci: Remove supported_cap size build assert Shahar Shitrit
2026-08-03 15:59   ` Michael S. Tsirkin [this message]
2026-08-03 14:07 ` [PATCH net-next v21 02/13] virtio: Add config_op for admin commands Shahar Shitrit
2026-08-03 16:07   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 03/13] virtio: Expose generic device capability operations Shahar Shitrit
2026-08-03 16:19   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 04/13] virtio: Expose object create and destroy API Shahar Shitrit
2026-08-03 16:21   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 05/13] virtio_net: Query and set flow filter caps Shahar Shitrit
2026-08-03 15:51   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 06/13] virtio_net: Create a FF group for ethtool steering Shahar Shitrit
2026-08-03 16:27   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 07/13] ethtool: Introduce ethtool_flow_type_mask() Shahar Shitrit
2026-08-03 14:07 ` [PATCH net-next v21 08/13] virtio_net: Implement layer 2 ethtool flow rules Shahar Shitrit
2026-08-03 16:30   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 09/13] virtio_net: Use existing classifier if possible Shahar Shitrit
2026-08-03 16:31   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 10/13] virtio_net: Implement IPv4 ethtool flow rules Shahar Shitrit
2026-08-03 14:07 ` [PATCH net-next v21 11/13] virtio_net: Add support for IPv6 ethtool steering Shahar Shitrit
2026-08-03 14:07 ` [PATCH net-next v21 12/13] virtio_net: Add support for TCP and UDP ethtool rules Shahar Shitrit
2026-08-03 16:33   ` Michael S. Tsirkin
2026-08-03 14:07 ` [PATCH net-next v21 13/13] virtio_net: Add get ethtool flow rules ops Shahar Shitrit
2026-08-03 16:37   ` Michael S. Tsirkin

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=20260803115219-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=danielj@nvidia.com \
    --cc=edumazet@google.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parav@nvidia.com \
    --cc=shshitrit@nvidia.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=yohadt@nvidia.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