From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: "Di, ChenxuX" <chenxux.di@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "Yang, Qiming" <qiming.yang@intel.com>,
"Xing, Beilei" <beilei.xing@intel.com>,
"Zhao1, Wei" <wei.zhao1@intel.com>
Subject: Re: [dpdk-dev] [PATCH v6] net/i40e: implement hash function in rte flow API
Date: Wed, 8 Apr 2020 08:24:14 +0000 [thread overview]
Message-ID: <DM6PR11MB25378D33F8F8759FAFF11EFCEFC00@DM6PR11MB2537.namprd11.prod.outlook.com> (raw)
In-Reply-To: <4a1f49493dc54ef0b3ae9c2bf7018f0d@intel.com>
Hi Chenxu,
<snip>
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Chenxu Di
> > > Sent: Monday, March 30, 2020 8:40 AM
> > > To: dev@dpdk.org
> > > Cc: Yang, Qiming <qiming.yang@intel.com>; Xing, Beilei
> > > <beilei.xing@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>; Di,
> > > ChenxuX <chenxux.di@intel.com>
> > > Subject: [dpdk-dev] [PATCH v6] net/i40e: implement hash function in
> > > rte flow API
> > >
> > > implement set hash global configurations, set symmetric hash enable
> > > and set hash input set in rte flow API.
> > >
> > > Signed-off-by: Chenxu Di <chenxux.di@intel.com>
>
> [snip]
>
> > > -struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
> > >
> > > -if (!add) {
> > > -if (i40e_action_rss_same(&rss_info->conf, &conf->conf)) {
> >
> >
> > The function i40e_action_rss_same() is no longer used.
> > Should it be removed from i40e_ethdev.c and i40e_ethdev.h?
> >
>
> It seems like no one use the function.
> However I check the commit of the function and find the
> commit(ac8d22de23) is so large.
> I don't know it is ok if remove it.
Best to check with Qi or Beilei if it is ok to remove this function.
>
> >
> > > -i40e_pf_disable_rss(pf);
> > > -memset(rss_info, 0,
> > > -sizeof(struct i40e_rte_flow_rss_conf)); -return 0;
> > > +ret = 0;
> > > +
> > > +for (i = RTE_ETH_FLOW_IPV4; i <= RTE_ETH_FLOW_L2_PAYLOAD;
> > > i++) {
> > > +if (!(pf->adapter->flow_types_mask & (1ull << i)) ||
> > > + !(types & (1ull << i)))
> > > +continue;
> > > +
> > > +conf.op = RTE_ETH_INPUT_SET_SELECT; conf.flow_type = i;
> > > +conf.inset_size = 0; for (j = 0; j < RTE_DIM(inset_type_table);
> > > +j++) { if ((types &
> > > +inset_type_table[j].type) ==
> > > + inset_type_table[j].type) {
> > > +if (inset_type_table[j].field ==
> > > + RTE_ETH_INPUT_SET_UNKNOWN) {
> > > +return -EINVAL;
> > > +}
> > > +conf.field[conf.inset_size] =
> > > +inset_type_table[j].field;
> > > +conf.inset_size++;
> > > +}
> > > }
> > > +
> > > +if (conf.inset_size) {
> > > +ret = i40e_hash_filter_inset_select(hw, &conf); if (ret) return
> > > +ret; } }
> > > +
> > > +return ret;
> > > +}
> > > +
> > > +/* set existing rule invalid if it is covered */ static void
> > > +i40e_config_rss_invalidate_previous_rule(struct i40e_pf *pf, struct
> > > +i40e_rte_flow_rss_conf *conf) { struct i40e_flow_rss_filter
> > > +*rss_item; uint64_t rss_inset;
> > > +
> > > +/* to check pctype same need without input set bits */ rss_inset =
> > > +~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY |
> > ETH_RSS_L4_SRC_ONLY |
> > > +ETH_RSS_L4_DST_ONLY);
> > > +
> > > +TAILQ_FOREACH(rss_item, &pf->rss_info_list, next) { if
> > > +(!rss_item->rss_filter_info.valid)
> > > +continue;
> > > +
> > > +/* config rss queue rule */
> > > +if (conf->conf.queue_num &&
> > > + rss_item->rss_filter_info.conf.queue_num)
> > > +rss_item->rss_filter_info.valid = false;
> > > +
> > > +/* config rss input set rule */
> > > +if (conf->conf.types &&
> > > + (rss_item->rss_filter_info.conf.types &
> > > + rss_inset) ==
> > > + (conf->conf.types & rss_inset)) rss_item->rss_filter_info.valid
> > > += false;
> > > +
> > > +/* config rss function symmetric rule */ if (conf->conf.func ==
> > > + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ &&
> > > + rss_item->rss_filter_info.conf.func ==
> > > + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
> > > +rss_item->rss_filter_info.valid = false;
> > > +
> > > +/* config rss function xor or toeplitz rule */ if
> > > +(rss_item->rss_filter_info.conf.func !=
> > > + RTE_ETH_HASH_FUNCTION_DEFAULT &&
> > > + conf->conf.func != RTE_ETH_HASH_FUNCTION_DEFAULT
> > > &&
> > > + (rss_item->rss_filter_info.conf.types & rss_inset) ==
> > > + (conf->conf.types & rss_inset)) rss_item->rss_filter_info.valid
> > > += false; } }
> > > +
> > > +/* config rss hash enable and set hash input set */ static int
> > > +i40e_config_hash_pctype_add(struct i40e_pf *pf, struct
> > > +i40e_rte_flow_rss_conf *conf, struct rte_eth_rss_conf *rss_conf) {
> > > +struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
> > > +
> > > +if (!(rss_conf->rss_hf & pf->adapter->flow_types_mask)) return
> > > +-ENOTSUP;
> > > +
> > > +/* Confirm hash input set */
> > > +if (i40e_config_rss_inputset(pf, rss_conf->rss_hf))
> > > return -EINVAL;
> > > +
> > > +if (rss_conf->rss_key == NULL || rss_conf->rss_key_len <
> > > + (I40E_PFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t)) {
> > > +/* Random default keys */
> > > +static uint32_t rss_key_default[] = {0x6b793944, 0x23504cb5,
> > > +0x5bea75b6, 0x309f4f12, 0x3dc0a2b8, 0x024ddcdf, 0x339b8ca0,
> > > +0x4c4af64a, 0x34fac605, 0x55d85839, 0x3a58997d, 0x2ec938e1,
> > > +0x66031581};
> > > +
> > > +rss_conf->rss_key = (uint8_t *)rss_key_default;
> > > +rss_conf->rss_key_len = (I40E_PFQF_HKEY_MAX_INDEX + 1)
> > > *
> > > +sizeof(uint32_t);
> > > +PMD_DRV_LOG(INFO,
> > > +"No valid RSS key config for i40e, using default\n");
> > > }
> > >
> > > +rss_conf->rss_hf |= rss_info->conf.types; i40e_hw_rss_hash_set(pf,
> > > +rss_conf);
> > > +
> > > +i40e_config_rss_invalidate_previous_rule(pf, conf);
> > > +
> > > +return 0;
> > > +}
> > > +
> > > +/* config rss queue region */
> > > +static int
> > > +i40e_config_hash_queue_add(struct i40e_pf *pf, struct
> > > +i40e_rte_flow_rss_conf *conf) { struct i40e_hw *hw =
> > > +I40E_PF_TO_HW(pf); uint32_t i, lut; uint16_t j, num;
> > > +
> > > /* If both VMDQ and RSS enabled, not all of PF queues are configured.
> > > * It's necessary to calculate the actual PF queues that are configured.
> > > */
> > > @@ -13000,6 +13208,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
> > > return -ENOTSUP; }
> > >
> > > +lut = 0;
> > > /* Fill in redirection table */
> > > for (i = 0, j = 0; i < hw->func_caps.rss_table_size; i++, j++) {
> > > if (j == num) @@ -13010,29 +13219,215 @@
> > > i40e_config_rss_filter(struct i40e_pf *pf, I40E_WRITE_REG(hw,
> > > I40E_PFQF_HLUT(i >> 2), lut); }
> > >
> > > -if ((rss_conf.rss_hf & pf->adapter->flow_types_mask) == 0) {
> > > -i40e_pf_disable_rss(pf);
> > > +i40e_config_rss_invalidate_previous_rule(pf, conf);
> > > +
> > > +return 0;
> > > +}
> > > +
> > > +/* config rss hash function */
> > > +static int
> > > +i40e_config_hash_function_add(struct i40e_pf *pf, struct
> > > +i40e_rte_flow_rss_conf *conf) { struct i40e_hw *hw =
> > > +I40E_PF_TO_HW(pf); struct rte_eth_hash_global_conf g_cfg; uint64_t
> > > +rss_inset;
> > > +
> > > +if (conf->conf.func ==
> > > +RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ){
> > > +i40e_set_symmetric_hash_enable_per_port(hw, 1); } else { rss_inset
> > > += ~(ETH_RSS_L3_SRC_ONLY |
> > > ETH_RSS_L3_DST_ONLY |
> > > + ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY); g_cfg.hash_func
> =
> > > +conf->conf.func; g_cfg.sym_hash_enable_mask[0] = conf->conf.types
> &
> > > rss_inset;
> > > +g_cfg.valid_bit_mask[0] = conf->conf.types & rss_inset;
> > > +i40e_set_hash_filter_global_config(hw, &g_cfg); }
> > > +
> > > +i40e_config_rss_invalidate_previous_rule(pf, conf);
> > > +
> > > +return 0;
> > > +}
> > > +
> > > +/* config rss hena disable and set hash input set to defalut */
> >
> > Typo: defalut should be default in above comment.
> >
>
> Yeah ,I will fix it
>
> > static
> > > +int i40e_config_hash_pctype_del(struct i40e_pf *pf, struct
> > > +i40e_rte_flow_rss_conf *conf) { struct i40e_hw *hw =
> > > +I40E_PF_TO_HW(pf); struct i40e_rte_flow_rss_conf *rss_info =
> > > +&pf->rss_info; struct rte_eth_rss_conf rss_conf = { .rss_key =
> > > +pf->rss_info.conf.key_len ?
> > > +(void *)(uintptr_t)conf->conf.key : NULL, .rss_key_len =
> > > +pf->rss_info.conf.key_len, }; uint32_t i;
> > > +
>
> [snip]
>
> > > --
> > > 2.17.1
> >
Regards,
Bernard
next prev parent reply other threads:[~2020-04-08 8:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 1:47 [dpdk-dev] [PATCH 0/4] drivers/net: remove legacy filter API and switch to rte flow Chenxu Di
2020-03-18 1:47 ` [dpdk-dev] [PATCH 1/4] net/e1000: remove the legacy filter functions Chenxu Di
2020-03-18 3:15 ` Yang, Qiming
2020-03-18 1:47 ` [dpdk-dev] [PATCH 2/4] net/ixgbe: " Chenxu Di
2020-03-18 1:47 ` [dpdk-dev] [PATCH 3/4] net/i40e: " Chenxu Di
2020-03-18 1:47 ` [dpdk-dev] [PATCH 4/4] net/i40e: implement hash function in rte flow API Chenxu Di
2020-03-18 3:00 ` [dpdk-dev] [PATCH 0/4] drivers/net: remove legacy filter API and switch to rte flow Stephen Hemminger
2020-03-19 6:39 ` [dpdk-dev] [PATCH v2] net/i40e: implement hash function in rte flow API Chenxu Di
2020-03-20 1:24 ` [dpdk-dev] [PATCH v3] " Chenxu Di
2020-03-23 8:25 ` [dpdk-dev] [PATCH v4] " Chenxu Di
2020-03-24 3:28 ` Yang, Qiming
2020-03-24 8:17 ` [dpdk-dev] [PATCH v5] " Chenxu Di
2020-03-24 12:57 ` Iremonger, Bernard
[not found] ` <87688dbf6ac946d5974a61578be1ed89@intel.com>
2020-03-25 9:48 ` Iremonger, Bernard
2020-03-27 12:49 ` Xing, Beilei
2020-03-30 7:40 ` [dpdk-dev] [PATCH v6] " Chenxu Di
2020-04-02 16:26 ` Iremonger, Bernard
[not found] ` <4a1f49493dc54ef0b3ae9c2bf7018f0d@intel.com>
2020-04-08 8:24 ` Iremonger, Bernard [this message]
2020-04-10 1:52 ` Xing, Beilei
2020-04-13 5:31 ` [dpdk-dev] [PATCH v7] net/i40e: enable advanced RSS Chenxu Di
2020-04-14 6:36 ` [dpdk-dev] [PATCH v8] " Chenxu Di
2020-04-14 14:55 ` Iremonger, Bernard
2020-04-15 5:31 ` Xing, Beilei
2020-04-15 8:46 ` [dpdk-dev] [PATCH v9] net/i40e: enable hash configuration in RSS flow Chenxu Di
2020-04-15 9:52 ` Xing, Beilei
2020-04-15 9:59 ` Ye Xiaolong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR11MB25378D33F8F8759FAFF11EFCEFC00@DM6PR11MB2537.namprd11.prod.outlook.com \
--to=bernard.iremonger@intel.com \
--cc=beilei.xing@intel.com \
--cc=chenxux.di@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=wei.zhao1@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).