From patchwork Mon Jul 3 11:28:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 129180 X-Patchwork-Delegate: qi.z.zhang@intel.com 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 8B3F942DBC; Mon, 3 Jul 2023 05:10:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E91040EF0; Mon, 3 Jul 2023 05:10:03 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 708E640156 for ; Mon, 3 Jul 2023 05:10:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688353801; x=1719889801; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XVC98+WGR5x0Cb8+Oro9gUPd0GutbjaTpTocCJO0qso=; b=NohKTVIlmkoP6GkJ6TpnwF5REhK/GnNIpF5zSQffjhTslds4S6v+7VLi rMcHDJTKMjXwIssQNKAuiGtWGBoG8Npto9QKg3x7cXyQKWIDjfzigoRBl fC2SmLODIYy8impbk5RodfcGJNPcOrmCKKyS6NWqYmcWuasBviXpf5etg Rqh85Pn0a5nu9WP1AtkvHxhJe22UTP/8RFIrqbhB2zHrFMUR6zYp4c6yw sz8J0wNZWHaAFXo2xUu2yh9TMCiWaUnYbI1ZYKw3nV1ffN5bDC4jOx7+A orWlco2768WmDjc9pNULMFqyrtVF0gUQUgYi4o5ZokssqVUHo76mB08/x A==; X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="428820648" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="428820648" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2023 20:10:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="788359386" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="788359386" Received: from dpdk-beileix-icelake.sh.intel.com ([10.67.116.252]) by fmsmga004.fm.intel.com with ESMTP; 02 Jul 2023 20:09:58 -0700 From: beilei.xing@intel.com To: jingjing.wu@intel.com Cc: dev@dpdk.org, Beilei Xing Subject: [PATCH] net/cpfl: fix RSS lookup table configuration Date: Mon, 3 Jul 2023 11:28:04 +0000 Message-Id: <20230703112804.222539-1-beilei.xing@intel.com> X-Mailer: git-send-email 2.34.1 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 From: Beilei Xing Ethdev Rx queues includes normal data queues and hairpin queues, RSS should direct traffic only to the normal data queues. Fixes: fda03330fcaa ("net/cpfl: support hairpin queue configuration") Signed-off-by: Beilei Xing Acked-by: Jingjing Wu --- drivers/net/cpfl/cpfl_ethdev.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index 9755ffe508..c4ca9343c3 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -817,6 +817,24 @@ cpfl_rxq_hairpin_mz_bind(struct rte_eth_dev *dev) } } +static int +cpfl_rss_lut_config(struct cpfl_vport *cpfl_vport, uint16_t nb_q) +{ + struct idpf_vport *vport = &cpfl_vport->base; + 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_vc_rss_lut_set(vport); + if (ret) + PMD_INIT_LOG(ERR, "Failed to configure RSS lut"); + + return ret; +} + static int cpfl_start_queues(struct rte_eth_dev *dev) { @@ -951,6 +969,10 @@ cpfl_start_queues(struct rte_eth_dev *dev) } } + /* re-configure RSS lut if there's hairpin queue */ + if (cpfl_vport->nb_p2p_rxq > 0) + err = cpfl_rss_lut_config(cpfl_vport, cpfl_vport->nb_data_rxq); + return err; }