From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2782A0546; Tue, 25 May 2021 08:58:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E8954003F; Tue, 25 May 2021 08:58:35 +0200 (CEST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 3D6354003E for ; Tue, 25 May 2021 08:58:34 +0200 (CEST) Received: by mail-wr1-f44.google.com with SMTP id q5so30904341wrs.4 for ; Mon, 24 May 2021 23:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=sZcuA3QXPbDeIIW46XpoiRL90yDQfOggb0WhubDkB9g=; b=GLdT/ppcesXbpg6IYNuFs52Bq8VY4qvHADskyH2ICk2pQyIs/Z/Ku6KRYNhfHx+l5Q CwrW9mLCgLto15nLTOpLC5thuAfijfmf26muEbUxuXS8FFihBTybDfUq6eBL6UOZIPJm j5vbC3+O/xJzhmJ4sfcxgvOpXGv6/W7uRSByQXhOCUR+C+jZp5BBTaKigW5R7eUOPPPL 5xNWvDfGAlSpSId1MuSiWBVZ1BvGCpfuk3bloPDS/NTjclXeckybll9IfKQb5nLn9HXh lCkzM9lDGwl3ihOVEyhrWzhcmqFdUCrRsowKz2HvQXsIxtc1O3l4rot9zHBqyrGJhp9E g0aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sZcuA3QXPbDeIIW46XpoiRL90yDQfOggb0WhubDkB9g=; b=nr/xeOMgxKr8tsvTi68ygoEMhx7UlUr5D15nQbtsvSu408sLCTjWCVpyg+0zT5OuQS 6DZdfr/zZ8yDBsiLU2tsZRX7eRHSEWnoJX1JmLVST+jGYgKLE3Riv7EBT0tHLZYaOX5u h3+mKwhJfNGyDTzrSNiwCOWEb5g8uLEFd5eMYaitdlWLarvnjASHkcmsn7ovamGJiu1x E14ZtlxtTf5A4D8iI5wUrigGwRZLD7ICByL32/eSsx3J2Xfjqe68ZYHrdpmgsYJmv8mG fuEikiimmVResRTmTnTtI58Wxyqvc7bs7dmtrA48LiWJ4jlFXOD2PBPLvtGwVJOarGUu M6Uw== X-Gm-Message-State: AOAM533BEwMYJRa7AOrX2k0K3b3xBEFIklJdLkLD3/mVv5Oj272gidE7 qhJiT9F1HWNKcWAGIvyQIpd7A/kvfPJ+CsRFsaU= X-Google-Smtp-Source: ABdhPJwBXkRageJM3I4tZccW6/aCsQ0MK+JiISHt8AK70UO7T5NhvVxSO4P6NWS9UK4Ak69BhZHWPQ== X-Received: by 2002:a5d:6484:: with SMTP id o4mr24855891wri.8.1621925913632; Mon, 24 May 2021 23:58:33 -0700 (PDT) Received: from localhost.localdomain (115-186-141-82.nayatel.pk. [115.186.141.82]) by smtp.gmail.com with ESMTPSA id g66sm9822475wma.11.2021.05.24.23.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 23:58:33 -0700 (PDT) From: Muhammad Ahmad To: dev@dpdk.org Cc: ferruh.yigit@intel.com, qi.z.zhang@intel.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, jia.guo@intel.com, beilei.xing@intel.com, Muhammad Ahmad Date: Tue, 25 May 2021 11:58:18 +0500 Message-Id: <20210525065818.10379-1-muhammad.ahmad@emumba.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [RFC] Add selection between vector and scalar mode in ixgbe X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" The selection between scalar mode and vector mode was removed for ixgbe driver in DPDK 20.02. The code base still has code for scalar mode but it cannot be selected at compile time. The vector mode is adequate for applications which require high throughput which is the case most of the time, but scalar mode has a use case in ultra-low-latency fintech applications for algorithmic trading. This use case was also presented at the DPDK userspace summit in September 2020. This patch enables the ability to select between scalar and vector modes for ixgbe drivers in the config. In the future we can introduce API in ehtdev, which allow user to select between latency and throughput mode. Signed-off-by: Muhammad Ahmad --- config/rte_config.h | 3 +++ drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/rte_config.h b/config/rte_config.h index 8aa46a1aa..cc30f7f39 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -121,6 +121,9 @@ /* hns3 defines */ #define RTE_LIBRTE_HNS3_MAX_TQP_NUM_PER_PF 256 +/*ixgbe defines*/ +#define RTE_IXGBE_SCALAR_ENABLE 0 + /* i40e defines */ #define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 1 #undef RTE_LIBRTE_I40E_16BYTE_RX_DESC diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 00101c2ee..c992dc7e5 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -84,7 +84,7 @@ #define IXGBE_DEFAULT_RX_WTHRESH 0 #define IXGBE_DEFAULT_TX_FREE_THRESH 32 #define IXGBE_DEFAULT_TX_PTHRESH 32 #define IXGBE_DEFAULT_TX_HTHRESH 0 #define IXGBE_DEFAULT_TX_WTHRESH 0 #define IXGBE_DEFAULT_TX_RSBIT_THRESH 32 @@ -2415,6 +2415,12 @@ ixgbe_dev_configure(struct rte_eth_dev *dev) */ adapter->rx_bulk_alloc_allowed = true; adapter->rx_vec_allowed = true; + + #if RTE_IXGBE_SCALAR_ENABLE == 1 + adapter->rx_vec_allowed = false; + #endif return 0; } @@ -9121,3 +9127,4 @@ RTE_LOG_REGISTER(ixgbe_logtype_tx, pmd.net.ixgbe.tx, DEBUG); #ifdef RTE_LIBRTE_IXGBE_DEBUG_TX_FREE RTE_LOG_REGISTER(ixgbe_logtype_tx_free, pmd.net.ixgbe.tx_free, DEBUG); #endif + -- 2.17.1