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 CEE79A0597; Wed, 8 Apr 2020 09:31:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 379261BFD1; Wed, 8 Apr 2020 09:31:24 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9809B1BFC6 for ; Wed, 8 Apr 2020 09:31:22 +0200 (CEST) IronPort-SDR: bkz7fEvdsHCdDDqzPnLbXkTrFDvGERmP6KAIRHSf1saUBWn222Y7g1MBIaWAWtM96A4hx5rcBp BGh4d8lla/+g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2020 00:31:21 -0700 IronPort-SDR: wAKo7JKEDYbAoq0ChQ1MjenM4vZ6jBqHtcDiNUp3GdR+2nZWPt0tRSmt9yLAzR8wZ5JSgn3lp9 lbx2B2FkG2AA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,357,1580803200"; d="scan'208";a="251486439" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 08 Apr 2020 00:31:20 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 8 Apr 2020 00:31:16 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 8 Apr 2020 00:31:15 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 8 Apr 2020 00:31:15 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.146]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.214]) with mapi id 14.03.0439.000; Wed, 8 Apr 2020 15:31:12 +0800 From: "Liu, Yong" To: "Ye, Xiaolong" CC: "maxime.coquelin@redhat.com" , "Wang, Zhihong" , "Van Haaren, Harry" , "dev@dpdk.org" Thread-Topic: [PATCH v3 2/7] net/virtio-user: add vectorized packed ring parameter Thread-Index: AQHWDUOTbfQKkvGbTkyJeONLh/gEqahuO48AgACZHPA= Date: Wed, 8 Apr 2020 07:31:12 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E6352B7B0@SHSMSX103.ccr.corp.intel.com> References: <20200313174230.74661-1-yong.liu@intel.com> <20200408085313.4487-1-yong.liu@intel.com> <20200408085313.4487-3-yong.liu@intel.com> <20200408062238.GC114503@intel.com> In-Reply-To: <20200408062238.GC114503@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 2/7] net/virtio-user: add vectorized packed ring parameter 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" > -----Original Message----- > From: Ye, Xiaolong > Sent: Wednesday, April 8, 2020 2:23 PM > To: Liu, Yong > Cc: maxime.coquelin@redhat.com; Wang, Zhihong > ; Van Haaren, Harry > ; dev@dpdk.org > Subject: Re: [PATCH v3 2/7] net/virtio-user: add vectorized packed ring > parameter >=20 > On 04/08, Marvin Liu wrote: > >Add new parameter "packed_vec" which can disable vectorized packed > ring > >datapath explicitly. When "packed_vec" option is on, driver will check > >packed ring vectorized datapath prerequisites. If any one of them not > >matched, vectorized datapath won't be selected. > > > >Signed-off-by: Marvin Liu > > > >diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio= _pci.h > >index 7433d2f08..8103b7a18 100644 > >--- a/drivers/net/virtio/virtio_pci.h > >+++ b/drivers/net/virtio/virtio_pci.h > >@@ -251,6 +251,8 @@ struct virtio_hw { > > uint8_t use_msix; > > uint8_t modern; > > uint8_t use_simple_rx; > >+ uint8_t packed_vec_rx; > >+ uint8_t packed_vec_tx; > > uint8_t use_inorder_rx; > > uint8_t use_inorder_tx; > > uint8_t weak_barriers; > >diff --git a/drivers/net/virtio/virtio_user_ethdev.c > b/drivers/net/virtio/virtio_user_ethdev.c > >index e61af4068..399ac5511 100644 > >--- a/drivers/net/virtio/virtio_user_ethdev.c > >+++ b/drivers/net/virtio/virtio_user_ethdev.c > >@@ -450,6 +450,8 @@ static const char *valid_args[] =3D { > > VIRTIO_USER_ARG_IN_ORDER, > > #define VIRTIO_USER_ARG_PACKED_VQ "packed_vq" > > VIRTIO_USER_ARG_PACKED_VQ, > >+#define VIRTIO_USER_ARG_PACKED_VEC "packed_vec" > >+ VIRTIO_USER_ARG_PACKED_VEC, > > NULL > > }; > > > >@@ -552,6 +554,8 @@ virtio_user_pmd_probe(struct rte_vdev_device > *dev) > > uint64_t mrg_rxbuf =3D 1; > > uint64_t in_order =3D 1; > > uint64_t packed_vq =3D 0; > >+ uint64_t packed_vec =3D 0; > >+ > > char *path =3D NULL; > > char *ifname =3D NULL; > > char *mac_addr =3D NULL; > >@@ -668,6 +672,15 @@ virtio_user_pmd_probe(struct rte_vdev_device > *dev) > > } > > } > > > >+ if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PACKED_VEC) =3D=3D 1) { > >+ if (rte_kvargs_process(kvlist, > VIRTIO_USER_ARG_PACKED_VEC, > >+ &get_integer_arg, &packed_vec) < 0) { > >+ PMD_INIT_LOG(ERR, "error to parse %s", > >+ VIRTIO_USER_ARG_PACKED_VQ); > >+ goto end; > >+ } > >+ } > >+ > > if (queues > 1 && cq =3D=3D 0) { > > PMD_INIT_LOG(ERR, "multi-q requires ctrl-q"); > > goto end; > >@@ -705,6 +718,17 @@ virtio_user_pmd_probe(struct rte_vdev_device > *dev) > > } > > > > hw =3D eth_dev->data->dev_private; > >+#if defined(RTE_ARCH_X86) && defined(CC_AVX512_SUPPORT) > >+ if (packed_vec) { > >+ hw->packed_vec_rx =3D 1; > >+ hw->packed_vec_tx =3D 1; > >+ } > >+#else > >+ if (packed_vec) > >+ PMD_INIT_LOG(ERR, "building environment not match > vectorized " > >+ "packed ring datapath requirement"); >=20 > Minor nit: >=20 > s/not match/doesn't match/ >=20 > And better to avoid breaking error message strings across multiple source > lines. > It makes it harder to use tools like grep to find errors in source. > E.g. user uses "vectorized packed ring datapath" to grep the code. >=20 > Thanks, > Xiaolong >=20 Thanks for remind. Will change in next release. > >+#endif > >+ > > if (virtio_user_dev_init(hw->virtio_user_dev, path, queues, cq, > > queue_size, mac_addr, &ifname, server_mode, > > mrg_rxbuf, in_order, packed_vq) < 0) { > >@@ -777,4 +801,5 @@ > RTE_PMD_REGISTER_PARAM_STRING(net_virtio_user, > > "server=3D<0|1> " > > "mrg_rxbuf=3D<0|1> " > > "in_order=3D<0|1> " > >- "packed_vq=3D<0|1>"); > >+ "packed_vq=3D<0|1>" > >+ "packed_vec=3D<0|1>"); > >-- > >2.17.1 > >