From nobody Mon Apr 13 11:41:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71514C25B0D for ; Tue, 16 Aug 2022 02:02:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233131AbiHPCCW (ORCPT ); Mon, 15 Aug 2022 22:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233088AbiHPCBV (ORCPT ); Mon, 15 Aug 2022 22:01:21 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF128220068 for ; Mon, 15 Aug 2022 14:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660600406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3QJuMC2X3Ls7xg8Zv+wmV/GtRe9wR+MYC+AaCjrIFhI=; b=QzuYzXBdF4XJt871UR41qevJr4jLydu5qOoiBSgVl0B2BXrCp8/Yc/VW91+dK9iAQm1etH LpBosegnj16dFmydjGsbe4u71oga148519cD8V4kX9bDEIUXGu5QepKT9heXbrxMlv1RQk wzH44h7qRqMDRGt5EH1VWWTsAJMONBY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-47-VIAVkVvDNSC22gt2ND_O4w-1; Mon, 15 Aug 2022 17:53:25 -0400 X-MC-Unique: VIAVkVvDNSC22gt2ND_O4w-1 Received: by mail-wm1-f71.google.com with SMTP id v24-20020a7bcb58000000b003a37681b861so1584023wmj.9 for ; Mon, 15 Aug 2022 14:53:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=3QJuMC2X3Ls7xg8Zv+wmV/GtRe9wR+MYC+AaCjrIFhI=; b=1ZCLHpGh5nn2F1pL+rrG6bKKKkiSVs+bxDK3SDnHu9UtGX2i3WFYkR8eZxcLv7gC6x JbGtMjQOMcvYIU0+yD+d4OKbBUAMNKtOzVzFq9skAjJQB5kcux1gKUOdYx+/rg1Hh/Nv HtWGnMJpxDYbSIMVanPrZyB/Kvif5IMlw8+tyQRzv8ZWxFgD0Yi6R8BDxAnpFIDFx97S Hi1sFTMum6JVmp/2LwGAzoes2oq2uH9Y91O9OtF4mlQmaMza7qbkSKVjZmKh9M9iAVKh J7IXJ0YL131A0YvuBfHFeyH9ihLTLyCjLv2PV6fxWbBhK+5dlAiHzwQtnSZs23vcF4M4 13/A== X-Gm-Message-State: ACgBeo2Sm69WPcopHJL7AIBkGQo074N6FZaexv97g73H015x10njA4pD FDwHP9RNOEA3ZjSz1kObelnzPXPIsDn928szkvRopO5C3Ap1fhKnpjEaf/kub8mvsgstJ45UPIX ckXeIw2RPu8i9gibC/N2oRCfP8EHotag27AQCkqfbt2wpoM3DuJXbnzHdYG9ZMyJjsZIY4A== X-Received: by 2002:adf:ce89:0:b0:220:6cc5:aff8 with SMTP id r9-20020adfce89000000b002206cc5aff8mr9905810wrn.396.1660600404333; Mon, 15 Aug 2022 14:53:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR4OAJ7a0UnnYJ7tqTWqb9naQHIU382zVYRVHjmmnON5u7E9HsMntuwmikOY+aox36XmsS1mBQ== X-Received: by 2002:adf:ce89:0:b0:220:6cc5:aff8 with SMTP id r9-20020adfce89000000b002206cc5aff8mr9905783wrn.396.1660600403993; Mon, 15 Aug 2022 14:53:23 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id n6-20020a1c2706000000b003a511e92abcsm10796901wmn.34.2022.08.15.14.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:53:23 -0700 (PDT) Date: Mon, 15 Aug 2022 17:53:20 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Xuan Zhuo , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , Greg KH , Ricardo =?utf-8?Q?Ca=C3=B1uelo?= , Cornelia Huck Subject: [PATCH v2 1/1] virtio: kerneldocs fixes and enhancements Message-ID: <20220815215251.154451-2-mst@redhat.com> References: <20220815215251.154451-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220815215251.154451-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ricardo Ca=C3=B1uelo Fix variable names in some kerneldocs, naming in others. Add kerneldocs for struct vring_desc and vring_interrupt. Signed-off-by: Ricardo Ca=C3=B1uelo Message-Id: <20220810094004.1250-2-ricardo.canuelo@collabora.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index d66c8e6d0ef3..4620e9d79dde 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -2426,6 +2426,14 @@ static inline bool more_used(const struct vring_virt= queue *vq) return vq->packed_ring ? more_used_packed(vq) : more_used_split(vq); } =20 +/** + * vring_interrupt - notify a virtqueue on an interrupt + * @irq: the IRQ number (ignored) + * @_vq: the struct virtqueue to notify + * + * Calls the callback function of @_vq to process the virtqueue + * notification. + */ irqreturn_t vring_interrupt(int irq, void *_vq) { struct vring_virtqueue *vq =3D to_vvq(_vq); diff --git a/include/linux/virtio.h b/include/linux/virtio.h index a3f73bb6733e..dcab9c7e8784 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -11,7 +11,7 @@ #include =20 /** - * virtqueue - a queue to register buffers for sending or receiving. + * struct virtqueue - a queue to register buffers for sending or receiving. * @list: the chain of virtqueues for this device * @callback: the function to call when buffers are consumed (can be NULL). * @name: the name of this virtqueue (mainly for debugging) @@ -97,7 +97,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num, void (*recycle)(struct virtqueue *vq, void *buf)); =20 /** - * virtio_device - representation of a device using virtio + * struct virtio_device - representation of a device using virtio * @index: unique position on the virtio bus * @failed: saved value for VIRTIO_CONFIG_S_FAILED bit (for restore) * @config_enabled: configuration change reporting enabled @@ -156,7 +156,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev); list_for_each_entry(vq, &vdev->vqs, list) =20 /** - * virtio_driver - operations for a virtio I/O driver + * struct virtio_driver - operations for a virtio I/O driver * @driver: underlying device driver (populate name and owner). * @id_table: the ids serviced by this driver. * @feature_table: an array of feature numbers supported by this driver. diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 36ec7be1f480..4b517649cfe8 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -239,7 +239,7 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev, uns= igned nvqs, =20 /** * virtio_synchronize_cbs - synchronize with virtqueue callbacks - * @vdev: the device + * @dev: the virtio device */ static inline void virtio_synchronize_cbs(struct virtio_device *dev) @@ -258,7 +258,7 @@ void virtio_synchronize_cbs(struct virtio_device *dev) =20 /** * virtio_device_ready - enable vq use in probe function - * @vdev: the device + * @dev: the virtio device * * Driver must call this to use vqs in the probe function. * @@ -306,7 +306,7 @@ const char *virtio_bus_name(struct virtio_device *vdev) /** * virtqueue_set_affinity - setting affinity for a virtqueue * @vq: the virtqueue - * @cpu: the cpu no. + * @cpu_mask: the cpu mask * * Pay attention the function are best-effort: the affinity hint may not b= e set * due to config support, irq type and sharing. diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_r= ing.h index 476d3e5c0fe7..f8c20d3de8da 100644 --- a/include/uapi/linux/virtio_ring.h +++ b/include/uapi/linux/virtio_ring.h @@ -93,15 +93,21 @@ #define VRING_USED_ALIGN_SIZE 4 #define VRING_DESC_ALIGN_SIZE 16 =20 -/* Virtio ring descriptors: 16 bytes. These can chain together via "next"= . */ +/** + * struct vring_desc - Virtio ring descriptors, + * 16 bytes long. These can chain together via @next. + * + * @addr: buffer address (guest-physical) + * @len: buffer length + * @flags: descriptor flags + * @next: index of the next descriptor in the chain, + * if the VRING_DESC_F_NEXT flag is set. We chain unused + * descriptors via this, too. + */ struct vring_desc { - /* Address (guest-physical). */ __virtio64 addr; - /* Length. */ __virtio32 len; - /* The flags as indicated above. */ __virtio16 flags; - /* We chain unused descriptors via this, too */ __virtio16 next; }; =20 --=20 MST From nobody Mon Apr 13 11:41:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DBAAC00140 for ; Tue, 16 Aug 2022 02:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239937AbiHPCB6 (ORCPT ); Mon, 15 Aug 2022 22:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231133AbiHPCBS (ORCPT ); Mon, 15 Aug 2022 22:01:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E3A4107F3C for ; Mon, 15 Aug 2022 14:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660600411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n9xDuhV9iHcXHcEoNmD/7wsehe62kvIxVjlpcT9npdI=; b=QdYOR90NwdBme26DEtcrUgmap34C2YvOwG25Afbfl+ES7lG8eqAXItw3WhJOrspf0GsjHc uRw6PAj0L2Dp8d3/7olID4iV7DgOQiNUeO/PXto+84ztN65gMJ4lwRnQSBRmM3DCdsMCNa UkZ6nEWhpUxsCLULX5uSdFv1VnPokV4= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-35-GEU2y6VUPL-a4kML8sOIJA-1; Mon, 15 Aug 2022 17:53:30 -0400 X-MC-Unique: GEU2y6VUPL-a4kML8sOIJA-1 Received: by mail-wm1-f70.google.com with SMTP id h62-20020a1c2141000000b003a4f57eaeaaso4046012wmh.8 for ; Mon, 15 Aug 2022 14:53:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=n9xDuhV9iHcXHcEoNmD/7wsehe62kvIxVjlpcT9npdI=; b=ycTqhfSwrtNAoAWJmx0PmuiJlX2bagl+VkVN0HOCfHYic3f8TG8FFlxUFSqYGWfhkZ iXKlcd3nkj0Y7Fk84nPEEcdzUe2PYtBeoE51JxYTXTaRUbA18hUeUUj+/1Ru9bhdsCs9 6IK0SIbCXGUn5lId1ng46vad/896yJiLqU12+FG2BGwihB5y+Kd6E5wDU684QErrbxbL 9DFrPcPEn/+dlc2Fjtm1fpOk4E4fMoVe4c/+J76EAioSnQ3Q/0Ws44TklaSV47jrribB HV1kDcATr+zNHu/SEDyUiwHB2nONtL4TbaSHEJNc9ScdZfjh6AjCxrm7nhCcWfW2h7EJ v9SQ== X-Gm-Message-State: ACgBeo1avXTPw/1jGZ08vhavUlBfXew3Zxs/1qMEwDdp8xABSV6xtNfk 1AA6qZzdKIsbaqQGec20fju8lnALfoQ5ROIDFaGZf3MeTsgvbNumKY+18/zN7J1Xs4GJrTBTgKi wFsh3Ix1q0PRtx8AwJ3d7sRlTkusT9wxdM3KZWcFbozH39FhUj4Dx9E7C7vZBeRnBhxUsJw== X-Received: by 2002:a05:6000:a1b:b0:220:6d98:e97e with SMTP id co27-20020a0560000a1b00b002206d98e97emr10160838wrb.211.1660600409370; Mon, 15 Aug 2022 14:53:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR5eGYjtb0ao+td67NPUSA+l/VN9/A+r9WJoEcUsIJYOX4UpWH4A8YuFS6y8s/3ZvOYQ5c9VkA== X-Received: by 2002:a05:6000:a1b:b0:220:6d98:e97e with SMTP id co27-20020a0560000a1b00b002206d98e97emr10160811wrb.211.1660600409075; Mon, 15 Aug 2022 14:53:29 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id p15-20020adf9d8f000000b00223654e0eccsm10714216wre.9.2022.08.15.14.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:53:28 -0700 (PDT) Date: Mon, 15 Aug 2022 17:53:24 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Xuan Zhuo , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , Greg KH , Andres Freund Subject: [PATCH v2 1/5] virtio_net: Revert "virtio_net: set the default max ring size by find_vqs()" Message-ID: <20220815215251.154451-3-mst@redhat.com> References: <20220815215251.154451-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815215251.154451-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 762faee5a2678559d3dc09d95f8f2c54cd0466a7. This has been reported to trip up guests on GCP (Google Cloud). The reason is that virtio_find_vqs_ctx_size is broken on legacy devices. We can in theory fix virtio_find_vqs_ctx_size but in fact the patch itself has several other issues: - It treats unknown speed as < 10G - It leaves userspace no way to find out the ring size set by hypervisor - It tests speed when link is down - It ignores the virtio spec advice: Both \field{speed} and \field{duplex} can change, thus the driver is expected to re-read these values after receiving a configuration change notification. - It is not clear the performance impact has been tested properly Revert the patch for now. Reported-by: Andres Freund Link: https://lore.kernel.org/r/20220814212610.GA3690074%40roeck-us.net Link: https://lore.kernel.org/r/20220815070203.plwjx7b3cyugpdt7%40awork3.an= arazel.de Link: https://lore.kernel.org/r/3df6bb82-1951-455d-a768-e9e1513eb667%40www.= fastmail.com Link: https://lore.kernel.org/r/FCDC5DDE-3CDD-4B8A-916F-CA7D87B547CE%40anar= azel.de Fixes: 762faee5a267 ("virtio_net: set the default max ring size by find_vqs= ()") Cc: Xuan Zhuo Cc: Jason Wang Signed-off-by: Michael S. Tsirkin Tested-by: Andres Freund Tested-by: From: Guenter Roeck --- drivers/net/virtio_net.c | 42 ++++------------------------------------ 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index d934774e9733..ece00b84e3a7 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3432,29 +3432,6 @@ static unsigned int mergeable_min_buf_len(struct vir= tnet_info *vi, struct virtqu (unsigned int)GOOD_PACKET_LEN); } =20 -static void virtnet_config_sizes(struct virtnet_info *vi, u32 *sizes) -{ - u32 i, rx_size, tx_size; - - if (vi->speed =3D=3D SPEED_UNKNOWN || vi->speed < SPEED_10000) { - rx_size =3D 1024; - tx_size =3D 1024; - - } else if (vi->speed < SPEED_40000) { - rx_size =3D 1024 * 4; - tx_size =3D 1024 * 4; - - } else { - rx_size =3D 1024 * 8; - tx_size =3D 1024 * 8; - } - - for (i =3D 0; i < vi->max_queue_pairs; i++) { - sizes[rxq2vq(i)] =3D rx_size; - sizes[txq2vq(i)] =3D tx_size; - } -} - static int virtnet_find_vqs(struct virtnet_info *vi) { vq_callback_t **callbacks; @@ -3462,7 +3439,6 @@ static int virtnet_find_vqs(struct virtnet_info *vi) int ret =3D -ENOMEM; int i, total_vqs; const char **names; - u32 *sizes; bool *ctx; =20 /* We expect 1 RX virtqueue followed by 1 TX virtqueue, followed by @@ -3490,15 +3466,10 @@ static int virtnet_find_vqs(struct virtnet_info *vi) ctx =3D NULL; } =20 - sizes =3D kmalloc_array(total_vqs, sizeof(*sizes), GFP_KERNEL); - if (!sizes) - goto err_sizes; - /* Parameters for control virtqueue, if any */ if (vi->has_cvq) { callbacks[total_vqs - 1] =3D NULL; names[total_vqs - 1] =3D "control"; - sizes[total_vqs - 1] =3D 64; } =20 /* Allocate/initialize parameters for send/receive virtqueues */ @@ -3513,10 +3484,8 @@ static int virtnet_find_vqs(struct virtnet_info *vi) ctx[rxq2vq(i)] =3D true; } =20 - virtnet_config_sizes(vi, sizes); - - ret =3D virtio_find_vqs_ctx_size(vi->vdev, total_vqs, vqs, callbacks, - names, sizes, ctx, NULL); + ret =3D virtio_find_vqs_ctx(vi->vdev, total_vqs, vqs, callbacks, + names, ctx, NULL); if (ret) goto err_find; =20 @@ -3536,8 +3505,6 @@ static int virtnet_find_vqs(struct virtnet_info *vi) =20 =20 err_find: - kfree(sizes); -err_sizes: kfree(ctx); err_ctx: kfree(names); @@ -3897,9 +3864,6 @@ static int virtnet_probe(struct virtio_device *vdev) vi->curr_queue_pairs =3D num_online_cpus(); vi->max_queue_pairs =3D max_queue_pairs; =20 - virtnet_init_settings(dev); - virtnet_update_settings(vi); - /* Allocate/initialize the rx/tx queues, and invoke find_vqs */ err =3D init_vqs(vi); if (err) @@ -3912,6 +3876,8 @@ static int virtnet_probe(struct virtio_device *vdev) netif_set_real_num_tx_queues(dev, vi->curr_queue_pairs); netif_set_real_num_rx_queues(dev, vi->curr_queue_pairs); =20 + virtnet_init_settings(dev); + if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY)) { vi->failover =3D net_failover_create(vi->dev); if (IS_ERR(vi->failover)) { --=20 MST From nobody Mon Apr 13 11:41:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70EDFC00140 for ; Tue, 16 Aug 2022 02:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233790AbiHPCCO (ORCPT ); Mon, 15 Aug 2022 22:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232367AbiHPCBU (ORCPT ); Mon, 15 Aug 2022 22:01:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 98DF1108933 for ; Mon, 15 Aug 2022 14:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660600421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bDCYLEy+BFzUXB2vyNCVod0ccaWSLx6QeKp/OdHtLfo=; b=YNj27GS2xgnkckUCnuj4/tUL0ugvNNvLHK5C1SSgvRtkX2ExUn2MxOhifh97CO3H4lhplQ yPAuWCEZJ7FObYzC2gibIJ2T2OIlPw1JNtS0Zsq7jApaUi2CXYPsJPmPQd0/Ke4S4Ce4sj Rt0etFspiZktEzZuFUOc/Ohy7ig9uBI= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-352-heS2YfC0Nd-nQElGjoPhSw-1; Mon, 15 Aug 2022 17:53:40 -0400 X-MC-Unique: heS2YfC0Nd-nQElGjoPhSw-1 Received: by mail-wm1-f70.google.com with SMTP id b4-20020a05600c4e0400b003a5a96f1756so9267318wmq.0 for ; Mon, 15 Aug 2022 14:53:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=bDCYLEy+BFzUXB2vyNCVod0ccaWSLx6QeKp/OdHtLfo=; b=nOkYSCupjOvEkQXFaMT9dHr69KbtY8thhu/aT/nEpjBIYqYjfNI4yzvzwCFFz724KT k7F5+vYlZisdvS7Fy1wIvG5FlWenRt1w1ukgJnW1mO/VhTtRTTxKZEikpQNRD0VF96GW hD03vtcK2es/XadUwmzEUwCp+S1ZXD1OGxUJap5r7PW7Bz5sgcUX0B0x+Msd2KXyyzWG +I9mL+SuQDVBWsJIYKxEGceg7TIPUdsCw09UJeGbHKTIW68IZGo8nwl2Y36036XdNNHB asS9cvOCHdSmvnqSlIouJI9Ep5y+1wuRWjMU5SsjbS9HJAludzhjOM5l55ahMx8joWF4 Ctow== X-Gm-Message-State: ACgBeo1P0p8eR0N4UTr7bbfah25Txts6y69jGVnRredMb25WaCqyyaR/ k+/e99lqyM+5dk+oh5XhcD1BNgB20bgt6HuvsuHPtXmJFEsgYLCctE7urlo1odYDoNkTBegjI3j SS770Nh4FSz6dAfV4xmLYguaXd2KR2RgJVBKeKTS6TtIJdzotwlJ9xEJKyfm+7mRcCcC+8Q== X-Received: by 2002:a7b:ca42:0:b0:3a6:9d:a444 with SMTP id m2-20020a7bca42000000b003a6009da444mr2231556wml.51.1660600418613; Mon, 15 Aug 2022 14:53:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR4BN8C+PGA8RpmSRZwBido/QgzW+8NIJd7WJaZE3l05LkbGN7+KhxLct1xW2rLS+iQX/I9U0w== X-Received: by 2002:a7b:ca42:0:b0:3a6:9d:a444 with SMTP id m2-20020a7bca42000000b003a6009da444mr2231508wml.51.1660600418216; Mon, 15 Aug 2022 14:53:38 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id l23-20020a1c7917000000b003a541358bdbsm10115773wme.21.2022.08.15.14.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:53:37 -0700 (PDT) Date: Mon, 15 Aug 2022 17:53:29 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Xuan Zhuo , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , Greg KH , Richard Weinberger , Anton Ivanov , Johannes Berg , Hans de Goede , Mark Gross , Vadim Pasternak , Bjorn Andersson , Mathieu Poirier , Cornelia Huck , Halil Pasic , Eric Farman , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-um@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH v2 1/1] virtio: Revert "virtio: find_vqs() add arg sizes" Message-ID: <20220815215251.154451-4-mst@redhat.com> References: <20220815215251.154451-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815215251.154451-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit a10fba0377145fccefea4dc4dd5915b7ed87e546: the proposed API isn't supported on all transports but no effort was made to address this. It might not be hard to fix if we want to: maybe just rename size to size_hint and make sure legacy transports ignore the hint. But it's not sure what the benefit is in any case, so let's drop it. Fixes: a10fba037714 ("virtio: find_vqs() add arg sizes") Signed-off-by: Michael S. Tsirkin diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index 79e38afd4b91..e719af8bdf56 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -1011,7 +1011,7 @@ static struct virtqueue *vu_setup_vq(struct virtio_de= vice *vdev, =20 static int vu_find_vqs(struct virtio_device *vdev, unsigned nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc) { struct virtio_uml_device *vu_dev =3D to_virtio_uml_device(vdev); diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/me= llanox/mlxbf-tmfifo.c index 8be13d416f48..1ae3c56b66b0 100644 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -928,7 +928,6 @@ static int mlxbf_tmfifo_virtio_find_vqs(struct virtio_d= evice *vdev, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/re= moteproc_virtio.c index 81c4f5776109..0f7706e23eb9 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -158,7 +158,6 @@ static int rproc_virtio_find_vqs(struct virtio_device *= vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool * ctx, struct irq_affinity *desc) { diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_= ccw.c index 896896e32664..a10dbe632ef9 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c @@ -637,7 +637,6 @@ static int virtio_ccw_find_vqs(struct virtio_device *vd= ev, unsigned nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index dfcecfd7aba1..3ff746e3f24a 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -474,7 +474,6 @@ static int vm_find_vqs(struct virtio_device *vdev, unsi= gned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci= _common.c index 7ad734584823..ad258a9d3b9f 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -396,7 +396,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev,= unsigned int nvqs, /* the config->find_vqs() implementation */ int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc) { int err; diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci= _common.h index a5ff838b85a5..23112d84218f 100644 --- a/drivers/virtio/virtio_pci_common.h +++ b/drivers/virtio/virtio_pci_common.h @@ -110,7 +110,7 @@ void vp_del_vqs(struct virtio_device *vdev); /* the config->find_vqs() implementation */ int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc); const char *vp_bus_name(struct virtio_device *vdev); =20 diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci= _modern.c index be51ec849252..c3b9f2761849 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -347,15 +347,12 @@ static struct virtqueue *setup_vq(struct virtio_pci_d= evice *vp_dev, static int vp_modern_find_vqs(struct virtio_device *vdev, unsigned int nvq= s, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], - u32 sizes[], - const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc) { struct virtio_pci_device *vp_dev =3D to_vp_device(vdev); struct virtqueue *vq; - int rc =3D vp_find_vqs(vdev, nvqs, vqs, callbacks, names, sizes, ctx, - desc); + int rc =3D vp_find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, desc); =20 if (rc) return rc; diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 9bc4d110b800..c6b9b5062043 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -272,7 +272,6 @@ static int virtio_vdpa_find_vqs(struct virtio_device *v= dev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 888f7e96f0c7..36ec7be1f480 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -55,7 +55,6 @@ struct virtio_shm_region { * include a NULL entry for vqs that do not need a callback * names: array of virtqueue names (mainly for debugging) * include a NULL entry for vqs unused by driver - * sizes: array of virtqueue sizes * Returns 0 on success or error status * @del_vqs: free virtqueues found by find_vqs(). * @synchronize_cbs: synchronize with the virtqueue callbacks (optional) @@ -104,9 +103,7 @@ struct virtio_config_ops { void (*reset)(struct virtio_device *vdev); int (*find_vqs)(struct virtio_device *, unsigned nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], - u32 sizes[], - const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc); void (*del_vqs)(struct virtio_device *); void (*synchronize_cbs)(struct virtio_device *); @@ -215,7 +212,7 @@ struct virtqueue *virtio_find_single_vq(struct virtio_d= evice *vdev, const char *names[] =3D { n }; struct virtqueue *vq; int err =3D vdev->config->find_vqs(vdev, 1, &vq, callbacks, names, NULL, - NULL, NULL); + NULL); if (err < 0) return ERR_PTR(err); return vq; @@ -227,8 +224,7 @@ int virtio_find_vqs(struct virtio_device *vdev, unsigne= d nvqs, const char * const names[], struct irq_affinity *desc) { - return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, - NULL, desc); + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, de= sc); } =20 static inline @@ -237,8 +233,8 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev, uns= igned nvqs, const char * const names[], const bool *ctx, struct irq_affinity *desc) { - return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, - ctx, desc); + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, + desc); } =20 /** --=20 MST From nobody Mon Apr 13 11:41:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AD71C00140 for ; Tue, 16 Aug 2022 02:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239634AbiHPCDI (ORCPT ); Mon, 15 Aug 2022 22:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233882AbiHPCBg (ORCPT ); Mon, 15 Aug 2022 22:01:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46562220B89 for ; Mon, 15 Aug 2022 14:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660600424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bnInJhTNmcRkk5WIZQp/adh2w/55qWjBovtngHxo1PM=; b=LvyEx60idQ/fjXGx+vQMMOZ7NVMIO5WyMH2VgKkrAByxB1RkL1A3JR+t/3kNp5qG45I5R3 9PTbKouLnDJ2ADFaqVkKSh4dFW2XPoqbQjIj5QuvMtliMcRQM0BOLOUnumhyF7CD+rMAtE vLhkCaJ8SVd1LVkXaLPnR1T2GabXAsg= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-210-0b67NieTN_CNN0ZpF6KnbQ-1; Mon, 15 Aug 2022 17:53:43 -0400 X-MC-Unique: 0b67NieTN_CNN0ZpF6KnbQ-1 Received: by mail-wm1-f70.google.com with SMTP id i132-20020a1c3b8a000000b003a537064611so4048586wma.4 for ; Mon, 15 Aug 2022 14:53:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=bnInJhTNmcRkk5WIZQp/adh2w/55qWjBovtngHxo1PM=; b=ya2EpO5NnpLycK2aZnWVxsXXMkZlC5mYagSMMlycktQ4vkL3bdiwE+MC8r6fO87dYi ofiUVCco0Ufx+LR87CWixbFhKn2AMnVdVkXviA+6UWPpnZqTbd7bh5IUbQP735gtiyQ7 nxpNUo2tJJ3VxblCakgrNVOTjXN+KKcYlfpd+dpJrRR32W/YXsl/V8nt0Onru8g6hHOQ xdVaOxKZObzMX581Yp0Z7ryuZXX6RvMz2C4ApvPYD8VtWXAS9o5VV+hp3nPlHixPhwQt 8nLrSXA8fe6Tp9+folKTBKhUBGmXs8N8op/x9+nigLzlSrm/2OMAjuC8Oo2VM0dmSMcQ H57w== X-Gm-Message-State: ACgBeo3/xU3vNFQUilBFoULpB+L+iV3hxiQp9zyfjC6804Vgwpqak/Gc 9KiUlWUzesGP5bC/rIx3UaGEY+anhuz4E7zlwTVIDdsBDCEvCbsr02FqK9YGAOBvRrfQDq+SYPj SfS77/868/DwUI42x2VK/w8yVElLUoezTSHk/kwe9Ri9L8+c8r246QpvdaSaz2Tw3VxqgJQ== X-Received: by 2002:adf:eb8e:0:b0:223:a1f6:26b2 with SMTP id t14-20020adfeb8e000000b00223a1f626b2mr9621611wrn.216.1660600422363; Mon, 15 Aug 2022 14:53:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR4jlIHrGyk0NQDFhbHw+XilfZD0zV7zttfZd98h/WsQfsn3+HtdmVcfipmuVvb8Tr8KPbBRvA== X-Received: by 2002:adf:eb8e:0:b0:223:a1f6:26b2 with SMTP id t14-20020adfeb8e000000b00223a1f626b2mr9621582wrn.216.1660600422078; Mon, 15 Aug 2022 14:53:42 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id b3-20020a05600010c300b002217339ce90sm8455090wrx.8.2022.08.15.14.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:53:41 -0700 (PDT) Date: Mon, 15 Aug 2022 17:53:38 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Xuan Zhuo , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , Greg KH Subject: [PATCH v2 2/5] virtio: Revert "virtio: add helper virtio_find_vqs_ctx_size()" Message-ID: <20220815215251.154451-5-mst@redhat.com> References: <20220815215251.154451-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815215251.154451-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit fe3dc04e31aa51f91dc7f741a5f76cc4817eb5b4: the API is now unused and in fact can't be implemented on top of a legacy device. Fixes: fe3dc04e31aa ("virtio: add helper virtio_find_vqs_ctx_size()") Cc: "Xuan Zhuo" Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 6adff09f7170..888f7e96f0c7 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -241,18 +241,6 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev, un= signed nvqs, ctx, desc); } =20 -static inline -int virtio_find_vqs_ctx_size(struct virtio_device *vdev, u32 nvqs, - struct virtqueue *vqs[], - vq_callback_t *callbacks[], - const char * const names[], - u32 sizes[], - const bool *ctx, struct irq_affinity *desc) -{ - return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, sizes, - ctx, desc); -} - /** * virtio_synchronize_cbs - synchronize with virtqueue callbacks * @vdev: the device --=20 MST From nobody Mon Apr 13 11:41:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B1A6C00140 for ; Tue, 16 Aug 2022 02:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240447AbiHPCD0 (ORCPT ); Mon, 15 Aug 2022 22:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233054AbiHPCCR (ORCPT ); Mon, 15 Aug 2022 22:02:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6884A220BAA for ; Mon, 15 Aug 2022 14:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660600430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0Woc1p74LnDMz9TXkvyQIlZ2BlUNGXfNgs76Y3D9lgg=; b=gQy0pOCuABmxJxl68Yu24XbuqdXNkPrR3EMBsdIIthe8mL1+Rdp8YKxhbBE3XE2Q6ncgpz NfmwUbnoE94v5mm7NRAaf2qzNIm/FUGlx9/qzJFrAjsCANGl6Zu7bc77/Sjm6XBUbT4+xf Y0kkE7LzCiQ7PWgBdaUBU4kul1Yrey8= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-594-3s6TYtLKOTaMlCPWPBUg-w-1; Mon, 15 Aug 2022 17:53:49 -0400 X-MC-Unique: 3s6TYtLKOTaMlCPWPBUg-w-1 Received: by mail-wr1-f71.google.com with SMTP id m2-20020adfc582000000b0021e28acded7so1482204wrg.13 for ; Mon, 15 Aug 2022 14:53:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=0Woc1p74LnDMz9TXkvyQIlZ2BlUNGXfNgs76Y3D9lgg=; b=bS6LKRNnFF6VUgcIQgq/ijdv+ZXJIcsbqnAMR6o4BNkzHWBcVJd91bhwokmB/DHUmy 7JCx6vQZIVjHWte93Dn9C/bW4EGZixLRFVjUtZzziIv1WjxwkBv+iUZTU1//TnyICeWN fAfR0VTukm3Ci9GML3eVztTx41wD6G/3JknvGdVwiJY2ud2yy/V3nDoMArAAzh8vy6lr 5kd9KGInZnqz2NjU/yrUoMtxCpQviFANuIkJY0M60pQBb7g7UJ0jHcJja9nwJ88KyXHj KbV9D7DRIixmPZcre4mZNl5Rj1qXp6xwmJsdWOsmL+sUo0shrlUJWumTU0p2o3qAHn2/ /Mrw== X-Gm-Message-State: ACgBeo3UPou5T8EbevL/+RZ8JHpizXi7urLz5N5DNMzGz0YLhlmWK0zw in6i97wgMPi2YCN9yfjgY7tvrFzp0SMP6UdjJoDHkh5rlTHECh8FC32YDz9bV7Z/N79ejq3TzKF Mb/8hMUg9OCU5Wjdi0ujL/Y2oO9LTHO5IWednTIAZFMCD5LfGhsbJgVvDT+yoUvnV6QkuHA== X-Received: by 2002:a05:600c:ad4:b0:3a5:50b2:f991 with SMTP id c20-20020a05600c0ad400b003a550b2f991mr16731051wmr.146.1660600426266; Mon, 15 Aug 2022 14:53:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7WhVEK8u+bWBQ+vsIP1p2ogF6bjbQsW8dmESOECqvboXglS7PHGAZ3CszZnuGHypllX9oYGw== X-Received: by 2002:a05:600c:ad4:b0:3a5:50b2:f991 with SMTP id c20-20020a05600c0ad400b003a550b2f991mr16731025wmr.146.1660600425942; Mon, 15 Aug 2022 14:53:45 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id n32-20020a05600c502000b003a2d47d3051sm13154371wmr.41.2022.08.15.14.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:53:45 -0700 (PDT) Date: Mon, 15 Aug 2022 17:53:42 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Xuan Zhuo , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , Greg KH Subject: [PATCH v2 3/5] virtio-mmio: Revert "virtio_mmio: support the arg sizes of find_vqs()" Message-ID: <20220815215251.154451-6-mst@redhat.com> References: <20220815215251.154451-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815215251.154451-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit fbed86abba6e0472d98079790e58060e4332608a. The API is now unused, let's not carry dead code around. Fixes: fbed86abba6e ("virtio_mmio: support the arg sizes of find_vqs()") Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_mmio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index c492a57531c6..dfcecfd7aba1 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -360,7 +360,7 @@ static void vm_synchronize_cbs(struct virtio_device *vd= ev) =20 static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned = int index, void (*callback)(struct virtqueue *vq), - const char *name, u32 size, bool ctx) + const char *name, bool ctx) { struct virtio_mmio_device *vm_dev =3D to_virtio_mmio_device(vdev); struct virtio_mmio_vq_info *info; @@ -395,11 +395,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_dev= ice *vdev, unsigned int in goto error_new_virtqueue; } =20 - if (!size || size > num) - size =3D num; - /* Create the vring */ - vq =3D vring_create_virtqueue(index, size, VIRTIO_MMIO_VRING_ALIGN, vdev, + vq =3D vring_create_virtqueue(index, num, VIRTIO_MMIO_VRING_ALIGN, vdev, true, true, ctx, vm_notify, callback, name); if (!vq) { err =3D -ENOMEM; @@ -503,7 +500,6 @@ static int vm_find_vqs(struct virtio_device *vdev, unsi= gned int nvqs, } =20 vqs[i] =3D vm_setup_vq(vdev, queue_idx++, callbacks[i], names[i], - sizes ? sizes[i] : 0, ctx ? ctx[i] : false); if (IS_ERR(vqs[i])) { vm_del_vqs(vdev); --=20 MST From nobody Mon Apr 13 11:41:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71EDBC00140 for ; Tue, 16 Aug 2022 02:04:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240285AbiHPCEF (ORCPT ); Mon, 15 Aug 2022 22:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233845AbiHPCDB (ORCPT ); Mon, 15 Aug 2022 22:03:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4AD30220BB9 for ; Mon, 15 Aug 2022 14:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660600434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7KUDnR7ITSXzGuGHvfD+T/glFccQWZ3L+AQhNkH7LGU=; b=BQuKQikjiaSo0bcOOm6/xl6hlPgWOy5O+GwhXOt0KbAkqK0t6867P1EmVJInz+cWPu5Rn1 iTI0e0vqzeItrgp3cPFPyhURxK0ISCKgFoHBYwdMWo/yxmJ2goCnYRZhnL5wpoGAa2j3hr 0T/DLWSojwHz1MXctzwtHvoy6SrVTqw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-52-CfeRcB5rNB2JIkqp3xY8Mg-1; Mon, 15 Aug 2022 17:53:53 -0400 X-MC-Unique: CfeRcB5rNB2JIkqp3xY8Mg-1 Received: by mail-wm1-f72.google.com with SMTP id f18-20020a05600c4e9200b003a5f81299caso947351wmq.7 for ; Mon, 15 Aug 2022 14:53:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=7KUDnR7ITSXzGuGHvfD+T/glFccQWZ3L+AQhNkH7LGU=; b=IpYH+7D0v6KTjisdVAwvjr12Bgz0qJbFgRbSVVDeHzfdFFVbhLtVes+e09FPURDh0A qfHWnlep8Jpo9jBUN7xrzcZon/p0q6L1CPg1FZ2U9xbfMA5pwcM6+kMMzBjJs7wnU5hL KUvmYQZ3LOpEp5b5SfqfSmRDxmJhMLRmedYPOF5Wbbk3mUmNpMrK43wtulVEexSOHllo jNpEZZxaPS5Zg+6GKz/JcSksqbrNDkOTQZMa3ekSdhtKjSGLmQyCYg7WTUp70EvyUdNh WcM+XYH6gpZOZ1fU5+Vf17QbKOl/7hFMC5UdhJKEsovmq2Uvke1QlJbcnC1Sa6ZO5Ehh Gr7w== X-Gm-Message-State: ACgBeo3HJMMLKuKylAJT62REDANkKINUtSwqzrRYygQPb5zpRj4aLPlJ CD1OV+XinOV5kymJMZvZAxJBT7DQTCZqLp8HiN9O8nUOZu/o/uFIJa41oZ50wMceMFI/dD32PQk XGh6JZam1KZGrRC3tXiUb+SSIkWse0QTWndFAjB3qFAn07ku9erRDnlx+cIVJI4EIFkzuoQ== X-Received: by 2002:a05:600c:350:b0:3a5:3473:1c23 with SMTP id u16-20020a05600c035000b003a534731c23mr11674303wmd.9.1660600430117; Mon, 15 Aug 2022 14:53:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR53rMzE4U5pnUK7BCCMlD2tXkJnPNsZxIff5xbTlNR7OU7KWTxyNA44s3F5a7zCujaD/ntPbw== X-Received: by 2002:a05:600c:350:b0:3a5:3473:1c23 with SMTP id u16-20020a05600c035000b003a534731c23mr11674278wmd.9.1660600429861; Mon, 15 Aug 2022 14:53:49 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id z1-20020adfec81000000b0021e51c039c5sm8409417wrn.80.2022.08.15.14.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:53:49 -0700 (PDT) Date: Mon, 15 Aug 2022 17:53:46 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Xuan Zhuo , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , Greg KH , Andres Freund Subject: [PATCH v2 4/5] virtio_pci: Revert "virtio_pci: support the arg sizes of find_vqs()" Message-ID: <20220815215251.154451-7-mst@redhat.com> References: <20220815215251.154451-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815215251.154451-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit cdb44806fca2d0ad29ca644cbf1505433902ee0c: the legacy path is wrong and in fact can not support the proposed API since for a legacy device we never communicate the vq size to the hypervisor. Reported-by: Andres Freund Fixes: cdb44806fca2 ("virtio_pci: support the arg sizes of find_vqs()") Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_pci_common.c | 18 ++++++++---------- drivers/virtio/virtio_pci_common.h | 1 - drivers/virtio/virtio_pci_legacy.c | 6 +----- drivers/virtio/virtio_pci_modern.c | 10 +++------- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci= _common.c index 00ad476a815d..7ad734584823 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -174,7 +174,6 @@ static int vp_request_msix_vectors(struct virtio_device= *vdev, int nvectors, static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned = int index, void (*callback)(struct virtqueue *vq), const char *name, - u32 size, bool ctx, u16 msix_vec) { @@ -187,7 +186,7 @@ static struct virtqueue *vp_setup_vq(struct virtio_devi= ce *vdev, unsigned int in if (!info) return ERR_PTR(-ENOMEM); =20 - vq =3D vp_dev->setup_vq(vp_dev, info, index, callback, name, size, ctx, + vq =3D vp_dev->setup_vq(vp_dev, info, index, callback, name, ctx, msix_vec); if (IS_ERR(vq)) goto out_info; @@ -284,7 +283,7 @@ void vp_del_vqs(struct virtio_device *vdev) =20 static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], bool per_vq_vectors, + const char * const names[], bool per_vq_vectors, const bool *ctx, struct irq_affinity *desc) { @@ -327,8 +326,8 @@ static int vp_find_vqs_msix(struct virtio_device *vdev,= unsigned int nvqs, else msix_vec =3D VP_MSIX_VQ_VECTOR; vqs[i] =3D vp_setup_vq(vdev, queue_idx++, callbacks[i], names[i], - sizes ? sizes[i] : 0, - ctx ? ctx[i] : false, msix_vec); + ctx ? ctx[i] : false, + msix_vec); if (IS_ERR(vqs[i])) { err =3D PTR_ERR(vqs[i]); goto error_find; @@ -358,7 +357,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev,= unsigned int nvqs, =20 static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], const bool *ctx) + const char * const names[], const bool *ctx) { struct virtio_pci_device *vp_dev =3D to_vp_device(vdev); int i, err, queue_idx =3D 0; @@ -380,7 +379,6 @@ static int vp_find_vqs_intx(struct virtio_device *vdev,= unsigned int nvqs, continue; } vqs[i] =3D vp_setup_vq(vdev, queue_idx++, callbacks[i], names[i], - sizes ? sizes[i] : 0, ctx ? ctx[i] : false, VIRTIO_MSI_NO_VECTOR); if (IS_ERR(vqs[i])) { @@ -404,15 +402,15 @@ int vp_find_vqs(struct virtio_device *vdev, unsigned = int nvqs, int err; =20 /* Try MSI-X with one vector per queue. */ - err =3D vp_find_vqs_msix(vdev, nvqs, vqs, callbacks, names, sizes, true, = ctx, desc); + err =3D vp_find_vqs_msix(vdev, nvqs, vqs, callbacks, names, true, ctx, de= sc); if (!err) return 0; /* Fallback: MSI-X with one vector for config, one shared for queues. */ - err =3D vp_find_vqs_msix(vdev, nvqs, vqs, callbacks, names, sizes, false,= ctx, desc); + err =3D vp_find_vqs_msix(vdev, nvqs, vqs, callbacks, names, false, ctx, d= esc); if (!err) return 0; /* Finally fall back to regular interrupts. */ - return vp_find_vqs_intx(vdev, nvqs, vqs, callbacks, names, sizes, ctx); + return vp_find_vqs_intx(vdev, nvqs, vqs, callbacks, names, ctx); } =20 const char *vp_bus_name(struct virtio_device *vdev) diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci= _common.h index c0448378b698..a5ff838b85a5 100644 --- a/drivers/virtio/virtio_pci_common.h +++ b/drivers/virtio/virtio_pci_common.h @@ -80,7 +80,6 @@ struct virtio_pci_device { unsigned int idx, void (*callback)(struct virtqueue *vq), const char *name, - u32 size, bool ctx, u16 msix_vec); void (*del_vq)(struct virtio_pci_vq_info *info); diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci= _legacy.c index d75e5c4e637f..2257f1b3d8ae 100644 --- a/drivers/virtio/virtio_pci_legacy.c +++ b/drivers/virtio/virtio_pci_legacy.c @@ -112,7 +112,6 @@ static struct virtqueue *setup_vq(struct virtio_pci_dev= ice *vp_dev, unsigned int index, void (*callback)(struct virtqueue *vq), const char *name, - u32 size, bool ctx, u16 msix_vec) { @@ -126,13 +125,10 @@ static struct virtqueue *setup_vq(struct virtio_pci_d= evice *vp_dev, if (!num || vp_legacy_get_queue_enable(&vp_dev->ldev, index)) return ERR_PTR(-ENOENT); =20 - if (!size || size > num) - size =3D num; - info->msix_vector =3D msix_vec; =20 /* create the vring */ - vq =3D vring_create_virtqueue(index, size, + vq =3D vring_create_virtqueue(index, num, VIRTIO_PCI_VRING_ALIGN, &vp_dev->vdev, true, false, ctx, vp_notify, callback, name); diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci= _modern.c index f7965c5dd36b..be51ec849252 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -293,7 +293,6 @@ static struct virtqueue *setup_vq(struct virtio_pci_dev= ice *vp_dev, unsigned int index, void (*callback)(struct virtqueue *vq), const char *name, - u32 size, bool ctx, u16 msix_vec) { @@ -311,18 +310,15 @@ static struct virtqueue *setup_vq(struct virtio_pci_d= evice *vp_dev, if (!num || vp_modern_get_queue_enable(mdev, index)) return ERR_PTR(-ENOENT); =20 - if (!size || size > num) - size =3D num; - - if (size & (size - 1)) { - dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u", size); + if (num & (num - 1)) { + dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u", num); return ERR_PTR(-EINVAL); } =20 info->msix_vector =3D msix_vec; =20 /* create the vring */ - vq =3D vring_create_virtqueue(index, size, + vq =3D vring_create_virtqueue(index, num, SMP_CACHE_BYTES, &vp_dev->vdev, true, true, ctx, vp_notify, callback, name); --=20 MST From nobody Mon Apr 13 11:41:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E27CEC00140 for ; Tue, 16 Aug 2022 02:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240292AbiHPCDo (ORCPT ); Mon, 15 Aug 2022 22:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233407AbiHPCCj (ORCPT ); Mon, 15 Aug 2022 22:02:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42051108944 for ; Mon, 15 Aug 2022 14:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660600441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fg6AseMQKhGFaW1h59Li+nNVbNoTUAPXOEzU4kFeR3k=; b=ETNLa1tzuUgARaeugN/emFG4PL4XK3HEi9ZDyL2mV+RsG+EC4o/61LbAEcRZrZy5XoVKhW 35Vf+MCMVbJgmHf1jALDAWzegICKjcguajpevfgRIVyLsJFMnnYHFTD4Hg/J8Xq80KffVQ pBnFtH4PzCemtnVxa5GJLHPBvKtMR8A= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-206-eqt_VyvANkOXQWoPUhtyjg-1; Mon, 15 Aug 2022 17:53:59 -0400 X-MC-Unique: eqt_VyvANkOXQWoPUhtyjg-1 Received: by mail-wm1-f69.google.com with SMTP id c66-20020a1c3545000000b003a5f6dd6a25so1539760wma.1 for ; Mon, 15 Aug 2022 14:53:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=fg6AseMQKhGFaW1h59Li+nNVbNoTUAPXOEzU4kFeR3k=; b=cjM9ZLe+KNZZKwwuk+D2VcZcDK6AqOd2cPCuLrAaoCL9Rib6hgURtB+XkGZODxw30y F7mLHvxwBytW69bKVPIctryJ1daI2XMA1uhE109g8ANh5jriGFAilmldHHTzzAnojdw1 vnxe2c63wR5NjahQUlKwh2V/T3CSyBtr6I6clsx72LPWFbGnsNooOR3+7ZZhhvFVrF05 2Nebvc/c8CbCLno9nIDeM+c36TyVLn8l3t4cyVafW++kbMoDBxxr7MOXENgKquXAGB6G FUT+fhYgD2/DozQuTt1BeaW1FlTKNb+kNJnDXtCI65JR5VjjVi529TTixeIqzTtoL4zS zQoA== X-Gm-Message-State: ACgBeo2c/RVbsFudnriVGv5UZ/bhAowQVCrY0cmuLryWq6J5xcigZeAh 8mwpLFh1DTlyXYAEEL4yPiZiAm6SRb8kl8Uai6Nu5b4qA+792M87rckbab5s16LcA5VW2zg3PTi dNt+ecFdLQ3B1BPbrpRIU278QWVvuXSROc7u0wnrcfZkBSxRS4fAqaQzTZRGneooy4/0mzA== X-Received: by 2002:a5d:688c:0:b0:21f:160d:8859 with SMTP id h12-20020a5d688c000000b0021f160d8859mr10167807wru.711.1660600438202; Mon, 15 Aug 2022 14:53:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR7i3yRQDphQZIsyoh1v41BSMjkMtop58XMuZPufNQqNvzCeKRCE/8qJPk0HkyEzaJW0RSPyXA== X-Received: by 2002:a5d:688c:0:b0:21f:160d:8859 with SMTP id h12-20020a5d688c000000b0021f160d8859mr10167756wru.711.1660600437733; Mon, 15 Aug 2022 14:53:57 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id q9-20020adff509000000b0021efc75914esm8326304wro.79.2022.08.15.14.53.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:53:57 -0700 (PDT) Date: Mon, 15 Aug 2022 17:53:50 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Xuan Zhuo , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , Greg KH , Richard Weinberger , Anton Ivanov , Johannes Berg , Hans de Goede , Mark Gross , Vadim Pasternak , Bjorn Andersson , Mathieu Poirier , Cornelia Huck , Halil Pasic , Eric Farman , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-um@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH v2 5/5] virtio: Revert "virtio: find_vqs() add arg sizes" Message-ID: <20220815215251.154451-8-mst@redhat.com> References: <20220815215251.154451-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815215251.154451-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit a10fba0377145fccefea4dc4dd5915b7ed87e546: the proposed API isn't supported on all transports but no effort was made to address this. It might not be hard to fix if we want to: maybe just rename size to size_hint and make sure legacy transports ignore the hint. But it's not sure what the benefit is in any case, so let's drop it. Fixes: a10fba037714 ("virtio: find_vqs() add arg sizes") Signed-off-by: Michael S. Tsirkin --- arch/um/drivers/virtio_uml.c | 2 +- drivers/platform/mellanox/mlxbf-tmfifo.c | 1 - drivers/remoteproc/remoteproc_virtio.c | 1 - drivers/s390/virtio/virtio_ccw.c | 1 - drivers/virtio/virtio_mmio.c | 1 - drivers/virtio/virtio_pci_common.c | 2 +- drivers/virtio/virtio_pci_common.h | 2 +- drivers/virtio/virtio_pci_modern.c | 7 ++----- drivers/virtio/virtio_vdpa.c | 1 - include/linux/virtio_config.h | 14 +++++--------- 10 files changed, 10 insertions(+), 22 deletions(-) diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index 79e38afd4b91..e719af8bdf56 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -1011,7 +1011,7 @@ static struct virtqueue *vu_setup_vq(struct virtio_de= vice *vdev, =20 static int vu_find_vqs(struct virtio_device *vdev, unsigned nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc) { struct virtio_uml_device *vu_dev =3D to_virtio_uml_device(vdev); diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/me= llanox/mlxbf-tmfifo.c index 8be13d416f48..1ae3c56b66b0 100644 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -928,7 +928,6 @@ static int mlxbf_tmfifo_virtio_find_vqs(struct virtio_d= evice *vdev, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/re= moteproc_virtio.c index 81c4f5776109..0f7706e23eb9 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -158,7 +158,6 @@ static int rproc_virtio_find_vqs(struct virtio_device *= vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool * ctx, struct irq_affinity *desc) { diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_= ccw.c index 896896e32664..a10dbe632ef9 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c @@ -637,7 +637,6 @@ static int virtio_ccw_find_vqs(struct virtio_device *vd= ev, unsigned nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index dfcecfd7aba1..3ff746e3f24a 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -474,7 +474,6 @@ static int vm_find_vqs(struct virtio_device *vdev, unsi= gned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci= _common.c index 7ad734584823..ad258a9d3b9f 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -396,7 +396,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev,= unsigned int nvqs, /* the config->find_vqs() implementation */ int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc) { int err; diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci= _common.h index a5ff838b85a5..23112d84218f 100644 --- a/drivers/virtio/virtio_pci_common.h +++ b/drivers/virtio/virtio_pci_common.h @@ -110,7 +110,7 @@ void vp_del_vqs(struct virtio_device *vdev); /* the config->find_vqs() implementation */ int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], u32 sizes[], const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc); const char *vp_bus_name(struct virtio_device *vdev); =20 diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci= _modern.c index be51ec849252..c3b9f2761849 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -347,15 +347,12 @@ static struct virtqueue *setup_vq(struct virtio_pci_d= evice *vp_dev, static int vp_modern_find_vqs(struct virtio_device *vdev, unsigned int nvq= s, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], - u32 sizes[], - const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc) { struct virtio_pci_device *vp_dev =3D to_vp_device(vdev); struct virtqueue *vq; - int rc =3D vp_find_vqs(vdev, nvqs, vqs, callbacks, names, sizes, ctx, - desc); + int rc =3D vp_find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, desc); =20 if (rc) return rc; diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 9bc4d110b800..c6b9b5062043 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -272,7 +272,6 @@ static int virtio_vdpa_find_vqs(struct virtio_device *v= dev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], - u32 sizes[], const bool *ctx, struct irq_affinity *desc) { diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 888f7e96f0c7..36ec7be1f480 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -55,7 +55,6 @@ struct virtio_shm_region { * include a NULL entry for vqs that do not need a callback * names: array of virtqueue names (mainly for debugging) * include a NULL entry for vqs unused by driver - * sizes: array of virtqueue sizes * Returns 0 on success or error status * @del_vqs: free virtqueues found by find_vqs(). * @synchronize_cbs: synchronize with the virtqueue callbacks (optional) @@ -104,9 +103,7 @@ struct virtio_config_ops { void (*reset)(struct virtio_device *vdev); int (*find_vqs)(struct virtio_device *, unsigned nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], - const char * const names[], - u32 sizes[], - const bool *ctx, + const char * const names[], const bool *ctx, struct irq_affinity *desc); void (*del_vqs)(struct virtio_device *); void (*synchronize_cbs)(struct virtio_device *); @@ -215,7 +212,7 @@ struct virtqueue *virtio_find_single_vq(struct virtio_d= evice *vdev, const char *names[] =3D { n }; struct virtqueue *vq; int err =3D vdev->config->find_vqs(vdev, 1, &vq, callbacks, names, NULL, - NULL, NULL); + NULL); if (err < 0) return ERR_PTR(err); return vq; @@ -227,8 +224,7 @@ int virtio_find_vqs(struct virtio_device *vdev, unsigne= d nvqs, const char * const names[], struct irq_affinity *desc) { - return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, - NULL, desc); + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, de= sc); } =20 static inline @@ -237,8 +233,8 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev, uns= igned nvqs, const char * const names[], const bool *ctx, struct irq_affinity *desc) { - return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, - ctx, desc); + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, + desc); } =20 /** --=20 MST