From nobody Mon Apr 13 11:41:06 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 7011BC2BB41 for ; Tue, 16 Aug 2022 08:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232255AbiHPILZ (ORCPT ); Tue, 16 Aug 2022 04:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231585AbiHPIKO (ORCPT ); Tue, 16 Aug 2022 04:10:14 -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 3826758B70 for ; Mon, 15 Aug 2022 22:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660628191; 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=l2M+kfj/q6iM98hTn0aSRA5w9qc6MC0Xhy6BDVtYHqo=; b=EMIGfMH3wM4IdH3+cx7kvgyjXhesqjmRQNIpqeMsbKMTrwGuo39aeNe5U1swCT7ozwNohk +wAV0Wc8fGVdIn9gPgUYPzQct7FJPJ7fvGYFL5/f1KC/tRe3lZZ8D1Ks04AG5731VUFIyh gTo+ljYqcG3Hf7z7WBKNUokTQc5ubJA= 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-637-13wAFDeZOnqHVX7LPRgxEA-1; Tue, 16 Aug 2022 01:36:29 -0400 X-MC-Unique: 13wAFDeZOnqHVX7LPRgxEA-1 Received: by mail-wm1-f72.google.com with SMTP id b4-20020a05600c4e0400b003a5a96f1756so9752659wmq.0 for ; Mon, 15 Aug 2022 22:36:29 -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=l2M+kfj/q6iM98hTn0aSRA5w9qc6MC0Xhy6BDVtYHqo=; b=mpQDggkGH1y/lHwbBvwWp5VvlCoeVZ1JbA2I8A4bIjYwprvOb3QguxThoaVaNiIYLX nHl/24KcO00IxmcIE9FCaX/r4PjBr1xSG4xv0soefh1LoP4QMJBbl7eVBAKmKOi8RIKq lrh1gO+urhnGrD/xF32FvpmvMdLsBM8JwnsoODKTvY9oH9vPT4FN3vlo9G2b2wHeuHKF /6sJFn7H6/sbjXNSBw2hJ3Q5AANxIYc7b6vaeBoY4TdDTkgFfr4ORRfRbRCTZBP2thwG KxCkFHkJnF96qtHBCkEB8ZnB3MXTF5j8CBGPEVFrHNV/zLlA0FMO3dVyo7TC3FUG+HCX J1dw== X-Gm-Message-State: ACgBeo2Yrh9k5CXVdM3gs6kzcETRuA2IOOhYVKqsq4q2mERC82HIbfU6 gNVIpySnOy3NCAbnbhNtMgGdnKJ8wiFAa0+uP+ag9/CdjGtjxER/oMscHswFfUIjRQT9rNVhD/F JRkz5+iVjvf7LLhsJg9nBWcsKftVI1SbZzE+ndQSEGxwaY2zWV4xSeaPuVfAHMuJ1VcQkuQ== X-Received: by 2002:a5d:590b:0:b0:21f:1510:c69c with SMTP id v11-20020a5d590b000000b0021f1510c69cmr10470286wrd.502.1660628188058; Mon, 15 Aug 2022 22:36:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR62AUVV4mkf9GDo6FOGq4gcODaPuaJrI+5j4yEhgZoQfpTZq0lwFE8QtdGR18ppdgihkkL0kA== X-Received: by 2002:a5d:590b:0:b0:21f:1510:c69c with SMTP id v11-20020a5d590b000000b0021f1510c69cmr10470265wrd.502.1660628187790; Mon, 15 Aug 2022 22:36:27 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id j20-20020a05600c191400b003a5c1e916c8sm1709648wmq.1.2022.08.15.22.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 22:36:27 -0700 (PDT) Date: Tue, 16 Aug 2022 01:36:23 -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 v4 1/6] virtio_net: Revert "virtio_net: set the default max ring size by find_vqs()" Message-ID: <20220816053602.173815-2-mst@redhat.com> References: <20220816053602.173815-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220816053602.173815-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: 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:06 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 1867EC2BB41 for ; Tue, 16 Aug 2022 08:11:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231501AbiHPILk (ORCPT ); Tue, 16 Aug 2022 04:11:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232327AbiHPIKZ (ORCPT ); Tue, 16 Aug 2022 04:10:25 -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 941A967162 for ; Mon, 15 Aug 2022 22:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660628194; 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=UnFnQdMICe1ph6hMhcpXCBN7MH3SirA2KSLaEpMhTQIRzV0XniY9JuNe1pxVDA37WECcKN ZLqnHxKm6pTMOwW47nPXzSy59MmW8bp/xadJFiEAB7Rlhvc+xHKDsT6q6fqH/a2cfDaP8z t0uPS+xh5Thpcz7gXpAYoNZIKfzpPXY= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-86-mf5XRy57OMmwUAYgPblalg-1; Tue, 16 Aug 2022 01:36:33 -0400 X-MC-Unique: mf5XRy57OMmwUAYgPblalg-1 Received: by mail-wr1-f70.google.com with SMTP id x5-20020adfbb45000000b0021ee56506dfso1576053wrg.11 for ; Mon, 15 Aug 2022 22:36:33 -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=5b/LY4nPKbLMeepa9+Gv1JfA6S9rfyD/MRXVPSsAn9NOdob6j88q8PtjPfIxherNuC tV4535yBVydqhaCJ690VH/gaUS1FxYS6prev6PKoGS+DWfRbNXL6XJ4JiC64EEMhWu5D MGtveJCFbh4EoyDChWnvJg3uuVz9sIGgCWUdehN2dSoLs7PqMrt5R2mTlg4Dp8gcOMRq pekvf3X00Q9B8NI36z/Ti/2rhMzsuy7OOZw+tXgeajgKDXy8fnjC2Ag+RWssc+TNKHU+ LBFKb+V8xrG77HC0+Skv6KdaCCaSzjLFR0T9okCrStVEbJP/H8vKpsNbwGxp6emA0F65 Umkg== X-Gm-Message-State: ACgBeo3Zzw3E5DOFvg7C71Don+oRDEUtvvhSKPNV8lAEgBJJ242tl4aj OdvEQUSDbPurjhvGJ8rlUCBNoVpXEhBmlTMds7WTzqJvvvovOUeEqQRWrr/BNwK/O4XWiQJui+Z sg1suPNfwE+1rtMRapAZdfBav6P6efImwzkhXFc2xcls9+dxbip6G8WOamLkv6ULEoyvyQg== X-Received: by 2002:a05:6000:1188:b0:220:6c20:fbf6 with SMTP id g8-20020a056000118800b002206c20fbf6mr10766521wrx.372.1660628192138; Mon, 15 Aug 2022 22:36:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR4EkqFgvn7hB2RJJpvVWV5jJVrRGEU1rfoAnhvs4XogqkEgf0eN7zdUfJbZFDbhzDt1P9Tkdg== X-Received: by 2002:a05:6000:1188:b0:220:6c20:fbf6 with SMTP id g8-20020a056000118800b002206c20fbf6mr10766495wrx.372.1660628191855; Mon, 15 Aug 2022 22:36:31 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id bg1-20020a05600c3c8100b003a317ee3036sm12197295wmb.2.2022.08.15.22.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 22:36:31 -0700 (PDT) Date: Tue, 16 Aug 2022 01:36:27 -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 v4 2/6] virtio: Revert "virtio: add helper virtio_find_vqs_ctx_size()" Message-ID: <20220816053602.173815-3-mst@redhat.com> References: <20220816053602.173815-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220816053602.173815-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:06 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 BFCE6C2BB41 for ; Tue, 16 Aug 2022 08:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232308AbiHPILh (ORCPT ); Tue, 16 Aug 2022 04:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232520AbiHPIKi (ORCPT ); Tue, 16 Aug 2022 04:10:38 -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 528DE67C96 for ; Mon, 15 Aug 2022 22:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660628200; 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=I/neypUbeR2iAOHmGEfxaVrLFBUV08yHmcmbsarmc6S2IBFRjj3Anf5ZMpgFLFGA0zGq0C fJlWabcuY1itR62OFBM7KI8IBCcnqSJshqwVPCc21+kSBDCQeR0+7QjpzZdpthlKq+RjuJ q6eSh2YucMJnPcm3FmNHQ9Qj/OkR3IU= 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-300-wq30lc0kN8Sn4qeZUYTQdQ-1; Tue, 16 Aug 2022 01:36:38 -0400 X-MC-Unique: wq30lc0kN8Sn4qeZUYTQdQ-1 Received: by mail-wm1-f69.google.com with SMTP id i132-20020a1c3b8a000000b003a537064611so4462835wma.4 for ; Mon, 15 Aug 2022 22:36:38 -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=X1ulHijKPneqX8Xwbfh+gi9MxNDpNMJhAJ1m6abJ3vdl0NonsRrdS0nEptIvi2Uuly ZR7lVgFV4BVk5rmPcfAh7Zf8jDOUwTSuzS1OKGJKgt38pmVHUgtGWchdFtztIjRZ9oJV k43iiPYKqdBZMmuR1hVROUOPfSNfViARbjWWAq0XB8d61CSxx562Oye/Gr86vdbF3DP0 SQY79LxOr8q5jHw6WEpffVOLEnVAEkkpb//+sCns7rJNEE1DlBFYmSDopT6GdwADGwO0 4t32FRMDFoUSvlr0eeomd8fWRwS2d7Umptt5qRBB3lxE3dFPvBNPQ7TR5+B5fB3qy/Jw zVhg== X-Gm-Message-State: ACgBeo32Z7hqDguIbF0hmAK4VdVFCcCDFhURJO4ycfuJ2PpPcct1UTUu th24hp9JCCnuq/5khbt3HXlt7nL/WSOeaYis5dhKLPSk03rDJYDRin9xLP+F3Mbduedu0qKyScm r1K8Z30KZ8EvThrJhYLQtk1F3mIqxwrYlrr2xpOb5TXaS3FxZWoR9VTPpNZaLI2p5R36xyA== X-Received: by 2002:a5d:6312:0:b0:220:6820:57d7 with SMTP id i18-20020a5d6312000000b00220682057d7mr10333261wru.8.1660628195741; Mon, 15 Aug 2022 22:36:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR5lfJNXkB52mr103dHeF1YNUqGQn4R8ZmPcZt7Bv3gQF4wEpKRHrZVkPc9XrO/DSv/ceTxJOA== X-Received: by 2002:a5d:6312:0:b0:220:6820:57d7 with SMTP id i18-20020a5d6312000000b00220682057d7mr10333235wru.8.1660628195428; Mon, 15 Aug 2022 22:36:35 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id ba11-20020a0560001c0b00b002235eb9d200sm9225278wrb.10.2022.08.15.22.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 22:36:34 -0700 (PDT) Date: Tue, 16 Aug 2022 01:36:32 -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 v4 3/6] virtio-mmio: Revert "virtio_mmio: support the arg sizes of find_vqs()" Message-ID: <20220816053602.173815-4-mst@redhat.com> References: <20220816053602.173815-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220816053602.173815-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:06 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 BFD8FC2BB41 for ; Tue, 16 Aug 2022 08:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbiHPILU (ORCPT ); Tue, 16 Aug 2022 04:11:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232529AbiHPIKi (ORCPT ); Tue, 16 Aug 2022 04:10:38 -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 C411067CA3 for ; Mon, 15 Aug 2022 22:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660628203; 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=FFDNSbvKIMyhgkWAHIlH9TLopnddZ1QYJdfEI5zcoeTR2+l12UDZ4RP6SVqkFjrReeN8nt 3eZlyQXfOtmWetqEq0IOi2KxrRN7F70jgZmNSNbjrTZk9Y6VhEZHHhEIR54ZPYQoKLrgXs aNaJI3YeOs4xp4ulJDcv5h38hp9x0N4= 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-338-5rajqE1_M-uEr5w1vL45_g-1; Tue, 16 Aug 2022 01:36:42 -0400 X-MC-Unique: 5rajqE1_M-uEr5w1vL45_g-1 Received: by mail-wm1-f70.google.com with SMTP id p19-20020a05600c1d9300b003a5c3141365so7156035wms.9 for ; Mon, 15 Aug 2022 22:36:42 -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=tNJZpRZI3LBr8UqIe3V0FG1FzmXQ2ogK5zaJNPCf2W4pSBPmDS6LYOuC1NDJTf2VKu V7y9KIksZvP0sI4e+0xL2OWxsHtpr/awdy/f68xLBOW9pA3a7BUBGuOQcv34Rxjv+mTL WxG9l88G8MEvk4yb9Tu4eBR0aeUyHJOvbPd6YVOmxVqsZvWZPOyCPuIBKmMsxHwFKBX/ PI0DTjsGRlYZLR1nHCpdXTL6/CZdodqJaLQdoxeVb1WAB6/ircukAwAUZW/Y5ZTAQkBX FLLfkSr7czSKMg7vQB8RIxMiVXRuEOjwLXTtbnIISyi3ZTylqV9yG8V1XyBpAaQL/GTN bX3g== X-Gm-Message-State: ACgBeo1+3jMKZBhRnAsGgBzAgsKKKjcK0s7OJbjSc3c7CIk3OwnxuxRN 2Nk6lQprRVZ/cxCAiUphjGcDQjNBUmNHBmUsT3p22FoIUR5xbzMr8Hk1zbrXNioGx4h/VbWSQyx hMwAcPUdksbuyuN01sxdmEWX5fpXyNGmo0/w6loDWQkwAOjj5Gw2xVwDu0AnaD1o2Vq25Jg== X-Received: by 2002:a05:600c:1c83:b0:3a3:1f70:25a5 with SMTP id k3-20020a05600c1c8300b003a31f7025a5mr18412715wms.54.1660628201093; Mon, 15 Aug 2022 22:36:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR4kzmUA2mS0iZBrt5q7gKzWHCvCko36MWp8hTvWspyQu/9LQBLLi7D8U8GszfgwIHA29QVLJw== X-Received: by 2002:a05:600c:1c83:b0:3a3:1f70:25a5 with SMTP id k3-20020a05600c1c8300b003a31f7025a5mr18412690wms.54.1660628200817; Mon, 15 Aug 2022 22:36:40 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id q18-20020adff952000000b00222ed7ea203sm8819074wrr.100.2022.08.15.22.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 22:36:40 -0700 (PDT) Date: Tue, 16 Aug 2022 01:36:35 -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 v4 4/6] virtio_pci: Revert "virtio_pci: support the arg sizes of find_vqs()" Message-ID: <20220816053602.173815-5-mst@redhat.com> References: <20220816053602.173815-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220816053602.173815-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:06 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 03A38C2BB41 for ; Tue, 16 Aug 2022 08:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbiHPILy (ORCPT ); Tue, 16 Aug 2022 04:11:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232715AbiHPIK6 (ORCPT ); Tue, 16 Aug 2022 04:10:58 -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 C28581138 for ; Mon, 15 Aug 2022 22:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660628214; 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=7gwPm9xDUr2cS5ofMDcan9qf7hv2F2NrtQxh7A5E41E=; b=U00L7QtQgHspuYpwccuUZfF2iX/PiZXQ2M0x5ZCdP/1zszqOEWAxY2tDsWBRQlcYgGWx/8 +8scAI+79nVESuvYSdHaJ0XZqf3PBi27GTZm/+X9shPW3QU175lhpFrZcVeyA/f2mfwtNm LRi8cXecoK3/V1QaAFQnCt7g7jJvRM4= 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-47-Yrmk5kl8Ow6vnVXm7Y03cA-1; Tue, 16 Aug 2022 01:36:46 -0400 X-MC-Unique: Yrmk5kl8Ow6vnVXm7Y03cA-1 Received: by mail-wr1-f71.google.com with SMTP id r17-20020adfa151000000b00224f8e2a2edso1140005wrr.0 for ; Mon, 15 Aug 2022 22:36:46 -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=7gwPm9xDUr2cS5ofMDcan9qf7hv2F2NrtQxh7A5E41E=; b=thceOW0MfWReW9A0+Bkvd9ROWjzRWV5/F8Q8TPVQVHDoqG4jiwZmKdLWJKf9PIO3MF bevT64mwBy/d+vCirTcI5PxtjJhTMy5tHyY4WZeft+D8JsquTAsIn7TCLTBXm1HDKIwv IvCu3W8mIr2r2/pKphrLB/scL6yKWr3tAUupebc7gOgFTGe6Of4k37pXodNuJyRTnLHK 6GVF9x1FHxPYxHDvW10dS3RT/l/MYN5gBPnFqWKcMkTQON9IyYu5CcGwR3Oxa0jKquMi 4HNQHu9jW+nZvgQRAef2gF9L6vryQT81N+KgHI8YVEWCIwu4Nwyjo0igZDkpvQLBqWpI MLVg== X-Gm-Message-State: ACgBeo2kAfO4+LzvLur/m+DJ65R1W++14qIOBU+KGZp7HcRHTYuPf8V4 AMuD8ie8N3Y7MeGb4iUfRhEwa+8YVkCS0R7x8byCr2Kl9f8dsOvJ68rF3vMRl0c4LZB3B2uNRZu dldfgrmNRy8stjc7tqYRxkUdaNoEG8BzKqqXKdz35/T9ElzUng0oWe2spDMfbbi0pi16iIg== X-Received: by 2002:a05:600c:3492:b0:3a5:e1a0:24c9 with SMTP id a18-20020a05600c349200b003a5e1a024c9mr7684233wmq.177.1660628205057; Mon, 15 Aug 2022 22:36:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR7cl47H6aW+psCSXTD8lf2D+3OkxsNSPvJV6zikekDWgdM77/QiAz5BzR9Prm3rV3l9dztplA== X-Received: by 2002:a05:600c:3492:b0:3a5:e1a0:24c9 with SMTP id a18-20020a05600c349200b003a5e1a024c9mr7684208wmq.177.1660628204830; Mon, 15 Aug 2022 22:36:44 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id q65-20020a1c4344000000b003a327b98c0asm11713634wma.22.2022.08.15.22.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 22:36:44 -0700 (PDT) Date: Tue, 16 Aug 2022 01:36:41 -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 , Bo Liu Subject: [PATCH v4 5/6] virtio: Revert "virtio_vdpa: support the arg sizes of find_vqs()" Message-ID: <20220816053602.173815-6-mst@redhat.com> References: <20220816053602.173815-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220816053602.173815-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 99e8927d8a4da8eb8a8a5904dc13a3156be8e7c0: 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: 99e8927d8a4d ("virtio_vdpa: support the arg sizes of find_vqs()") Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_vdpa.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 9bc4d110b800..832d2c5b1b19 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -131,7 +131,7 @@ static irqreturn_t virtio_vdpa_virtqueue_cb(void *priva= te) static struct virtqueue * virtio_vdpa_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_vdpa_device *vd_dev =3D to_virtio_vdpa_device(vdev); struct vdpa_device *vdpa =3D vd_get_vdpa(vdev); @@ -168,17 +168,14 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsi= gned int index, goto error_new_virtqueue; } =20 - if (!size || size > max_num) - size =3D max_num; - if (ops->get_vq_num_min) min_num =3D ops->get_vq_num_min(vdpa); =20 - may_reduce_num =3D (size =3D=3D min_num) ? false : true; + may_reduce_num =3D (max_num =3D=3D min_num) ? false : true; =20 /* Create the vring */ align =3D ops->get_vq_align(vdpa); - vq =3D vring_create_virtqueue(index, size, align, vdev, + vq =3D vring_create_virtqueue(index, max_num, align, vdev, true, may_reduce_num, ctx, virtio_vdpa_notify, callback, name); if (!vq) { @@ -288,9 +285,9 @@ static int virtio_vdpa_find_vqs(struct virtio_device *v= dev, unsigned int nvqs, continue; } =20 - vqs[i] =3D virtio_vdpa_setup_vq(vdev, queue_idx++, callbacks[i], - names[i], sizes ? sizes[i] : 0, - ctx ? ctx[i] : false); + vqs[i] =3D virtio_vdpa_setup_vq(vdev, queue_idx++, + callbacks[i], names[i], ctx ? + ctx[i] : false); if (IS_ERR(vqs[i])) { err =3D PTR_ERR(vqs[i]); goto err_setup_vq; --=20 MST From nobody Mon Apr 13 11:41:06 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 552BAC2BB41 for ; Tue, 16 Aug 2022 08:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232404AbiHPILt (ORCPT ); Tue, 16 Aug 2022 04:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbiHPIK5 (ORCPT ); Tue, 16 Aug 2022 04:10:57 -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 9206BFE1 for ; Mon, 15 Aug 2022 22:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660628213; 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=7gwPm9xDUr2cS5ofMDcan9qf7hv2F2NrtQxh7A5E41E=; b=RzNbCe2P5JyCsULdVvUvKo7xnwRw3oaoVCPwz5VYg8gPYrish+gZ4jzw2hJ8TiPoky69Qh 9MiPgtLiURbWjtyYMmg4Hns/zmKobRdbrJ2n55hZsI+cmaAr/OnKS8Vn5nDPML6quhg59V l2O2trDmUsK4s6a0k5T3dbMAIah93xE= 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-518-bTN1ftaPPNaF3-2p-V8KcQ-1; Tue, 16 Aug 2022 01:36:52 -0400 X-MC-Unique: bTN1ftaPPNaF3-2p-V8KcQ-1 Received: by mail-wm1-f72.google.com with SMTP id c66-20020a1c3545000000b003a5f6dd6a25so2025769wma.1 for ; Mon, 15 Aug 2022 22:36: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=7gwPm9xDUr2cS5ofMDcan9qf7hv2F2NrtQxh7A5E41E=; b=HX5imRVSZ0NReLI/8n6ar7RtJquW9QPVD2IeddMHUliVwWD1kwSvrVWlUnNcwmQ7P/ cyzHALQzQ/UnKyX4UygBVnwy2z0B9XeF4P2a+7cWMZibO9oeiLIqShbto97txFQnrziq 470JWvr8GoF+EvkmInJXxFHsZ0wWyrDTO3Bj3Qf75PbzT9AmXdJNylfEnNqwuSAyBYr5 pQ/yuPc8AyE9K+oZcVK5FDvC4hFH39n0qAOfD4u6roZO1Vaw8TOxHlKFxmSe6XuADBMC HA1Ty3rUIi6hEB6d8lx+zR5yHf+rQjn+ErASdjXnU64ffnxdeIUmq9vsOrrpo6LmZ2X+ fkfA== X-Gm-Message-State: ACgBeo0ehtRzdeLdLFxNR/G3/bSQKzNQoa8IO83mC8B4qjrsbavggkRG caUaNYtGXPOey4R0asZCw5WcoHR226SoqM3sabEZLNkY+HIC1vvBzic+l+yXTJqfKjQKTxhTWMe xEs1B41xQ5mp7pYn5dChIPT79ZzII5by3zHoYh9p2TEHMJDmuZ4ZfD0NCeSEKKdlkBfdvKQ== X-Received: by 2002:a5d:6d42:0:b0:220:7ab1:9da9 with SMTP id k2-20020a5d6d42000000b002207ab19da9mr10493855wri.403.1660628211317; Mon, 15 Aug 2022 22:36:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR7d8A8k6M8JI6hmCoeeaJbBUK4Uy4I2ToLn096BssqGpPc9DKZ9IxX+tavz6eIPk8MWq4XyUg== X-Received: by 2002:a5d:6d42:0:b0:220:7ab1:9da9 with SMTP id k2-20020a5d6d42000000b002207ab19da9mr10493798wri.403.1660628209524; Mon, 15 Aug 2022 22:36:49 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id by6-20020a056000098600b0021e571a99d5sm9163254wrb.17.2022.08.15.22.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 22:36:49 -0700 (PDT) Date: Tue, 16 Aug 2022 01:36:45 -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 , Bo Liu Subject: [PATCH v4 5/6] virtio_vdpa: Revert "virtio_vdpa: support the arg sizes of find_vqs()" Message-ID: <20220816053602.173815-7-mst@redhat.com> References: <20220816053602.173815-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220816053602.173815-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 99e8927d8a4da8eb8a8a5904dc13a3156be8e7c0: 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: 99e8927d8a4d ("virtio_vdpa: support the arg sizes of find_vqs()") Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_vdpa.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 9bc4d110b800..832d2c5b1b19 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -131,7 +131,7 @@ static irqreturn_t virtio_vdpa_virtqueue_cb(void *priva= te) static struct virtqueue * virtio_vdpa_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_vdpa_device *vd_dev =3D to_virtio_vdpa_device(vdev); struct vdpa_device *vdpa =3D vd_get_vdpa(vdev); @@ -168,17 +168,14 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsi= gned int index, goto error_new_virtqueue; } =20 - if (!size || size > max_num) - size =3D max_num; - if (ops->get_vq_num_min) min_num =3D ops->get_vq_num_min(vdpa); =20 - may_reduce_num =3D (size =3D=3D min_num) ? false : true; + may_reduce_num =3D (max_num =3D=3D min_num) ? false : true; =20 /* Create the vring */ align =3D ops->get_vq_align(vdpa); - vq =3D vring_create_virtqueue(index, size, align, vdev, + vq =3D vring_create_virtqueue(index, max_num, align, vdev, true, may_reduce_num, ctx, virtio_vdpa_notify, callback, name); if (!vq) { @@ -288,9 +285,9 @@ static int virtio_vdpa_find_vqs(struct virtio_device *v= dev, unsigned int nvqs, continue; } =20 - vqs[i] =3D virtio_vdpa_setup_vq(vdev, queue_idx++, callbacks[i], - names[i], sizes ? sizes[i] : 0, - ctx ? ctx[i] : false); + vqs[i] =3D virtio_vdpa_setup_vq(vdev, queue_idx++, + callbacks[i], names[i], ctx ? + ctx[i] : false); if (IS_ERR(vqs[i])) { err =3D PTR_ERR(vqs[i]); goto err_setup_vq; --=20 MST From nobody Mon Apr 13 11:41:06 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 17BF5C2BB41 for ; Tue, 16 Aug 2022 08:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232493AbiHPIMl (ORCPT ); Tue, 16 Aug 2022 04:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbiHPILH (ORCPT ); Tue, 16 Aug 2022 04:11:07 -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 1C5C26542 for ; Mon, 15 Aug 2022 22:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660628221; 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=Cpgv5FAeV4Xgxidc6icz1XaUm6ZCyxEOOOfQnaAl0aE=; b=bN4/k5Cp0bVB5GsWteP06MZ7FUC4OytbR+bB1a0Xk+0gQoDSbk4ZlQWHx342mRyttebVTr NsrHaPMzNs4um6IL/P8QxnksTpowXbPQGj9mgN2zESGk12Z2kKEGkrgB42BT/4s0+8+Tib 8SzN4kk6ibNd8eZmw5nAeBdAszAI530= 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-225-c678k33WP_W6r7GH4pLTsw-1; Tue, 16 Aug 2022 01:37:00 -0400 X-MC-Unique: c678k33WP_W6r7GH4pLTsw-1 Received: by mail-wm1-f71.google.com with SMTP id x16-20020a1c7c10000000b003a5cefa5578so1736309wmc.7 for ; Mon, 15 Aug 2022 22:36: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=Cpgv5FAeV4Xgxidc6icz1XaUm6ZCyxEOOOfQnaAl0aE=; b=CYXz4rnh7Od7yf7mz7C5iMuTrO+jEOmHaoNSGLyOEBZdwcQZ/545UQR+jq2RqTQavi zrh6RI6++VNHs+QnZxWc7fu54zEMqgjPd1uAGZ956RU6KF6e5lXkR3WgoHZT7aKsHU4X Vdtif01JAUmSYd8mLV3WDbYvsKeG8y08GS7v2HBxhZRj587AIbCwtOEraeGjUZokasS4 Kg4dxXrqShW4Tc/o5OdjYH+fE6vvRHyJ+nwt7jgMACYiuaQpArb8j9LAFbGuTZSqcmvP TGqpU2ll6I8CbpsjJyLVjsVKGcoJg5Dkz8xNMerLB4XOuGWeQyvPLgKYj/YWlf1zaRnH 99tA== X-Gm-Message-State: ACgBeo0CghEC2aL30UQIQXuq3uaC0hOXtwWmsCB2AyXUv5rK9FLoY9bQ /bYNjWQSShKbsU2RJLxKIRQjFsvkz8T37ZH/LVCqOs1DOnxP+gcJOaEd/FuWKeo1/K7o15EFWq9 YujNlNJ1kN0LlzA7toYmlwdyEbXBF5ddoLo+EUA3NytTJk1mEB1zfn+2TPn/2bv7jA4PLNw== X-Received: by 2002:adf:f5cc:0:b0:221:7e3f:41eb with SMTP id k12-20020adff5cc000000b002217e3f41ebmr10278862wrp.551.1660628218649; Mon, 15 Aug 2022 22:36:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR5WDnzBpzupB051dVdRKYw1crDTF90RoLhqKzZL00iu8qEeaHBRmDf/lNXmgrH/YzznHXnhuA== X-Received: by 2002:adf:f5cc:0:b0:221:7e3f:41eb with SMTP id k12-20020adff5cc000000b002217e3f41ebmr10278814wrp.551.1660628218337; Mon, 15 Aug 2022 22:36:58 -0700 (PDT) Received: from redhat.com ([2.55.4.37]) by smtp.gmail.com with ESMTPSA id f16-20020adfb610000000b002237fd66585sm8918606wre.92.2022.08.15.22.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 22:36:57 -0700 (PDT) Date: Tue, 16 Aug 2022 01:36:51 -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 v4 6/6] virtio: Revert "virtio: find_vqs() add arg sizes" Message-ID: <20220816053602.173815-8-mst@redhat.com> References: <20220816053602.173815-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220816053602.173815-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 832d2c5b1b19..9670cc79371d 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -269,7 +269,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