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 4B17541C49; Tue, 14 Feb 2023 13:37:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2AA842DB8; Tue, 14 Feb 2023 13:36:39 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 43F1042DA5 for ; Tue, 14 Feb 2023 13:36:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676378197; x=1707914197; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RJNJuqZzfgx1t432HkK4BQ9sVn19wjVgqD+koZA42TY=; b=eB3oba3xCyKIMJLi9olbIQss/RTZUvNeRLBFmhkPk5pBGGwSpjCUUtZj AaJBoBs7LuIThuPY7e2ZpaTn5uM7tWGiGQF4oQg3qYuok1bUskLpvpXVs uDLfYltTEp/K4z6sMlBzY23bDk/WrPRuoB2qsomMbgg/9U2/h1+5uFFWh H2N0sB+XFp+bGyCHwmhZfhU4ojSCJ4Z60MdiD7NxMMex3zvrONeMcYIzx cJk0PqjvYQwdGtfHOsnlSH+i3PLvpbzfBkGxUSw55BK11rgLzGUXQUUo7 0kcOqYHNH0KnFzW+4+8g9Y8JgPCLlFR8bt1ZMFdw/P4aIvO5mUKszy0jy w==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="314793207" X-IronPort-AV: E=Sophos;i="5.97,296,1669104000"; d="scan'208";a="314793207" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 04:36:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="699528535" X-IronPort-AV: E=Sophos;i="5.97,296,1669104000"; d="scan'208";a="699528535" Received: from dpdk-mingxial-01.sh.intel.com ([10.67.119.167]) by orsmga008.jf.intel.com with ESMTP; 14 Feb 2023 04:36:35 -0800 From: Mingxia Liu To: dev@dpdk.org, beilei.xing@intel.com, yuying.zhang@intel.com Cc: Mingxia Liu , Xiao Wang , Junfeng Guo Subject: [PATCH v2 5/5] net/cpfl: adjust RSS LUT to exclude hairpin queue Date: Tue, 14 Feb 2023 11:38:52 +0000 Message-Id: <20230214113852.3341607-6-mingxia.liu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214113852.3341607-1-mingxia.liu@intel.com> References: <20230118130659.976873-1-mingxia.liu@intel.com> <20230214113852.3341607-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 RSS should direct traffic only to the normal data Rx queues, so when hairpin queue configured, RSS LUT should be adjusted to exclude the hairpin queue. Signed-off-by: Xiao Wang Signed-off-by: Junfeng Guo Signed-off-by: Mingxia Liu --- drivers/net/cpfl/cpfl_ethdev.c | 38 ++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index f08b7beb13..014735b2b0 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -446,7 +446,8 @@ cpfl_init_rss(struct idpf_vport *vport) { struct rte_eth_rss_conf *rss_conf; struct rte_eth_dev_data *dev_data; - uint16_t i, nb_q; + struct cpfl_rx_queue *cpfl_rxq; + uint16_t i, nb_q, max_nb_data_q; int ret = 0; dev_data = vport->dev_data; @@ -465,8 +466,16 @@ cpfl_init_rss(struct idpf_vport *vport) vport->rss_key_size); } + /* RSS only to the data queues */ + max_nb_data_q = nb_q; + if (nb_q > 1) { + cpfl_rxq = dev_data->rx_queues[nb_q - 1]; + if (cpfl_rxq && cpfl_rxq->hairpin_info.hairpin_q) + max_nb_data_q = nb_q - 1; + } + for (i = 0; i < vport->rss_lut_size; i++) - vport->rss_lut[i] = i % nb_q; + vport->rss_lut[i] = i % max_nb_data_q; vport->rss_hf = IDPF_DEFAULT_RSS_HASH_EXPANDED; @@ -673,8 +682,6 @@ cpfl_dev_configure(struct rte_eth_dev *dev) (struct cpfl_vport *)dev->data->dev_private; struct idpf_vport *vport = &(cpfl_vport->base); struct rte_eth_conf *conf = &dev->data->dev_conf; - struct idpf_adapter *adapter = vport->adapter; - int ret; if (conf->link_speeds & RTE_ETH_LINK_SPEED_FIXED) { PMD_INIT_LOG(ERR, "Setting link speed is not supported"); @@ -713,17 +720,6 @@ cpfl_dev_configure(struct rte_eth_dev *dev) return -ENOTSUP; } - if (adapter->caps.rss_caps != 0 && dev->data->nb_rx_queues != 0) { - ret = cpfl_init_rss(vport); - if (ret != 0) { - PMD_INIT_LOG(ERR, "Failed to init rss"); - return ret; - } - } else { - PMD_INIT_LOG(ERR, "RSS is not supported."); - return -1; - } - vport->max_pkt_len = (dev->data->mtu == 0) ? CPFL_DEFAULT_MTU : dev->data->mtu + CPFL_ETH_OVERHEAD; @@ -748,11 +744,23 @@ cpfl_start_queues(struct rte_eth_dev *dev) struct cpfl_vport *cpfl_vport = (struct cpfl_vport *)dev->data->dev_private; struct idpf_vport *vport = &(cpfl_vport->base); + struct idpf_adapter *adapter = vport->adapter; struct cpfl_rx_queue *cpfl_rxq; struct cpfl_tx_queue *cpfl_txq; int err = 0; int i; + if (adapter->caps.rss_caps != 0 && dev->data->nb_rx_queues != 0) { + err = cpfl_init_rss(vport); + if (err != 0) { + PMD_INIT_LOG(ERR, "Failed to init rss"); + return err; + } + } else { + PMD_INIT_LOG(ERR, "RSS is not supported."); + return -1; + } + for (i = 0; i < dev->data->nb_tx_queues; i++) { cpfl_txq = dev->data->tx_queues[i]; if (cpfl_txq == NULL || cpfl_txq->base.tx_deferred_start) -- 2.25.1