From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B69FFA0093; Tue, 19 May 2020 05:17:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E8811D53C; Tue, 19 May 2020 05:17:03 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id A09A11D52C for ; Tue, 19 May 2020 05:17:01 +0200 (CEST) IronPort-SDR: JFNuUiFw4f+KGgu1ZHp+xFw4yMWxDFkYn5u3uEQePhaxyvrsCPL3TgEGZEL2ZiQ9wP8op00hoU aDIKQQgCxWPw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2020 20:17:00 -0700 IronPort-SDR: Q8KmrjX6AfXQHPDorZqWqtcxPYVo2fUitkyS14HePUgQ8IRWGkwWKrG9Nt0C6tv6F9+4WZVtFV 2g0MW532Ymlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,408,1583222400"; d="scan'208";a="465814924" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.116.183]) by fmsmga005.fm.intel.com with ESMTP; 18 May 2020 20:16:58 -0700 Date: Tue, 19 May 2020 11:08:28 +0800 From: Ye Xiaolong To: Jeff Guo Cc: beilei.xing@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, dev@dpdk.org, Zhiwei He Message-ID: <20200519030828.GC38911@intel.com> References: <20200519002017.106445-1-jia.guo@intel.com> <20200519142350.70181-1-jia.guo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519142350.70181-1-jia.guo@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [dpdk-dev v2] net/iavf: fix VF reset issue for hash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 05/19, Jeff Guo wrote: >Since there are some default rss configure in kernel PF/VF but not DPDK >IAVF, if these configurations be modified by VF and then VF reset, this >default rss configurations can not be reset to default by IAVF. So need >to add default rss set in IAVF hash initial process. > >Signed-off-by: Jeff Guo >Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF") Fixes tag should be put before the SOB, fixed it while merging. >Acked-by: Qi Zhang >Tested-by: Zhiwei He >--- >v2->v1: >add hash engine unregister process >--- > drivers/net/iavf/iavf_hash.c | 53 +++++++++++++++++++++++++++++++++++- > 1 file changed, 52 insertions(+), 1 deletion(-) > >diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c >index 975c84556..56ab170d8 100644 >--- a/drivers/net/iavf/iavf_hash.c >+++ b/drivers/net/iavf/iavf_hash.c >@@ -857,6 +857,17 @@ struct iavf_hash_match_type iavf_hash_type_list[] = { > &hdrs_hint_ipv6_sctp}, > }; > >+struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = { >+ &hdrs_hint_ipv4, >+ &hdrs_hint_ipv4_udp, >+ &hdrs_hint_ipv4_tcp, >+ &hdrs_hint_ipv4_sctp, >+ &hdrs_hint_ipv6, >+ &hdrs_hint_ipv6_udp, >+ &hdrs_hint_ipv6_tcp, >+ &hdrs_hint_ipv6_sctp, >+}; >+ > static struct iavf_flow_engine iavf_hash_engine = { > .init = iavf_hash_init, > .create = iavf_hash_create, >@@ -875,6 +886,33 @@ static struct iavf_flow_parser iavf_hash_parser = { > .stage = IAVF_FLOW_STAGE_RSS, > }; > >+static int >+iavf_hash_default_set(struct iavf_adapter *ad) >+{ >+ struct virtchnl_rss_cfg *rss_cfg; >+ uint16_t i; >+ int ret; >+ >+ rss_cfg = rte_zmalloc("iavf rss rule", >+ sizeof(struct virtchnl_rss_cfg), 0); >+ if (!rss_cfg) >+ return -ENOMEM; >+ >+ for (i = 0; i < RTE_DIM(iavf_hash_default_hdrs); i++) { >+ rss_cfg->proto_hdrs = *iavf_hash_default_hdrs[i]; >+ rss_cfg->rss_algorithm = VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC; >+ >+ ret = iavf_add_del_rss_cfg(ad, rss_cfg, true); >+ if (ret) { >+ PMD_DRV_LOG(ERR, "fail to add RSS configure"); >+ rte_free(rss_cfg); >+ return ret; >+ } >+ } >+ >+ return ret; >+} >+ > RTE_INIT(iavf_hash_engine_init) > { > struct iavf_flow_engine *engine = &iavf_hash_engine; >@@ -887,6 +925,7 @@ iavf_hash_init(struct iavf_adapter *ad) > { > struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad); > struct iavf_flow_parser *parser; >+ int ret; > > if (!vf->vf_res) > return -EINVAL; >@@ -896,7 +935,19 @@ iavf_hash_init(struct iavf_adapter *ad) > > parser = &iavf_hash_parser; > >- return iavf_register_parser(parser, ad); >+ ret = iavf_register_parser(parser, ad); >+ if (ret) { >+ PMD_DRV_LOG(ERR, "fail to register hash parser"); >+ return ret; >+ } >+ >+ ret = iavf_hash_default_set(ad); >+ if (ret) { >+ PMD_DRV_LOG(ERR, "fail to set default RSS"); >+ iavf_unregister_parser(parser, ad); >+ } >+ >+ return ret; > } > > static int >-- >2.20.1 > Applied to dpdk-next-net-intel, Thanks.