From patchwork Mon Sep 5 11:30:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junfeng Guo X-Patchwork-Id: 115909 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CAE2A054F; Mon, 5 Sep 2022 13:31:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62D124282B; Mon, 5 Sep 2022 13:30:57 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 5B9FB427F1 for ; Mon, 5 Sep 2022 13:30:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662377455; x=1693913455; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=43OymPKNlQ8aLsofhfb9hjUCmBU7Vk+cKcY+1q0iP40=; b=cei1pyNHLcVkB2HD7702yiWXXC/WiXfdDjASgrO5Tb0KxppvQXG7bQNQ UIAitEOSagMilJCpJ/gaibWpTxCvYFx+UnGiztERMtgE+EuN89hAKbHGy BK1fkp+9lTq6rb/IzA3qU62T0nS2KXo3nKyc2N9Jmgx+I1MC9W2dU9u07 d1xR5y2q+tur2aMwcSXtbODzCo2hg8GHq/bIR9CgfjcA2000a8fsXNnyy UFi7rdYV993R8BOzDOHHw6swqXKmWqeqi2AXsnd4OgiUu4m0NPwoCz2I4 HGhdnyQtxEMUZI+rXyanHGVgYypqWAm6h9Ub4+G1aopdhkkwG/cmsJFuM w==; X-IronPort-AV: E=McAfee;i="6500,9779,10460"; a="283364419" X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="283364419" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 04:30:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="739566111" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.118.246]) by orsmga004.jf.intel.com with ESMTP; 05 Sep 2022 04:30:52 -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 3/3] net/idpf: adjust RSS LUT to exclude hairpin queue Date: Mon, 5 Sep 2022 19:30:31 +0800 Message-Id: <20220905113031.3223290-4-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905113031.3223290-1-junfeng.guo@intel.com> References: <20220905113031.3223290-1-junfeng.guo@intel.com> MIME-Version: 1.0 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 aaca6f4202..fc9663d32e 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -625,9 +625,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; @@ -671,6 +690,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; }