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 2309FC04A68 for ; Thu, 28 Jul 2022 02:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234523AbiG1Cgq (ORCPT ); Wed, 27 Jul 2022 22:36:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237345AbiG1Cgp (ORCPT ); Wed, 27 Jul 2022 22:36:45 -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 BE0175A889 for ; Wed, 27 Jul 2022 19:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658975802; 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=JKkkMBWIpIIe2oTOsj/mSHWBLF5WPUCRKemqNyKpd7k=; b=Wkg6j8HuZwnu7rickQIt00fDEB72bSRSV+FXPTZe6VkFAZk7M1subYKOMXYF15vqTWdGDh 9DOTt/fsVZeLG1zUpZUNJi8SzuJOAES3c1agBqbaX1OgNaHolBgW3NgCnG57XpOuJKhS8Y XeD0tvQF55sEwJGg3jGwjOo53yGs8eY= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-5gRVOM5vNfG-99FttR5wsg-1; Wed, 27 Jul 2022 22:36:41 -0400 X-MC-Unique: 5gRVOM5vNfG-99FttR5wsg-1 Received: by mail-ej1-f71.google.com with SMTP id hr24-20020a1709073f9800b0072b57c28438so125831ejc.5 for ; Wed, 27 Jul 2022 19:36:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=JKkkMBWIpIIe2oTOsj/mSHWBLF5WPUCRKemqNyKpd7k=; b=xj3pk6yk+mXlbVrxn+KM0IO8x6FDkjquofOVtIW35aPd1Kj3xuoepheGLjjMbco+Br tpThRqmyvVgdvCBSOgruIX5rWWZRWrPlZjvh/ljtBfzfKv+yiAkR4UhT3BmSRk+4rmWb hC6LUs/AsKY2+Xc+Igv4eLjf+PzAbJfrbCZUWy1CiN18Hedlnw2I8inGXRMDIDKmxVUl jJZ/m9os+tj+m0/TH8fbbw8f4n5KfUpmf4bpkA+iuDecEGIsxrAlt8XJ1oyunnFtBOW1 zSKt38XDDwsuuuC+qawvPIwMoOaLUd99nHCTR66mBDBc03MRLPCfK1X41ZNlL9ZDWU06 g50g== X-Gm-Message-State: AJIora8AZ+wSdIHXob238f3rKy4wJczpZvgYuDE1L7x0dMNaw289P3ZP ajgP+t5HC91xfnNAgE13BtBNxqt8tsYDvqI6u0b+2k67tTWTmzQHDpVKUgp0NYVSTAuEeBs3tmw fDHiwjhSYwcQZwifGLMiLZhmJ+j+Nqicq4KP2f6V4RdLX4IL1tw== X-Received: by 2002:a17:907:a063:b0:72b:52f7:feea with SMTP id ia3-20020a170907a06300b0072b52f7feeamr20017155ejc.740.1658975799930; Wed, 27 Jul 2022 19:36:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGPEobsHGsN+6u62z1/vXP5Tu4y+DTY3UAmlLElWTmVhegB4KOwUXCDIsRewcmE149sdCA2s8SYedOFlVJtFU= X-Received: by 2002:a17:907:a063:b0:72b:52f7:feea with SMTP id ia3-20020a170907a06300b0072b52f7feeamr20017130ejc.740.1658975799433; Wed, 27 Jul 2022 19:36:39 -0700 (PDT) MIME-Version: 1.0 References: <20220726072225.19884-1-xuanzhuo@linux.alibaba.com> <20220726072225.19884-8-xuanzhuo@linux.alibaba.com> <1658907340.34387-1-xuanzhuo@linux.alibaba.com> In-Reply-To: <1658907340.34387-1-xuanzhuo@linux.alibaba.com> From: Jason Wang Date: Thu, 28 Jul 2022 10:36:28 +0800 Message-ID: Subject: Re: [PATCH v13 07/42] virtio_ring: split: stop __vring_new_virtqueue as export symbol To: Xuan Zhuo Cc: Richard Weinberger , Anton Ivanov , Johannes Berg , "Michael S. Tsirkin" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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 , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Vincent Whitchurch , linux-um@lists.infradead.org, netdev , platform-driver-x86@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, kvm , "open list:XDP (eXpress Data Path)" , Kangjie Xu , virtualization Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org On Wed, Jul 27, 2022 at 3:36 PM Xuan Zhuo wrot= e: > > On Wed, 27 Jul 2022 10:58:05 +0800, Jason Wang wrot= e: > > > > =E5=9C=A8 2022/7/26 15:21, Xuan Zhuo =E5=86=99=E9=81=93: > > > There is currently only one place to reference __vring_new_virtqueue(= ) > > > directly from the outside of virtio core. And here vring_new_virtqueu= e() > > > can be used instead. > > > > > > Subsequent patches will modify __vring_new_virtqueue, so stop it as a= n > > > export symbol for now. > > > > > > Signed-off-by: Xuan Zhuo > > > --- > > > drivers/virtio/virtio_ring.c | 25 ++++++++++++++++--------- > > > include/linux/virtio_ring.h | 10 ---------- > > > tools/virtio/virtio_test.c | 4 ++-- > > > 3 files changed, 18 insertions(+), 21 deletions(-) > > > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_rin= g.c > > > index 0ad35eca0d39..4e54ed7ee7fb 100644 > > > --- a/drivers/virtio/virtio_ring.c > > > +++ b/drivers/virtio/virtio_ring.c > > > @@ -204,6 +204,14 @@ struct vring_virtqueue { > > > #endif > > > }; > > > > > > +static struct virtqueue *__vring_new_virtqueue(unsigned int index, > > > + struct vring vring, > > > + struct virtio_device *vdev= , > > > + bool weak_barriers, > > > + bool context, > > > + bool (*notify)(struct virt= queue *), > > > + void (*callback)(struct vi= rtqueue *), > > > + const char *name); > > > > > > /* > > > * Helpers. > > > @@ -2197,14 +2205,14 @@ irqreturn_t vring_interrupt(int irq, void *_v= q) > > > EXPORT_SYMBOL_GPL(vring_interrupt); > > > > > > /* Only available for split ring */ > > > -struct virtqueue *__vring_new_virtqueue(unsigned int index, > > > - struct vring vring, > > > - struct virtio_device *vdev, > > > - bool weak_barriers, > > > - bool context, > > > - bool (*notify)(struct virtqueue *= ), > > > - void (*callback)(struct virtqueue= *), > > > - const char *name) > > > +static struct virtqueue *__vring_new_virtqueue(unsigned int index, > > > + struct vring vring, > > > + struct virtio_device *vdev= , > > > + bool weak_barriers, > > > + bool context, > > > + bool (*notify)(struct virt= queue *), > > > + void (*callback)(struct vi= rtqueue *), > > > + const char *name) > > > { > > > struct vring_virtqueue *vq; > > > > > > @@ -2272,7 +2280,6 @@ struct virtqueue *__vring_new_virtqueue(unsigne= d int index, > > > kfree(vq); > > > return NULL; > > > } > > > -EXPORT_SYMBOL_GPL(__vring_new_virtqueue); > > > > > > struct virtqueue *vring_create_virtqueue( > > > unsigned int index, > > > diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.= h > > > index b485b13fa50b..8b8af1a38991 100644 > > > --- a/include/linux/virtio_ring.h > > > +++ b/include/linux/virtio_ring.h > > > @@ -76,16 +76,6 @@ struct virtqueue *vring_create_virtqueue(unsigned = int index, > > > void (*callback)(struct virtqueu= e *vq), > > > const char *name); > > > > > > -/* Creates a virtqueue with a custom layout. */ > > > -struct virtqueue *__vring_new_virtqueue(unsigned int index, > > > - struct vring vring, > > > - struct virtio_device *vdev, > > > - bool weak_barriers, > > > - bool ctx, > > > - bool (*notify)(struct virtqueue *= ), > > > - void (*callback)(struct virtqueue= *), > > > - const char *name); > > > - > > > /* > > > * Creates a virtqueue with a standard layout but a caller-allocate= d > > > * ring. > > > diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c > > > index 23f142af544a..86a410ddcedd 100644 > > > --- a/tools/virtio/virtio_test.c > > > +++ b/tools/virtio/virtio_test.c > > > @@ -102,8 +102,8 @@ static void vq_reset(struct vq_info *info, int nu= m, struct virtio_device *vdev) > > > > > > memset(info->ring, 0, vring_size(num, 4096)); > > > vring_init(&info->vring, num, info->ring, 4096); > > > > > > Let's remove the duplicated vring_init() here. > > > > With this removed: > > The reason I didn't delete this vring_init() is because info->vring is us= ed > elsewhere. So it can't be deleted directly. Ok, so we can leave it for future refactoring. Acked-by: Jason Wang Thanks > > Thanks. > > > > > Acked-by: Jason Wang > > > > > > > - info->vq =3D __vring_new_virtqueue(info->idx, info->vring, vdev, = true, > > > - false, vq_notify, vq_callback, "= test"); > > > + info->vq =3D vring_new_virtqueue(info->idx, num, 4096, vdev, true= , false, > > > + info->ring, vq_notify, vq_callback= , "test"); > > > assert(info->vq); > > > info->vq->priv =3D info; > > > } > > >