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 5850AA04B1; Thu, 27 Aug 2020 18:15:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF40F1C12A; Thu, 27 Aug 2020 18:13:55 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 033A91C0AF for ; Thu, 27 Aug 2020 18:13:41 +0200 (CEST) IronPort-SDR: 9ifqdkBSvxbZYyB+rJizRD3ReLExqwv29OcKID/YCyDUrXCyf0W53PcULl8Aq0C7xHSHItKwwl z4PQGYl5WIEQ== X-IronPort-AV: E=McAfee;i="6000,8403,9726"; a="220767045" X-IronPort-AV: E=Sophos;i="5.76,360,1592895600"; d="scan'208";a="220767045" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2020 09:13:35 -0700 IronPort-SDR: HNCDfeQdwl10IBFFUmm50R8/a1EpQZ0WWh+rReFcZ3cLmDDx/9fmnRB+qciaJUZz3CgamNTKKP V5BiwWz/rurQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,360,1592895600"; d="scan'208";a="280681568" Received: from silpixa00399953.ir.intel.com (HELO silpixa00399953.ger.corp.intel.com) ([10.237.222.53]) by fmsmga007.fm.intel.com with ESMTP; 27 Aug 2020 09:13:33 -0700 From: Ciara Power To: dev@dpdk.org Cc: Ciara Power , Maxime Coquelin , Chenbo Xia , Zhihong Wang Date: Thu, 27 Aug 2020 17:13:00 +0100 Message-Id: <20200827161304.32300-14-ciara.power@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827161304.32300-1-ciara.power@intel.com> References: <20200807155859.63888-1-ciara.power@intel.com> <20200827161304.32300-1-ciara.power@intel.com> Subject: [dpdk-dev] [PATCH v2 13/17] net/virtio: add checks for max SIMD bitwidth 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" When choosing a vector path to take, an extra condition must be satisfied to ensure the max SIMD bitwidth allows for the CPU enabled path. Cc: Maxime Coquelin Cc: Chenbo Xia Cc: Zhihong Wang Signed-off-by: Ciara Power --- drivers/net/virtio/virtio_ethdev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index dc0093bdf0..f779ce8396 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1517,9 +1517,11 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) if (vtpci_packed_queue(hw)) { PMD_INIT_LOG(INFO, "virtio: using packed ring %s Tx path on port %u", - hw->use_vec_tx ? "vectorized" : "standard", + (hw->use_vec_tx && rte_get_max_simd_bitwidth() + > RTE_MAX_256_SIMD) ? "vectorized" : "standard", eth_dev->data->port_id); - if (hw->use_vec_tx) + if (hw->use_vec_tx && rte_get_max_simd_bitwidth() + > RTE_MAX_256_SIMD) eth_dev->tx_pkt_burst = virtio_xmit_pkts_packed_vec; else eth_dev->tx_pkt_burst = virtio_xmit_pkts_packed; @@ -1536,7 +1538,8 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) } if (vtpci_packed_queue(hw)) { - if (hw->use_vec_rx) { + if (hw->use_vec_rx && rte_get_max_simd_bitwidth() + > RTE_MAX_256_SIMD) { PMD_INIT_LOG(INFO, "virtio: using packed ring vectorized Rx path on port %u", eth_dev->data->port_id); @@ -1555,7 +1558,8 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed; } } else { - if (hw->use_vec_rx) { + if (hw->use_vec_rx && rte_get_max_simd_bitwidth() + >= RTE_MAX_128_SIMD) { PMD_INIT_LOG(INFO, "virtio: using vectorized Rx path on port %u", eth_dev->data->port_id); eth_dev->rx_pkt_burst = virtio_recv_pkts_vec; -- 2.17.1