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 9A440423C1; Fri, 13 Jan 2023 10:17:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF98742E33; Fri, 13 Jan 2023 10:15:38 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 8D94742E0E for ; Fri, 13 Jan 2023 10:15:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673601331; x=1705137331; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gWsNORfZP/Q+u8l2Gxcm8tCVbu7jQbVTDG6QYPk0mqc=; b=M/WTBUhjBIVHsVfJ2ecYy3t3GWQFiPyGrQDWYSQ9TGYm6k0kgbnRQI1n eSOaH7V/BH9FA00hdB+OoONBfkJSqr+jM6scgHQ0vn8oxyWL1nNV1qmzS O+cAjFksgsJsMK0+nU3aYC9zXJX9Aewql64rA8ztiSjbmMe8H13+2rK7e 8DCWtNYEK2/YR8IWs+f5WasK+AFfa/KufJWSImDz8nnaDXMW5cdKayS15 uPWYnWQucFBAFVPN0mhsEGWFg/llJOxTYPN/4GBB2TObURakri/TiaELB ZzNNIARwGu+IRZsS92yH65W7guD5Zh5oLiCChgzuh+uXUKYK1k+9mKSrf w==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="304332597" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="304332597" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 01:15:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="903522836" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="903522836" Received: from dpdk-mingxial-01.sh.intel.com ([10.67.119.167]) by fmsmga006.fm.intel.com with ESMTP; 13 Jan 2023 01:15:29 -0800 From: Mingxia Liu To: dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: wenjun1.wu@intel.com, Mingxia Liu Subject: [PATCH v2 20/21] net/cpfl: support single q scatter RX datapath Date: Fri, 13 Jan 2023 08:19:30 +0000 Message-Id: <20230113081931.221576-21-mingxia.liu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113081931.221576-1-mingxia.liu@intel.com> References: <20221223015558.3143279-1-mingxia.liu@intel.com> <20230113081931.221576-1-mingxia.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This patch add single q recv scatter rx function. Signed-off-by: Wenjun Wu Signed-off-by: Mingxia Liu --- drivers/net/cpfl/cpfl_ethdev.c | 3 ++- drivers/net/cpfl/cpfl_rxtx.c | 26 ++++++++++++++++++++++++-- drivers/net/cpfl/cpfl_rxtx.h | 2 ++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index b35224e1ec..e7034c4e22 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -157,7 +157,8 @@ cpfl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) RTE_ETH_RX_OFFLOAD_UDP_CKSUM | RTE_ETH_RX_OFFLOAD_TCP_CKSUM | RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM | - RTE_ETH_RX_OFFLOAD_TIMESTAMP; + RTE_ETH_RX_OFFLOAD_TIMESTAMP | + RTE_ETH_RX_OFFLOAD_SCATTER; dev_info->tx_offload_capa = RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | diff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c index c797e09b52..bedbaa9de0 100644 --- a/drivers/net/cpfl/cpfl_rxtx.c +++ b/drivers/net/cpfl/cpfl_rxtx.c @@ -503,6 +503,8 @@ int cpfl_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id) { struct idpf_rx_queue *rxq; + uint16_t max_pkt_len; + uint32_t frame_size; int err; if (rx_queue_id >= dev->data->nb_rx_queues) @@ -516,6 +518,17 @@ cpfl_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id) return -EINVAL; } + frame_size = dev->data->mtu + CPFL_ETH_OVERHEAD; + + max_pkt_len = + RTE_MIN((uint32_t)CPFL_SUPPORT_CHAIN_NUM * rxq->rx_buf_len, + frame_size); + + rxq->max_pkt_len = max_pkt_len; + if ((dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER) || + frame_size > rxq->rx_buf_len) + dev->data->scattered_rx = 1; + err = idpf_register_ts_mbuf(rxq); if (err != 0) { PMD_DRV_LOG(ERR, "fail to register timestamp mbuf %u", @@ -801,13 +814,22 @@ cpfl_set_rx_function(struct rte_eth_dev *dev) #endif /* CC_AVX512_SUPPORT */ } + if (dev->data->scattered_rx) { + dev->rx_pkt_burst = idpf_singleq_recv_scatter_pkts; + return; + } dev->rx_pkt_burst = idpf_singleq_recv_pkts; } #else - if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) + if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) { dev->rx_pkt_burst = idpf_splitq_recv_pkts; - else + } else { + if (dev->data->scattered_rx) { + dev->rx_pkt_burst = idpf_singleq_recv_scatter_pkts; + return; + } dev->rx_pkt_burst = idpf_singleq_recv_pkts; + } #endif /* RTE_ARCH_X86 */ } diff --git a/drivers/net/cpfl/cpfl_rxtx.h b/drivers/net/cpfl/cpfl_rxtx.h index 021db5bf8a..2d55f58455 100644 --- a/drivers/net/cpfl/cpfl_rxtx.h +++ b/drivers/net/cpfl/cpfl_rxtx.h @@ -21,6 +21,8 @@ #define CPFL_DEFAULT_TX_RS_THRESH 32 #define CPFL_DEFAULT_TX_FREE_THRESH 32 +#define CPFL_SUPPORT_CHAIN_NUM 5 + int cpfl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); -- 2.25.1