From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70D8CA052A; Fri, 10 Jul 2020 15:41:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 67C711DE45; Fri, 10 Jul 2020 15:41:10 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 18D5C1DE39 for ; Fri, 10 Jul 2020 15:41:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594388468; 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:autocrypt:autocrypt; bh=9K39jVmTkptRteM97cmIm7B2FlzGsYpzmu/SDKugeXs=; b=YmMCh7hvFcFl7pIDymi+VRpLkRQNpoqYne6FvZ/lpLy8eiQUdczX6ax5VpSTmaPrTQctUD f497v0aa0GrYn+sFdsLPSi6QExrFcotzlWIidwr+LSgqVHGm0b/ehLb7sB46SaifNnWc7/ JkzjtDQOmxqQHRS+1P7dm9pQ/Ge8keo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-255-KlQk79h-OGWdC9bxHQsMxg-1; Fri, 10 Jul 2020 09:41:07 -0400 X-MC-Unique: KlQk79h-OGWdC9bxHQsMxg-1 Received: by mail-wr1-f71.google.com with SMTP id y16so6063098wrr.20 for ; Fri, 10 Jul 2020 06:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=9K39jVmTkptRteM97cmIm7B2FlzGsYpzmu/SDKugeXs=; b=QZnsF4k3Upa+TWAiz2CjV4NQ/LrjMUFCSso3svtm0azgiBlbcTJuBe68gQdzzskAH8 c/XJ0eoa/Qjj+CU2SGV0aKUnOTT9l5fxJKay0n1U89M5RTIwmPqaFn7xPRGtmFPglq22 nlVehNIe6LttzvuvpFXOD16v9bRQ7RDf+KRSzdU6tGKfLEtAbaj+O7kccjE60dK4ilHX uHATYEJC84prRI8CTb9yvuRbyV76u/J2CJge7KYFFMb9B6xzvp5SHgprqb1fs1nQmwiM uBRCEp3uopSyMDY68xK2qx+L/FgTZQBdUG7uMVcNnPWvHj5EAECK40yRuUlObki4ibUA Dgow== X-Gm-Message-State: AOAM53319xbyNTuGlqpIGi0c2K37vXFoV4mu+WpfN9E7vFQlQGB8fPct i1cQ5Ejfa6Y4yNvf/aQe4z0l+VlPZRr2VavZZnlrJJL1FrpqkbZmezu8bHcf3ulOJzIGkD8vxZL ppLw= X-Received: by 2002:adf:f504:: with SMTP id q4mr66778729wro.163.1594388465394; Fri, 10 Jul 2020 06:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfo79xyX4vhKLJouxPcRLlpiCQ8TAzmb9KoP3lM59gh7gXqUANL5rXita1/EdpdEFGc/kWsw== X-Received: by 2002:adf:f504:: with SMTP id q4mr66778701wro.163.1594388465192; Fri, 10 Jul 2020 06:41:05 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([92.176.159.3]) by smtp.gmail.com with ESMTPSA id c20sm12992191wrb.65.2020.07.10.06.41.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jul 2020 06:41:04 -0700 (PDT) To: Joyce Kong , maxime.coquelin@redhat.com, jerinj@marvell.com, zhihong.wang@intel.com, mb@smartsharesystems.com, xiaolong.ye@intel.com, beilei.xing@intel.com, jia.guo@intel.com, john.mcnamara@intel.com, matan@mellanox.com, shahafs@mellanox.com, viacheslavo@mellanox.com, honnappa.nagarahalli@arm.com, phil.yang@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com References: <20200611033248.39049-1-joyce.kong@arm.com> <20200710023850.43898-1-joyce.kong@arm.com> <20200710023850.43898-4-joyce.kong@arm.com> From: Adrian Moreno Autocrypt: addr=amorenoz@redhat.com; prefer-encrypt=mutual; keydata= mQENBF1syNUBCADQ9dk3fDMxOZ/+OQpmbanpodYxEv8IRtDz8PXw8YX7UyGfozOpLjQ8Fftj ZxuubYNbt2QVbSgviFilFdNWu2eTnN/JaGtfhmTOLPVoakkPHZF8lbgImMoch7L0fH8wN2IM KPxQyPNlX+K9FD5brHsV1lfe1TwAxmhcvLW8yNrVq+9eDIDykxc7tH4exIqXgZroahGxMHKy c8Ti2kJka/t6pDfRaY0J+6J7I1nrn6GXXSMNA45EH8+0N/QlcXhP3rfftnoPeVmpjswzvJqY FNjf/Q5VPLx7RX0Qx+y8mMB2JcChV5Bl7D7x5EUbItj6+Sy7QfOgCtPegk9HSrBCNYaLABEB AAG0I0FkcmlhbiBNb3Jlbm8gPGFtb3Jlbm96QHJlZGhhdC5jb20+iQFUBBMBCAA+FiEEogUD gihhmbOPHy26d5C5fbYeFsUFAl1syNUCGwMFCQHhM4AFCwkIBwIGFQoJCAsCBBYCAwECHgEC F4AACgkQd5C5fbYeFsX7qwgArGHSkX+ILNcujkVzjTG4OtkpJMPFlkn/1PxSEKD0jLuzx14B COzpg/Mqj3Re/QBuOas+ci9bsUA0/2nORtmmEBvzDOJpR5FH1jaGCx8USlY4WM6QqEDNZgTw hsy9KhjFzFjMk+oo3HyItXA+Uq9yrRBTjNBGTXxezMRcMuUZ4MIAfY0IRBglL2BufiuL43jD BvTENNFLoQ/wFV7qkFWSkv+8IjTsxr7M6XUo1QLd29Hn0dvwssN579HL1+BP46i2REpzeBEG L75iVChi+YnIQQNMJ9NYarVabZx4Y1Gn8+7B/1SNArDV+IDgnYgt7E58otoV2Ap310dmtuvE VbxGpbkBDQRdbMjVAQgAqyp9oA7WDu7/Y9T4Ommt69iZx8os7shUIfdgPEy5xrcPn6qGwN1/ HQ4j8nWfBG9uuX1X0RXUZIUEtYTxtED4yaCQMTqDUf9cBAwAA2mYxBfoiNYx8YqxM+sT0/J4 2qmDd+y+20UR4yzHE8AmIbspTzDFIJDAi+jKSR8F355z0sfW7CIMDC4ZWrPsskjEy1YN/U10 r6tRRH1kNyrCSbTG0d9MtcQO58h7DLXuzUhErB+BtG52A04t5cweIJTJC+koV5XPeilzlHnm RFoj0ncruGa9Odns21BNt3cy9wLfK+aUnWuAB1uc6bJGQPiAwjkilz7g7MBRUuIQ2Zt7HGLc SwARAQABiQE8BBgBCAAmFiEEogUDgihhmbOPHy26d5C5fbYeFsUFAl1syNUCGwwFCQHhM4AA CgkQd5C5fbYeFsUlSwf8CH+u/IXaE7WeWxwFkMaORfW8cM4q0xrL3M6yRGuQNW+kMjnrvK9U J9G+L1/5uTRbDQ/4LdoKqize8LjehA+iF6ba4t9Npikh8fLKWgaJfQ/hPhH4C3O5gWPOLTW6 ylGxiuER4CdFwQIoAMMslhFA7G+teeOKBq36E+1+zrybI6Xy1UBSlpDK9j4CtTnMQejjuSQb Qhle+l8VroaUHq869wjAhRHHhqmtJKggI+OvzgQpDIwfHIDypb1BuKydi2W6cVYEALUYyCLS dTBDhzj8zR5tPCsga8J7+TclQzkWOiI2C6ZtiWrMsL/Uym3uXk5nsoc7lSj7yLd/MrBRhYfP JQ== Message-ID: Date: Fri, 10 Jul 2020 15:41:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200710023850.43898-4-joyce.kong@arm.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 3/3] lib/vhost: restrict pointer aliasing for packed vpmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 7/10/20 4:38 AM, Joyce Kong wrote: > Restrict pointer aliasing to allow the compiler to vectorize loop > more aggressively. > > With this patch, a 9.6% improvement is observed in throughput for > the packed virtio-net PVP case, and a 2.8% improvement in throughput > for the packed virtio-user PVP case. All performance data are measured > on ThunderX-2 platform under 0.001% acceptable packet loss with 1 core > on both vhost and virtio side. > > Signed-off-by: Joyce Kong > Reviewed-by: Phil Yang > --- > drivers/net/virtio/virtio_rxtx_simple_neon.c | 5 +++-- > lib/librte_vhost/virtio_net.c | 14 +++++++------- > 2 files changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c > index a9b649814..02520fda8 100644 > --- a/drivers/net/virtio/virtio_rxtx_simple_neon.c > +++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c > @@ -36,8 +36,9 @@ > * - nb_pkts < RTE_VIRTIO_DESC_PER_LOOP, just return no packet > */ > uint16_t > -virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf > - **__rte_restrict rx_pkts, uint16_t nb_pkts) > +virtio_recv_pkts_vec(void *rx_queue, > + struct rte_mbuf **__rte_restrict rx_pkts, > + uint16_t nb_pkts) > { > struct virtnet_rx *rxvq = rx_queue; > struct virtqueue *vq = rxvq->vq; > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c > index 236498f71..1d0be3dd4 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -1353,8 +1353,8 @@ virtio_dev_rx_single_packed(struct virtio_net *dev, > > static __rte_noinline uint32_t > virtio_dev_rx_packed(struct virtio_net *dev, > - struct vhost_virtqueue *vq, > - struct rte_mbuf **pkts, > + struct vhost_virtqueue *__rte_restrict vq, > + struct rte_mbuf **__rte_restrict pkts, > uint32_t count) > { > uint32_t pkt_idx = 0; > @@ -1439,7 +1439,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > > uint16_t > rte_vhost_enqueue_burst(int vid, uint16_t queue_id, > - struct rte_mbuf **pkts, uint16_t count) > + struct rte_mbuf **__rte_restrict pkts, uint16_t count) > { > struct virtio_net *dev = get_device(vid); > > @@ -2671,9 +2671,9 @@ free_zmbuf(struct vhost_virtqueue *vq) > > static __rte_noinline uint16_t > virtio_dev_tx_packed_zmbuf(struct virtio_net *dev, > - struct vhost_virtqueue *vq, > + struct vhost_virtqueue *__rte_restrict vq, > struct rte_mempool *mbuf_pool, > - struct rte_mbuf **pkts, > + struct rte_mbuf **__rte_restrict pkts, > uint32_t count) > { > uint32_t pkt_idx = 0; > @@ -2707,9 +2707,9 @@ virtio_dev_tx_packed_zmbuf(struct virtio_net *dev, > > static __rte_noinline uint16_t > virtio_dev_tx_packed(struct virtio_net *dev, > - struct vhost_virtqueue *vq, > + struct vhost_virtqueue *__rte_restrict vq, > struct rte_mempool *mbuf_pool, > - struct rte_mbuf **pkts, > + struct rte_mbuf **__rte_restrict pkts, > uint32_t count) > { > uint32_t pkt_idx = 0; > The vhost part looks good to me. Acked-by: Adrián Moreno -- Adrián Moreno