From mboxrd@z Thu Jan 1 00:00:00 1970 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 DFA7BC433F5 for ; Wed, 9 Mar 2022 09:04:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231716AbiCIJFc (ORCPT ); Wed, 9 Mar 2022 04:05:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbiCIJFb (ORCPT ); Wed, 9 Mar 2022 04:05:31 -0500 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 183B91480E6 for ; Wed, 9 Mar 2022 01:04:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646816671; 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=8eOwlkZcGQDXJozobV2VKRCePhnXpJDnIKdIuSxdQwY=; b=DIkKYiIYR8PSqDyTC/LifulEZk6PAGXeQJdztYPzxIX7SZ0Oa0if+HLZEa45iyfsA1Wfjd eljR6AUPAqdR6i46iP+Z2WhoOsu81Dwool1d6K3ryAFYcJw1SIe5A7f+65I8zLW14NxZNi ZkAehu5TS0LylhE4tUniAEEtiQ5ycdw= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-344-MI0ahaobPG2Fl8aTtQe2FA-1; Wed, 09 Mar 2022 04:04:29 -0500 X-MC-Unique: MI0ahaobPG2Fl8aTtQe2FA-1 Received: by mail-pj1-f70.google.com with SMTP id l14-20020a17090a660e00b001bf496be6d0so1197776pjj.7 for ; Wed, 09 Mar 2022 01:04:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=8eOwlkZcGQDXJozobV2VKRCePhnXpJDnIKdIuSxdQwY=; b=N2Xh2qucBX2GYfiyq4bEs9P8OFsv0znSPjK/pS3vVt+el9pUoJS1IHvAqm2tjuU3k5 32SEAYOLPZY0t2/mwZIXJ4zEhwQ6zO2DkwHzJTD/0W527Qsa1gm9tRyk/JZXUML6iTbp pbblMHQy81kQJcu6AuULnE4pMUmT42DKTuhTOQdTLdmyyeScFgAJU9SmpC7/Un/HdU9S f9hzygNICwTowTVhv+U7n+GBqCcMRAgYz6I9WxHAw2tTnJ8rTzekawysFlHHMt98/Q6G n/Rthqnv0WNN1qo1o04v+CXTC+UbLImqlCWZjypsFYyijpzlpAIbyUkROokNcO7WJt6L UvcQ== X-Gm-Message-State: AOAM532fnKSuKX24x1hQ4vTkd4yeeu7wzmuR0duBiJdULvUAd32m4uBZ sb6omahUevGufHouaCD0PcvJa0zdPRc5aN4bT98HklMPQHGN02TiXEcgPQ3vSWMhvqRinMzV1ft xBYjLdRhdHvI4F0pO4v5BOg== X-Received: by 2002:a62:1881:0:b0:4e0:1b4c:36f8 with SMTP id 123-20020a621881000000b004e01b4c36f8mr22643960pfy.26.1646816668188; Wed, 09 Mar 2022 01:04:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUnje7NyiCBB5gGNjdXAqLUtIZXfE6NBoxWfMgYiTY4JFlOMy5UMt3jQvXKvTlc37/MUAVcA== X-Received: by 2002:a62:1881:0:b0:4e0:1b4c:36f8 with SMTP id 123-20020a621881000000b004e01b4c36f8mr22643942pfy.26.1646816667945; Wed, 09 Mar 2022 01:04:27 -0800 (PST) Received: from [10.72.12.183] ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id d25-20020a639919000000b00364f999aed5sm1614910pge.20.2022.03.09.01.04.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Mar 2022 01:04:27 -0800 (PST) Message-ID: Date: Wed, 9 Mar 2022 17:04:12 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v7 21/26] virtio: add helper virtio_find_vqs_ctx_size() Content-Language: en-US To: Xuan Zhuo , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org Cc: Jeff Dike , Richard Weinberger , Anton Ivanov , "Michael S. Tsirkin" , "David S. Miller" , Jakub Kicinski , Hans de Goede , Mark Gross , Vadim Pasternak , Bjorn Andersson , Mathieu Poirier , Cornelia Huck , Halil Pasic , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Alexander Gordeev , Sven Schnelle , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Johannes Berg , Vincent Whitchurch , 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, bpf@vger.kernel.org References: <20220308123518.33800-1-xuanzhuo@linux.alibaba.com> <20220308123518.33800-22-xuanzhuo@linux.alibaba.com> From: Jason Wang In-Reply-To: <20220308123518.33800-22-xuanzhuo@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org 在 2022/3/8 下午8:35, Xuan Zhuo 写道: > Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify > the maximum size of each vq ring. > > Signed-off-by: Xuan Zhuo > --- > include/linux/virtio_config.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h > index 5157524d8036..921d8610db0c 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -233,6 +233,18 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev, unsigned nvqs, > desc, NULL); > } > > +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[], > + const bool *ctx, struct irq_affinity *desc, > + u32 sizes[]) > +{ > + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, > + desc, sizes); > +} Do we need to convert all the open coded direct call to find_vqs() other than net? Thanks > + > /** > * virtio_reset_vq - reset a queue individually > * @vq: the virtqueue