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 3FE26A00C2; Mon, 26 Sep 2022 10:43:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C70A42686; Mon, 26 Sep 2022 10:43:30 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 021124113C for ; Mon, 26 Sep 2022 10:43:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664181805; x=1695717805; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SMJT1pWHnRshx7Q1AZKN1kbK7yt6BmEaj8dRZrx8HV0=; b=HsdM3PjfXvY1wHSlNwakfcQerZcR9MRyXeXNxrpQVyoaZ+a1hX+vu4Bv 1lxUR/MMAt7ZDdzuSQAaz/PgsjBTfMvNA5WV716bTM8bOKZMPS1YoT7rs PzXvcdlvwAIFQFP02g7nuhKwJnY4K76co1K9GJUiRtKmWA6di8fCmr1Qu RZO5io1SfY1njZAPgIvrmb5jnat1hFlm1gwnVC70vH9IMFYLfiZEVxWkN 6HoK2CaKsbmqEFhbMcVjz1H8buRxm//mHk8i8uxVsKTR+0wD9okOTwr/s RT5oBpCb0FnD7RwDQyBgxj7+N6FrbajSrqLmE7mUo8/f/ihpU2fxSea/f Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="302444393" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="302444393" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 01:43:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10481"; a="949770643" X-IronPort-AV: E=Sophos;i="5.93,345,1654585200"; d="scan'208";a="949770643" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.118.246]) by fmsmga005.fm.intel.com with ESMTP; 26 Sep 2022 01:43:09 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, xiao.w.wang@intel.com, junfeng.guo@intel.com Subject: [RFC v2 3/3] net/idpf: adjust RSS LUT to exclude hairpin queue Date: Mon, 26 Sep 2022 16:42:48 +0800 Message-Id: <20220926084248.1421987-4-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220926084248.1421987-1-junfeng.guo@intel.com> References: <20220905113031.3223290-2-junfeng.guo@intel.com> <20220926084248.1421987-1-junfeng.guo@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 --- drivers/net/idpf/idpf_ethdev.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index 41e6391d8b..a30b8df778 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -624,9 +624,28 @@ idpf_config_rx_queues_irqs(struct rte_eth_dev *dev) return -1; } +static int +idpf_config_rss_lut(struct idpf_vport *vport, uint16_t nb_q) +{ + uint16_t lut_size = vport->rss_lut_size; + uint16_t i; + int ret; + + for (i = 0; i < lut_size; i++) + vport->rss_lut[i] = i % nb_q; + + ret = idpf_set_rss_lut(vport); + if (ret) + PMD_INIT_LOG(ERR, "Failed to configure RSS lut"); + + return ret; +} + static int idpf_start_queues(struct rte_eth_dev *dev) { + struct idpf_vport *vport = (struct idpf_vport *)dev->data->dev_private; + uint16_t nb_rxq = dev->data->nb_rx_queues; struct idpf_rx_queue *rxq; struct idpf_tx_queue *txq; int err = 0; @@ -704,6 +723,11 @@ idpf_start_queues(struct rte_eth_dev *dev) } } + /* RSS only to the data queues */ + rxq = dev->data->rx_queues[nb_rxq - 1]; + if (nb_rxq > 1 && rxq && rxq->hairpin_q) + err = idpf_config_rss_lut(vport, nb_rxq - 1); + return err; } -- 2.25.1