From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: "Di, ChenxuX" <chenxux.di@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Xing, Beilei" <beilei.xing@intel.com>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>,
"Doherty, Declan" <declan.doherty@intel.com>
Cc: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Subject: Re: [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS action
Date: Tue, 24 Mar 2020 09:47:50 +0000 [thread overview]
Message-ID: <DM6PR11MB3914D8BFCA4938D7B60F1D85EFF10@DM6PR11MB3914.namprd11.prod.outlook.com> (raw)
In-Reply-To: <e0bea82c974e4d238a6e318093818363@intel.com>
Hi Chenxu,
> -----Original Message-----
> From: Di, ChenxuX <chenxux.di@intel.com>
> Sent: Monday, March 23, 2020 9:19 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Iremonger,
> Bernard <bernard.iremonger@intel.com>
> Subject: RE: [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS
> action
>
> Hi, Bernard
> This patch conflicts with the
> patch(http://patchwork.dpdk.org/project/dpdk/list/?series=9005). In 20.05
> release, there will be some changes for creating RSS flows to support more
> features and make it more flexible.
> Changes for RSS flow:
> - Configure the hash input set according to the packet type.
> - Configure hash function.
> - User can create more than one RSS flows and won't affect other rules when
> destory.
> For example, if you want to enable rss for ipv4-tcp, the command looks like
> this:
> flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types ipv4-tcp
> end queues end / end
>
> So, perhaps you need rework your feature depending on that patch.
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bernard
> Iremonger
> > Sent: Wednesday, March 18, 2020 8:38 PM
> > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Iremonger,
> > Bernard <bernard.iremonger@intel.com>
> > Subject: [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS
> > action
> >
> > handle RSS offload types in RSS action handle ipv4, ipv6 and udp RSS
> > patterns handle queue_num 0 in RSS action
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > drivers/net/i40e/i40e_flow.c | 46
> > ++++++++++++++++++++++++++++++++-------
> > -----
> > 1 file changed, 34 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_flow.c
> > b/drivers/net/i40e/i40e_flow.c index d877ac2..b9a928c 100644
> > --- a/drivers/net/i40e/i40e_flow.c
> > +++ b/drivers/net/i40e/i40e_flow.c
> > @@ -4461,6 +4461,12 @@ i40e_flow_parse_rss_pattern(__rte_unused
> struct
> > rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_ETH:
> > *action_flag = 1;
> > break;
> > +case RTE_FLOW_ITEM_TYPE_IPV4:
> > +break;
> > +case RTE_FLOW_ITEM_TYPE_IPV6:
> > +break;
> > +case RTE_FLOW_ITEM_TYPE_UDP:
> > +break;
> > case RTE_FLOW_ITEM_TYPE_VLAN:
> > vlan_spec = item->spec;
> > vlan_mask = item->mask;
> > @@ -4516,12 +4522,14 @@ i40e_flow_parse_rss_action(struct
> rte_eth_dev
> > *dev, struct i40e_rte_flow_rss_conf *rss_config = &filter->rss_conf;
> > struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
> > +struct rte_eth_rss_conf eth_rss_conf; int ret;
> > uint16_t i, j, n, tmp;
> > uint32_t index = 0;
> > uint64_t hf_bit = 1;
> > +uint64_t rss_hf;
> >
> > NEXT_ITEM_OF_ACTION(act, actions, index); -rss = act->conf;
> >
> > /**
> > * rss only supports forwarding,
> > @@ -4535,6 +4543,23 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> > *dev, return -rte_errno; }
> >
> > +rss = act->conf;
> > +rss_hf = rss->types;
> > +
> > +if (rss->queue_num == 0) {
> > +memset(ð_rss_conf, 0, sizeof(eth_rss_conf)); ret =
> > +rte_eth_dev_rss_hash_conf_get(dev->data->port_id,
> > +ð_rss_conf);
> > +if (ret != 0)
> > +return ret;
> > +
> > +eth_rss_conf.rss_hf |= rss_hf;
> > +ret = rte_eth_dev_rss_hash_update(dev->data->port_id,
> > +ð_rss_conf);
> > +if (ret != 0)
> > +return ret;
> > +}
> > +
>
> I don't think it is a good idea that update rss hash enable status in the parse
> function.
> it will update status while send command flow validate xxxxxx which can't be
> destoried.
>
> > if (action_flag) {
> > for (n = 0; n < 64; n++) {
> > if (rss->types & (hf_bit << n)) {
> > @@ -4552,7 +4577,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> *dev,
> > * continuous sequence and also to be part of RSS
> > * queue index for this port.
> > */
> > -if (conf_info->queue_region_number) {
> > +if (conf_info->queue_region_number && rss->queue_num > 0) {
> > for (i = 0; i < rss->queue_num; i++) { for (j = 0; j <
> > rss_info->conf.queue_num; j++) { if (rss->queue[i] ==
> > rss_info->conf.queue[j]) @@ -4579,7 +4604,8 @@
> > i40e_flow_parse_rss_action(struct rte_eth_dev *dev, }
> >
> > /* Parse queue region related parameters from configuration */ -for
> > (n = 0; n < conf_info->queue_region_number; n++) {
> > +for (n = 0; n < conf_info->queue_region_number &&
> > +rss->queue_num > 0; n++) {
> > if (conf_info->region[n].user_priority_num ||
> > conf_info->region[n].flowtype_num) {
> > if (!((rte_is_power_of_2(rss->queue_num)) && @@ -
> > 4674,14 +4700,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
> > if (rss_config->queue_region_conf) return 0;
> >
> > -if (!rss || !rss->queue_num) {
> > -rte_flow_error_set(error, EINVAL,
> > -RTE_FLOW_ERROR_TYPE_ACTION,
> > -act,
> > -"no valid queues");
> > -return -rte_errno;
> > -}
> > -
> > for (n = 0; n < rss->queue_num; n++) { if (rss->queue[n] >=
> > dev->data->nb_rx_queues) { rte_flow_error_set(error, EINVAL, @@
> > -4692,7 +4710,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
> > } }
> >
> > -if (rss_info->conf.queue_num) {
> > +if (rss_info->conf.queue_num && rss->queue_num) {
> > rte_flow_error_set(error, EINVAL,
> > RTE_FLOW_ERROR_TYPE_ACTION,
> > act,
> > @@ -4709,6 +4727,10 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
> > *dev, return rte_flow_error_set (error, ENOTSUP,
> > RTE_FLOW_ERROR_TYPE_ACTION, act,
> > "a nonzero RSS encapsulation level is not supported");
> > +if (rss->types > ETH_RSS_ESP)
> > +return rte_flow_error_set
> > +(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
> > act,
> > + "pctype greater than max allowed");
>
> At the patch(http://patchwork.dpdk.org/project/dpdk/list/?series=9005),
> the hash input set will be enable.
> So rss->types may has the value ETH_RSS_L3_SRC_ONLY (1ULL << 63) and
> ETH_RSS_L3_DST_ONLY (1ULL << 62) and ETH_RSS_L4_SRC_ONLY (1ULL <<
> 61) and ETH_RSS_L4_DST_ONLY (1ULL << 60).
>
> > if (rss->key_len && rss->key_len > RTE_DIM(rss_config->key)) return
> > rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
> act,
> > --
> > 2.7.4
>
Yes, I will need to rework this patch based on top of your patch.
Regards,
Bernard.
next prev parent reply other threads:[~2020-03-24 9:48 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 12:38 [dpdk-dev] [PATCH 0/3] configure RSS hash Bernard Iremonger
2020-03-18 12:38 ` [dpdk-dev] [PATCH 1/3] librte_ethdev: add RSS offload types for ESP and AH Bernard Iremonger
2020-03-18 12:38 ` [dpdk-dev] [PATCH 2/3] app/testpmd: handle RSS offload types " Bernard Iremonger
2020-03-18 12:38 ` [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS action Bernard Iremonger
[not found] ` <e0bea82c974e4d238a6e318093818363@intel.com>
2020-03-24 9:47 ` Iremonger, Bernard [this message]
2020-03-25 15:55 ` [dpdk-dev] [PATCH v2 0/3] configure RSS hash Bernard Iremonger
2020-03-31 13:56 ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
2020-04-15 11:14 ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
2020-04-16 14:30 ` Ferruh Yigit
2020-04-15 11:14 ` [dpdk-dev] [PATCH v4 1/3] librte_ethdev: add RSS offload types for ESP and AH Bernard Iremonger
2020-04-16 1:14 ` Xing, Beilei
2020-04-16 14:30 ` Ferruh Yigit
2020-04-16 13:26 ` Dong Zhou
2020-04-16 14:30 ` Ferruh Yigit
2020-04-16 14:38 ` Iremonger, Bernard
2020-04-15 11:14 ` [dpdk-dev] [PATCH v4 2/3] app/testpmd: handle RSS offload types " Bernard Iremonger
2020-04-15 11:14 ` [dpdk-dev] [PATCH v4 3/3] net/i40e: add ESP patterns Bernard Iremonger
2020-04-16 1:13 ` Xing, Beilei
2020-03-31 13:56 ` [dpdk-dev] [PATCH v3 1/3] librte_ethdev: add RSS offload types for ESP and AH Bernard Iremonger
2020-04-15 2:09 ` Xing, Beilei
2020-03-31 13:56 ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: handle RSS offload types " Bernard Iremonger
2020-04-02 11:49 ` Ori Kam
2020-03-31 13:56 ` [dpdk-dev] [PATCH v3 3/3] net/i40e: add ESP patterns Bernard Iremonger
2020-03-25 15:55 ` [dpdk-dev] [PATCH v2 1/3] librte_ethdev: add RSS offload types for ESP and AH Bernard Iremonger
2020-03-25 15:55 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: handle RSS offload types " Bernard Iremonger
2020-03-31 9:57 ` Ori Kam
2020-03-31 11:03 ` Iremonger, Bernard
2020-03-25 15:55 ` [dpdk-dev] [PATCH v2 3/3] net/i40e: add ESP patterns Bernard Iremonger
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=DM6PR11MB3914D8BFCA4938D7B60F1D85EFF10@DM6PR11MB3914.namprd11.prod.outlook.com \
--to=bernard.iremonger@intel.com \
--cc=beilei.xing@intel.com \
--cc=chenxux.di@intel.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=qi.z.zhang@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).