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 32C99A2E1B for ; Thu, 5 Sep 2019 10:37:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EAC1D1EF50; Thu, 5 Sep 2019 10:35:02 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C73121EE3C for ; Thu, 5 Sep 2019 10:34:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2019 01:34:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,470,1559545200"; d="scan'208";a="383781649" Received: from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142]) by fmsmga006.fm.intel.com with ESMTP; 05 Sep 2019 01:34:46 -0700 From: Marvin Liu To: tiwei.bie@intel.com, maxime.coquelin@redhat.com, dev@dpdk.org Cc: Marvin Liu Date: Fri, 6 Sep 2019 00:14:21 +0800 Message-Id: <20190905161421.55981-15-yong.liu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905161421.55981-1-yong.liu@intel.com> References: <20190905161421.55981-1-yong.liu@intel.com> Subject: [dpdk-dev] [PATCH v1 14/14] vhost: check whether disable software pre-fetch 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" Disable software pre-fetch actions on Skylake and Cascadelake platforms. Hardware can fetch needed data for vhost, additional software pre-fetch will have impact on performance. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 8623e91c0..1d1423bdc 100644 --- a/lib/librte_vhost/Makefile +++ b/lib/librte_vhost/Makefile @@ -16,6 +16,12 @@ CFLAGS += -I vhost_user CFLAGS += -fno-strict-aliasing LDLIBS += -lpthread +AVX512_SUPPORT=$(shell $(CC) -march=native -dM -E - avail->ring[vq->last_avail_idx & (vq->size - 1)]); +#endif for (pkt_idx = 0; pkt_idx < count; pkt_idx++) { uint32_t pkt_len = pkts[pkt_idx]->pkt_len + dev->vhost_hlen; @@ -1110,10 +1114,12 @@ virtio_dev_rx_burst_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, (len3 != descs[avail_idx + 3].len))) return -1; +#ifndef DISABLE_SWPREFETCH rte_prefetch0((void *)(uintptr_t)desc_addr); rte_prefetch0((void *)(uintptr_t)desc_addr1); rte_prefetch0((void *)(uintptr_t)desc_addr2); rte_prefetch0((void *)(uintptr_t)desc_addr3); +#endif hdr = (struct virtio_net_hdr_mrg_rxbuf *)(uintptr_t)desc_addr; hdr1 = (struct virtio_net_hdr_mrg_rxbuf *)(uintptr_t)desc_addr1; @@ -1687,7 +1693,9 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq, */ rte_smp_rmb(); +#ifndef DISABLE_SWPREFETCH rte_prefetch0(&vq->avail->ring[vq->last_avail_idx & (vq->size - 1)]); +#endif VHOST_LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); @@ -1872,10 +1880,12 @@ virtio_dev_tx_burst_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, if (ret) return ret; +#ifndef DISABLE_SWPREFETCH rte_prefetch0((void *)(uintptr_t)desc_addr[0]); rte_prefetch0((void *)(uintptr_t)desc_addr[1]); rte_prefetch0((void *)(uintptr_t)desc_addr[2]); rte_prefetch0((void *)(uintptr_t)desc_addr[3]); +#endif rte_memcpy(rte_pktmbuf_mtod_offset(pkts[0], void *, 0), (void *)(uintptr_t)(desc_addr[0] + buf_offset), -- 2.17.1