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 6BA2EA00BE; Wed, 29 Apr 2020 09:28:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 063F41D8FC; Wed, 29 Apr 2020 09:28:29 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D111E1D8F5 for ; Wed, 29 Apr 2020 09:28:27 +0200 (CEST) IronPort-SDR: Rw2M+hWNUCiFeGbNd0STwqp+8k7JCm1QRUo8FAxJBmfPzZH2rkatKZu0bOzIi8PzNNFsAOE9GC a15Ac08B/HBQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 00:28:26 -0700 IronPort-SDR: K9yZws9CNDXcbngMsOW0Np1AQ20KJLG5Dc+ALgMOi8PV3T1kZB3rSQEruiLcX2locZhdXrejl0 mYVXuw2Hb0eg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,330,1583222400"; d="scan'208";a="282415069" Received: from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.56]) by fmsmga004.fm.intel.com with ESMTP; 29 Apr 2020 00:28:25 -0700 From: Marvin Liu To: maxime.coquelin@redhat.com, xiaolong.ye@intel.com, zhihong.wang@intel.com Cc: dev@dpdk.org, Marvin Liu Date: Wed, 29 Apr 2020 15:28:13 +0800 Message-Id: <20200429072822.102745-1-yong.liu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200313174230.74661-1-yong.liu@intel.com> References: <20200313174230.74661-1-yong.liu@intel.com> Subject: [dpdk-dev] [PATCH v12 0/9] add packed ring vectorized path 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" This patch set introduced vectorized path for packed ring. The size of packed ring descriptor is 16Bytes. Four batched descriptors are just placed into one cacheline. AVX512 instructions can well handle this kind of data. Packed ring TX path can fully transformed into vectorized path. Packed ring Rx path can be vectorized when requirements met(LRO and mergeable disabled). New device parameter "vectorized" will be introduced in this patch set. This parameter will be workable for both virtio device and virtio user vdev. It will also unify split and packed ring vectorized path default setting. Path election logic will check dependencies of vectorized path. Packed ring vectorized path is dependent on building/running environment and features like IN_ORDER and VERSION_1 enabled, MRG and LRO disabled. If vectorized path is not supported, will fallback to normal path. v12: * eliminate weak symbols in data path * remove desc extra padding which can impact normal path * fix enqueue address invalid v11: * fix i686 build warnings * fix typo in doc v10: * reuse packed ring xmit cleanup v9: * replace RTE_LIBRTE_VIRTIO_INC_VECTOR with vectorized devarg * reorder patch sequence v8: * fix meson build error on ubuntu16.04 and suse15 v7: * default vectorization is disabled * compilation time check dependency on rte_mbuf structure * offsets are calcuated when compiling * remove useless barrier as descs are batched store&load * vindex of scatter is directly set * some comments updates * enable vectorized path in meson build v6: * fix issue when size not power of 2 v5: * remove cpuflags definition as required extensions always come with AVX512F on x86_64 * inorder actions should depend on feature bit * check ring type in rx queue setup * rewrite some commit logs * fix some checkpatch warnings v4: * rename 'packed_vec' to 'vectorized', also used in split ring * add RTE_LIBRTE_VIRTIO_INC_VECTOR config for virtio ethdev * check required AVX512 extensions cpuflags * combine split and packed ring datapath selection logic * remove limitation that size must power of two * clear 12Bytes virtio_net_hdr v3: * remove virtio_net_hdr array for better performance * disable 'packed_vec' by default v2: * more function blocks replaced by vector instructions * clean virtio_net_hdr by vector instruction * allow header room size change * add 'packed_vec' option in virtio_user vdev * fix build not check whether AVX512 enabled * doc update Tested-by: Wang, Yinan Marvin Liu (9): net/virtio: add Rx free threshold setting net/virtio: inorder should depend on feature bit net/virtio: add vectorized devarg net/virtio-user: add vectorized devarg net/virtio: reuse packed ring functions net/virtio: add vectorized packed ring Rx path net/virtio: add vectorized packed ring Tx path net/virtio: add election for vectorized path doc: add packed vectorized path doc/guides/nics/virtio.rst | 52 +- drivers/net/virtio/Makefile | 35 ++ drivers/net/virtio/meson.build | 14 + drivers/net/virtio/virtio_ethdev.c | 142 ++++- drivers/net/virtio/virtio_ethdev.h | 6 + drivers/net/virtio/virtio_pci.h | 3 +- drivers/net/virtio/virtio_rxtx.c | 351 ++--------- drivers/net/virtio/virtio_rxtx_packed_avx.c | 607 ++++++++++++++++++++ drivers/net/virtio/virtio_user_ethdev.c | 32 +- drivers/net/virtio/virtqueue.c | 7 +- drivers/net/virtio/virtqueue.h | 304 ++++++++++ 11 files changed, 1199 insertions(+), 354 deletions(-) create mode 100644 drivers/net/virtio/virtio_rxtx_packed_avx.c -- 2.17.1