From patchwork Mon Feb 6 05:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 123104 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 4394A41BE7; Mon, 6 Feb 2023 07:14:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 261D042D3F; Mon, 6 Feb 2023 07:13:21 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 1310542D48 for ; Mon, 6 Feb 2023 07:13:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675663998; x=1707199998; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u5TwMWVIbJHNeqDjZRRXsoFYk+TPIGYincgoQAi4l70=; b=M7eJbBECIcQUFqKuG9D7DRVDqK1oyogKfWLK+15wdj5UKZI/BM2Zehel 0qSvcENlDT4A+GBsGwV66dZUjHW7CYEs4pLCe2vXLap2f0fJKFztwWMo4 5g9Xgxl6WV0ZRUVlRg4j+IMPdb3lviz/7u/4QBNqsL0M072L5Im0pRf+9 zp8RO4VALDo9jifwU63px+jBtwEa3g0YDedRlcD0DyznANSbVlxceW4XO wH8eg1RpVu7TNTpMfrId8uHaY3T9MZArFzVFv6vZmmFeZJbne0Nou2N6T ogIhIvusvk4XspFGJ3Bqp6cpmWd3ODIOoTNw4qbpGzrtlb5DhKsGXcFD1 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="308780484" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="308780484" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2023 22:13:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="755142901" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="755142901" Received: from dpdk-beileix-3.sh.intel.com ([10.67.110.253]) by FMSMGA003.fm.intel.com with ESMTP; 05 Feb 2023 22:13:16 -0800 From: beilei.xing@intel.com To: jingjing.wu@intel.com Cc: dev@dpdk.org, qi.z.zhang@intel.com, Beilei Xing Subject: [PATCH v7 06/19] common/idpf: add config RSS Date: Mon, 6 Feb 2023 05:46:05 +0000 Message-Id: <20230206054618.40975-7-beilei.xing@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20230206054618.40975-1-beilei.xing@intel.com> References: <20230203094340.8103-1-beilei.xing@intel.com> <20230206054618.40975-1-beilei.xing@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 From: Beilei Xing Move configure RSS to common module. Signed-off-by: Beilei Xing --- drivers/common/idpf/idpf_common_device.c | 25 +++++++++++++++++++++++ drivers/common/idpf/idpf_common_device.h | 2 ++ drivers/common/idpf/version.map | 1 + drivers/net/idpf/idpf_ethdev.c | 26 ------------------------ 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c index 79b7bef015..ae50a741f3 100644 --- a/drivers/common/idpf/idpf_common_device.c +++ b/drivers/common/idpf/idpf_common_device.c @@ -273,4 +273,29 @@ idpf_vport_deinit(struct idpf_vport *vport) return 0; } +int +idpf_config_rss(struct idpf_vport *vport) +{ + int ret; + + ret = idpf_vc_set_rss_key(vport); + if (ret != 0) { + DRV_LOG(ERR, "Failed to configure RSS key"); + return ret; + } + + ret = idpf_vc_set_rss_lut(vport); + if (ret != 0) { + DRV_LOG(ERR, "Failed to configure RSS lut"); + return ret; + } + + ret = idpf_vc_set_rss_hash(vport); + if (ret != 0) { + DRV_LOG(ERR, "Failed to configure RSS hash"); + return ret; + } + + return ret; +} RTE_LOG_REGISTER_SUFFIX(idpf_common_logtype, common, NOTICE); diff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/idpf/idpf_common_device.h index e9f7ed36d5..2db5a1d1f9 100644 --- a/drivers/common/idpf/idpf_common_device.h +++ b/drivers/common/idpf/idpf_common_device.h @@ -153,5 +153,7 @@ int idpf_vport_init(struct idpf_vport *vport, void *dev_data); __rte_internal int idpf_vport_deinit(struct idpf_vport *vport); +__rte_internal +int idpf_config_rss(struct idpf_vport *vport); #endif /* _IDPF_COMMON_DEVICE_H_ */ diff --git a/drivers/common/idpf/version.map b/drivers/common/idpf/version.map index c1ae5affa4..fd56a9988f 100644 --- a/drivers/common/idpf/version.map +++ b/drivers/common/idpf/version.map @@ -3,6 +3,7 @@ INTERNAL { idpf_adapter_deinit; idpf_adapter_init; + idpf_config_rss; idpf_execute_vc_cmd; idpf_vc_alloc_vectors; idpf_vc_check_api_version; diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index 7a8fb6fd4a..f728318dad 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -178,32 +178,6 @@ idpf_init_vport_req_info(struct rte_eth_dev *dev, return 0; } -static int -idpf_config_rss(struct idpf_vport *vport) -{ - int ret; - - ret = idpf_vc_set_rss_key(vport); - if (ret != 0) { - PMD_INIT_LOG(ERR, "Failed to configure RSS key"); - return ret; - } - - ret = idpf_vc_set_rss_lut(vport); - if (ret != 0) { - PMD_INIT_LOG(ERR, "Failed to configure RSS lut"); - return ret; - } - - ret = idpf_vc_set_rss_hash(vport); - if (ret != 0) { - PMD_INIT_LOG(ERR, "Failed to configure RSS hash"); - return ret; - } - - return ret; -} - static int idpf_init_rss(struct idpf_vport *vport) {