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 1EBCFA0350; Tue, 12 May 2020 04:27:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7CAAF1C0B6; Tue, 12 May 2020 04:27:16 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EF1071BFF5 for ; Tue, 12 May 2020 04:27:14 +0200 (CEST) IronPort-SDR: XTd7FyP2FQpV9T/KImo3x0lDPk9kAHdPMnsiUMHBNDPVOhbuxGvcuY+LrvlfOuA1oOegahoxSP o+LFmqdc7Peg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 19:27:13 -0700 IronPort-SDR: LZ6QgiprQCJJ9lWPSzfzDQW6twKi5ewT3Apji9Nx5UavN0vnxAJz0fZX2iefnZ4D1G3LOK9k54 /TDBXMXi9XZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,381,1583222400"; d="scan'208";a="409133839" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 11 May 2020 19:27:13 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 11 May 2020 19:27:13 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 11 May 2020 19:27:12 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.26]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.95]) with mapi id 14.03.0439.000; Tue, 12 May 2020 10:27:10 +0800 From: "Liu, Yong" To: Maxime Coquelin CC: "Ye, Xiaolong" , "Yigit, Ferruh" , "dev@dpdk.org" Thread-Topic: [PATCH] net/virtio: fix AVX512 datapath selection Thread-Index: AQHWJ6Mdg1qgwHl7IESz5oW71pFcZKijuCtA Date: Tue, 12 May 2020 02:27:10 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E6358BE28@SHSMSX103.ccr.corp.intel.com> References: <20200511144720.241224-1-maxime.coquelin@redhat.com> In-Reply-To: <20200511144720.241224-1-maxime.coquelin@redhat.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] net/virtio: fix AVX512 datapath selection 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: Maxime Coquelin > Sent: Monday, May 11, 2020 10:47 PM > To: Liu, Yong ; Ye, Xiaolong ; > Yigit, Ferruh ; dev@dpdk.org > Cc: Maxime Coquelin > Subject: [PATCH] net/virtio: fix AVX512 datapath selection >=20 > The AVX512 packed ring datapath selection was only done > at build time, but it should also be checked at runtime > that the CPU supports it. >=20 > This patch add a CPU flags check so that non-vectorized > path is selected at runtime if AVX512 is not supported. >=20 > Fixes: ccb10995c2ad ("net/virtio: add election for vectorized path") >=20 > Signed-off-by: Maxime Coquelin > --- > drivers/net/virtio/virtio_ethdev.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c > b/drivers/net/virtio/virtio_ethdev.c > index 312871cb48..49ccef12c7 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1965,8 +1965,10 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > PMD_DRV_LOG(INFO, > "building environment do not support > packed ring vectorized"); > #else > - hw->use_vec_rx =3D 1; > - hw->use_vec_tx =3D 1; > + if > (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F)) { > + hw->use_vec_rx =3D 1; > + hw->use_vec_tx =3D 1; > + } > #endif Hi Maxime, Here is pre-setting for vectorized path selection, virtio_dev_configure wil= l do second time check.=20 Running environment will be checked in second time check. We can move some= checks from virtio_dev_configure to here, but is it needed to do that? BTW, both split ring and packed ring will utilized this setting, it will br= eak split vectorized datapath is server not has AVX512F flag. And it may cause building issue on those platforms which not defined RTE_CP= UFLAG_AVX512F. Thanks, Marvin > } > } > -- > 2.25.4