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 02/13] virtio: Add config_op for admin commands
Date: Mon, 3 Aug 2026 12:07:39 -0400	[thread overview]
Message-ID: <20260803120238-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260803140721.1871678-3-shshitrit@nvidia.com>

On Mon, Aug 03, 2026 at 05:07:10PM +0300, Shahar Shitrit wrote:
> From: Daniel Jurgens <danielj@nvidia.com>
> 
> This will allow device drivers to issue administration commands.
> 
> 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_modern.c | 2 ++
>  include/linux/virtio_config.h      | 6 ++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
> index ef4a64eb9982..a18683761aa5 100644
> --- a/drivers/virtio/virtio_pci_modern.c
> +++ b/drivers/virtio/virtio_pci_modern.c
> @@ -1238,6 +1238,7 @@ static const struct virtio_config_ops virtio_pci_config_nodev_ops = {
>  	.get_shm_region  = vp_get_shm_region,
>  	.disable_vq_and_reset = vp_modern_disable_vq_and_reset,
>  	.enable_vq_after_reset = vp_modern_enable_vq_after_reset,
> +	.admin_cmd_exec = vp_modern_admin_cmd_exec,
>  };
>  
>  static const struct virtio_config_ops virtio_pci_config_ops = {
> @@ -1258,6 +1259,7 @@ static const struct virtio_config_ops virtio_pci_config_ops = {
>  	.get_shm_region  = vp_get_shm_region,
>  	.disable_vq_and_reset = vp_modern_disable_vq_and_reset,
>  	.enable_vq_after_reset = vp_modern_enable_vq_after_reset,
> +	.admin_cmd_exec = vp_modern_admin_cmd_exec,
>  };
>  
>  /* the PCI probing function */


So the issue here is that vp_modern_admin_cmd_exec has been
broken for a while:


        spin_lock_irqsave(&admin_vq->lock, flags);
        ret = virtqueue_add_sgs(vq, sgs, out_num, in_num, cmd, GFP_KERNEL);



which is pre-existing but now that this is going to be triggered by userspace,
we need to fix this.

I guess admin vq lock must be a mutex and complete through a wq?

> diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
> index 69f84ea85d71..e36a32e0a20c 100644
> --- a/include/linux/virtio_config.h
> +++ b/include/linux/virtio_config.h
> @@ -108,6 +108,10 @@ struct virtqueue_info {
>   *	Returns 0 on success or error status
>   *	If disable_vq_and_reset is set, then enable_vq_after_reset must also be
>   *	set.
> + * @admin_cmd_exec: Execute an admin VQ command (optional).
> + *	vdev: the virtio_device
> + *	cmd: the command to execute
> + *	Returns 0 on success or error status
>   */
>  struct virtio_config_ops {
>  	void (*get)(struct virtio_device *vdev, unsigned offset,
> @@ -137,6 +141,8 @@ struct virtio_config_ops {
>  			       struct virtio_shm_region *region, u8 id);
>  	int (*disable_vq_and_reset)(struct virtqueue *vq);
>  	int (*enable_vq_after_reset)(struct virtqueue *vq);
> +	int (*admin_cmd_exec)(struct virtio_device *vdev,
> +			      struct virtio_admin_cmd *cmd);
>  };
>  
>  /**
> -- 
> 2.49.0


  reply	other threads:[~2026-08-03 16:07 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
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 [this message]
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=20260803120238-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