From patchwork Fri Jan 6 09:16:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 121664 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 5771AA00C2; Fri, 6 Jan 2023 10:40:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9735B42D2B; Fri, 6 Jan 2023 10:40:02 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 747AF40A8A for ; Fri, 6 Jan 2023 10:39:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672998000; x=1704534000; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V7JEeV9ff9/rW9p816d241qkB9UC48QFtNFCx2W6VjM=; b=U1rEB603ridQzZ7GQKE6KEGCMYXWBYAqNfoNwJIOQsIgaKdDyU9yuv4r 2j7ZhmS3UlEIXg/l2x8KYPadZMWmGIjt17leBHKfyZ74Dw+KsiW5uh3EI fTl+FZ5XzixZ3nOpECIUgpxtDqEdEpBP/OP/mD6YlBezbQSBVma238BTl kjT2eMFcUGEH9T2bgjq6JlCBI/LiqjhWEhExm9VVXHS1z99uxNYkWqTgL 43qpPFKWGeleq3pPaXIYri7eMNdF6E49fN0Um4WEmANETa7nqwY72GAks t/ImNEi+hj+wCugThEANFeZx1c8HaR+SxFtyfGjWh0uKOINW+/61IxSc/ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="320148013" X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="320148013" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 01:39:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="901236265" X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="901236265" Received: from dpdk-beileix-3.sh.intel.com ([10.67.110.253]) by fmsmga006.fm.intel.com with ESMTP; 06 Jan 2023 01:39:25 -0800 From: beilei.xing@intel.com To: jingjing.wu@intel.com Cc: dev@dpdk.org, qi.z.zhang@intel.com, Beilei Xing Subject: [PATCH v2 06/15] common/idpf: add config RSS Date: Fri, 6 Jan 2023 09:16:18 +0000 Message-Id: <20230106091627.13530-7-beilei.xing@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20230106091627.13530-1-beilei.xing@intel.com> References: <20221208075309.37852-1-beilei.xing@intel.com> <20230106091627.13530-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/idpf_common_virtchnl.h | 3 --- drivers/common/idpf/version.map | 4 +--- drivers/net/idpf/idpf_ethdev.c | 26 ---------------------- 5 files changed, 28 insertions(+), 32 deletions(-) diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c index 2aad9bcdd3..19d638824d 100644 --- a/drivers/common/idpf/idpf_common_device.c +++ b/drivers/common/idpf/idpf_common_device.c @@ -286,4 +286,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 1f7483fd85..026d852de4 100644 --- a/drivers/common/idpf/idpf_common_device.h +++ b/drivers/common/idpf/idpf_common_device.h @@ -150,5 +150,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/idpf_common_virtchnl.h b/drivers/common/idpf/idpf_common_virtchnl.h index e9e1c172eb..182a6a4490 100644 --- a/drivers/common/idpf/idpf_common_virtchnl.h +++ b/drivers/common/idpf/idpf_common_virtchnl.h @@ -12,11 +12,8 @@ int idpf_vc_get_caps(struct idpf_adapter *adapter); int idpf_vc_create_vport(struct idpf_vport *vport, struct virtchnl2_create_vport *vport_info); int idpf_vc_destroy_vport(struct idpf_vport *vport); -__rte_internal int idpf_vc_set_rss_key(struct idpf_vport *vport); -__rte_internal int idpf_vc_set_rss_lut(struct idpf_vport *vport); -__rte_internal int idpf_vc_set_rss_hash(struct idpf_vport *vport); __rte_internal int idpf_switch_queue(struct idpf_vport *vport, uint16_t qid, diff --git a/drivers/common/idpf/version.map b/drivers/common/idpf/version.map index 172906fcfa..62ea6579e3 100644 --- a/drivers/common/idpf/version.map +++ b/drivers/common/idpf/version.map @@ -7,9 +7,6 @@ INTERNAL { idpf_ctlq_recv; idpf_ctlq_send; idpf_ctlq_post_rx_buffs; - idpf_vc_set_rss_key; - idpf_vc_set_rss_lut; - idpf_vc_set_rss_hash; idpf_switch_queue; idpf_vc_ena_dis_queues; idpf_vc_ena_dis_vport; @@ -23,6 +20,7 @@ INTERNAL { idpf_adapter_deinit; idpf_vport_init; idpf_vport_deinit; + idpf_config_rss; local: *; }; 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) {