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 E71C5A0567; Tue, 9 Mar 2021 17:33:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4BFE22A4F4; Tue, 9 Mar 2021 17:33:54 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id BBDBA4068A for ; Tue, 9 Mar 2021 17:33:53 +0100 (CET) IronPort-SDR: CPw85xOn7laes3epsdgRYn8vl2rlDZHdTVckideVHIdOtgjBlwCJYGSEO7ko0d1nSgwzIa0rSp /B0Vi80MN4vw== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="167544907" X-IronPort-AV: E=Sophos;i="5.81,234,1610438400"; d="scan'208";a="167544907" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2021 08:33:50 -0800 IronPort-SDR: 9UTiOeDgW6uI1nackGp/Z/8OlbkMQ5HtazpBv/NLXMTfmJRxPkqTYYUUL71zs8awMVnheip68x AHlbw7X+uaDA== X-IronPort-AV: E=Sophos;i="5.81,234,1610438400"; d="scan'208";a="409803252" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.196.3]) ([10.213.196.3]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2021 08:33:47 -0800 To: Ciara Loftus , dev@dpdk.org References: <20210224111852.11947-1-ciara.loftus@intel.com> <20210309101958.27355-1-ciara.loftus@intel.com> <20210309101958.27355-2-ciara.loftus@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Tue, 9 Mar 2021 16:33:45 +0000 MIME-Version: 1.0 In-Reply-To: <20210309101958.27355-2-ciara.loftus@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 1/3] net/af_xdp: allow bigger batch sizes 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" On 3/9/2021 10:19 AM, Ciara Loftus wrote: > Prior to this commit, the maximum batch sizes for zero-copy and copy-mode > rx and copy-mode tx were set to 32. Apart from zero-copy tx, the user > could never rx/tx any more than 32 packets at a time and without inspecting > the code the user wouldn't be aware of this. > > This commit removes these upper limits placed on the user and instead > sets an internal batch size equal to the default ring size (2048). Batches > larger than this are still processed, however they are split into smaller > batches similar to how it's done in other drivers. This is necessary > because some arrays used during rx/tx need to be sized at compile-time. > > Allowing a larger batch size allows for fewer batches and thus larger bulk > operations, fewer ring accesses and fewer syscalls which should yield > improved performance. > > Signed-off-by: Ciara Loftus > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 67 ++++++++++++++++++++++++----- > 1 file changed, 57 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 3957227bf0..be524e4784 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -66,8 +66,8 @@ RTE_LOG_REGISTER(af_xdp_logtype, pmd.net.af_xdp, NOTICE); > #define ETH_AF_XDP_DFLT_START_QUEUE_IDX 0 > #define ETH_AF_XDP_DFLT_QUEUE_COUNT 1 > > -#define ETH_AF_XDP_RX_BATCH_SIZE 32 > -#define ETH_AF_XDP_TX_BATCH_SIZE 32 > +#define ETH_AF_XDP_RX_BATCH_SIZE XSK_RING_CONS__DEFAULT_NUM_DESCS > +#define ETH_AF_XDP_TX_BATCH_SIZE XSK_RING_CONS__DEFAULT_NUM_DESCS > Just to double check, can there be a library version that these macros not defined, should it be checked?