DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: Suanming Mou <suanmingm@nvidia.com>,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Ori Kam <orika@nvidia.com>, Matan Azrad <matan@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Raslan Darawsheh <rasland@nvidia.com>
Subject: RE: [PATCH 3/3] net/mlx5: allow FDB RSS
Date: Wed, 26 Feb 2025 14:00:00 +0000	[thread overview]
Message-ID: <PH7PR12MB690585351CFF3CCD1791A02CD0C22@PH7PR12MB6905.namprd12.prod.outlook.com> (raw)
In-Reply-To: <PH8PR12MB73268FD5C626A333580DD980C1C22@PH8PR12MB7326.namprd12.prod.outlook.com>

Hi



> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Wednesday, February 26, 2025 9:43 PM
> To: Bing Zhao <bingz@nvidia.com>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam
> <orika@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: RE: [PATCH 3/3] net/mlx5: allow FDB RSS
> 
> 
> 
> > -----Original Message-----
> > From: Bing Zhao <bingz@nvidia.com>
> > Sent: Wednesday, February 26, 2025 6:50 PM
> > To: Suanming Mou <suanmingm@nvidia.com>; Dariusz Sosnowski
> > <dsosnowski@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori
> > Kam <orika@nvidia.com>; Matan Azrad <matan@nvidia.com>
> > Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> > Subject: RE: [PATCH 3/3] net/mlx5: allow FDB RSS
> >
> >
> >
> > > -----Original Message-----
> > > From: Suanming Mou <suanmingm@nvidia.com>
> > > Sent: Tuesday, February 25, 2025 8:45 AM
> > > To: Dariusz Sosnowski <dsosnowski@nvidia.com>; Slava Ovsiienko
> > > <viacheslavo@nvidia.com>; Bing Zhao <bingz@nvidia.com>; Ori Kam
> > > <orika@nvidia.com>; Matan Azrad <matan@nvidia.com>
> > > Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> > > Subject: [PATCH 3/3] net/mlx5: allow FDB RSS
> > >
> > > RSS can be used in FDB Rx rules when JUMP_FDB_RX action to allow
> > > jump from FDB Tx to FDB Rx table.
> > >
> > > Different with NIC RSS, FDB RSS will not do the internal implicit
> > > metadata copy.
> > >
> > > This commit enables the FDB RSS if JUMP_FDB_RX is supported.
> > >
> > > Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> > > ---
> > >  drivers/net/mlx5/mlx5_flow.c    |  4 ++--
> > >  drivers/net/mlx5/mlx5_flow_dv.c | 32
> > > +++++++++++++++++--------------- drivers/net/mlx5/mlx5_flow_hw.c |
> > > 19 ++++++++++++++-----
> > >  3 files changed, 33 insertions(+), 22 deletions(-)
> > >
> > > diff --git a/drivers/net/mlx5/mlx5_flow.c
> > > b/drivers/net/mlx5/mlx5_flow.c index 3fbe89a9d4..9c6a4f39fb 100644
> > > --- a/drivers/net/mlx5/mlx5_flow.c
> > > +++ b/drivers/net/mlx5/mlx5_flow.c
> > > @@ -1977,9 +1977,9 @@ mlx5_flow_validate_action_mark(struct
> > > rte_eth_dev *dev,
> > >  					  RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,
> > >  					  "mark action not supported for "
> > >  					  "egress");
> > > -	if (attr->transfer && mlx5_hws_active(dev))
> > > +	if (attr->transfer && !mlx5_hws_active(dev))
> > >  		return rte_flow_error_set(error, ENOTSUP,
> > > -					  RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,
> > > +					  RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, NULL,
> > >  					  "non-template mark action not supported
> for
> > transfer");
> > >  	return 0;
> > >  }
> > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> > > b/drivers/net/mlx5/mlx5_flow_dv.c index 633c41e358..61d3101ce8
> > 100644
> > > --- a/drivers/net/mlx5/mlx5_flow_dv.c
> > > +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> > > @@ -8939,21 +8939,23 @@ flow_dv_validate(struct rte_eth_dev *dev,
> > > const struct rte_flow_attr *attr,
> > >  						  RTE_FLOW_ERROR_TYPE_ACTION,
> > >  						  NULL,
> > >  						  "unsupported action MARK");
> > > -		if (action_flags & MLX5_FLOW_ACTION_QUEUE)
> > > -			return rte_flow_error_set(error, ENOTSUP,
> > > -						  RTE_FLOW_ERROR_TYPE_ACTION,
> > > -						  NULL,
> > > -						  "unsupported action QUEUE");
> > > -		if (action_flags & MLX5_FLOW_ACTION_RSS)
> > > -			return rte_flow_error_set(error, ENOTSUP,
> > > -						  RTE_FLOW_ERROR_TYPE_ACTION,
> > > -						  NULL,
> > > -						  "unsupported action RSS");
> > > -		if (!(action_flags & MLX5_FLOW_FATE_ESWITCH_ACTIONS))
> > > -			return rte_flow_error_set(error, EINVAL,
> > > -						  RTE_FLOW_ERROR_TYPE_ACTION,
> > > -						  actions,
> > > -						  "no fate action is found");
> > > +		if (!priv->jump_fdb_rx_en) {
> > > +			if (action_flags & MLX5_FLOW_ACTION_QUEUE)
> > > +				return rte_flow_error_set(error, ENOTSUP,
> > > +							  RTE_FLOW_ERROR_TYPE_ACTION,
> > > +							  NULL,
> > > +							  "unsupported action QUEUE");
> > > +			if (action_flags & MLX5_FLOW_ACTION_RSS)
> > > +				return rte_flow_error_set(error, ENOTSUP,
> > > +							  RTE_FLOW_ERROR_TYPE_ACTION,
> > > +							  NULL,
> > > +							  "unsupported action RSS");
> > > +			if (!(action_flags & MLX5_FLOW_FATE_ESWITCH_ACTIONS))
> > > +				return rte_flow_error_set(error, EINVAL,
> > > +							  RTE_FLOW_ERROR_TYPE_ACTION,
> > > +							  actions,
> > > +							  "no fate action is found");
> > > +		}
> > >  	} else {
> > >  		if (!(action_flags & MLX5_FLOW_FATE_ACTIONS) && attr->ingress)
> > >  			return rte_flow_error_set(error, EINVAL, diff --git
> > > a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
> > > index 83f55ed3e8..a063e5ac9c 100644
> > > --- a/drivers/net/mlx5/mlx5_flow_hw.c
> > > +++ b/drivers/net/mlx5/mlx5_flow_hw.c
> > > @@ -7026,6 +7026,7 @@ mlx5_hw_validate_action_queue(struct
> > rte_eth_dev
> > > *dev,
> > >  			      uint64_t action_flags,
> > >  			      struct rte_flow_error *error)  {
> > > +	struct mlx5_priv *priv = dev->data->dev_private;
> > >  	const struct rte_flow_action_queue *queue_mask = template_mask-
> > > >conf;
> > >  	const struct rte_flow_attr attr = {
> > >  		.ingress = template_attr->ingress, @@ -7034,7 +7035,7 @@
> > > mlx5_hw_validate_action_queue(struct
> > rte_eth_dev
> > > *dev,
> > >  	};
> > >  	bool masked = queue_mask != NULL && queue_mask->index;
> > >
> > > -	if (template_attr->egress || template_attr->transfer)
> > > +	if (template_attr->egress || (template_attr->transfer &&
> > > +!priv->jump_fdb_rx_en))
> > >  		return rte_flow_error_set(error, EINVAL,
> > >  					  RTE_FLOW_ERROR_TYPE_ATTR, NULL,
> > >  					  "QUEUE action supported for ingress
> only"); @@
> > -7053,9
> > > +7054,10 @@ mlx5_hw_validate_action_rss(struct
> > > rte_eth_dev *dev,
> > >  			      __rte_unused uint64_t action_flags,
> > >  			      struct rte_flow_error *error)  {
> > > +	struct mlx5_priv *priv = dev->data->dev_private;
> > >  	const struct rte_flow_action_rss *mask = template_mask->conf;
> > >
> > > -	if (template_attr->egress || template_attr->transfer)
> > > +	if (template_attr->egress || (template_attr->transfer &&
> > > +!priv->jump_fdb_rx_en))
> > >  		return rte_flow_error_set(error, EINVAL,
> > >  					  RTE_FLOW_ERROR_TYPE_ATTR, NULL,
> > >  					  "RSS action supported for ingress only");
> @@
> > -8104,6 +8106,7
> > > @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev,
> > >  	}
> > >  	if (priv->sh->config.dv_xmeta_en ==
> > MLX5_XMETA_MODE_META32_HWS &&
> > >  	    priv->sh->config.dv_esw_en &&
> > > +	    !attr->transfer &&
> > >  	    (action_flags & (MLX5_FLOW_ACTION_QUEUE |
> > > MLX5_FLOW_ACTION_RSS))) {
> > >  		/* Insert META copy */
> > >  		mf_actions[expand_mf_num] = rx_meta_copy_action; @@
> > -12112,23
> > > +12115,29 @@ __flow_hw_configure(struct rte_eth_dev *dev,
> > >  	/* Add global actions. */
> > >  	for (i = 0; i < MLX5_HW_ACTION_FLAG_MAX; i++) {
> > >  		uint32_t act_flags = 0;
> > > +		uint32_t tag_flags = mlx5_hw_act_flag[i][0];
> > >
> > >  		act_flags = mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_RX] |
> > >  			    mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_TX];
> > >  		if (is_proxy) {
> > > -			if (unified_fdb)
> > > +			if (unified_fdb) {
> > >  				act_flags |=
> > >
> > > 	(mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX] |
> > >
> > > mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_TX] |
> > >
> > > mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_UNIFIED]);
> > > -			else
> > > +				if (i == MLX5_HW_ACTION_FLAG_NONE_ROOT)
> > > +					tag_flags |=
> > > mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX];
> > > +			} else {
> > >  				act_flags |=
> > > mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
> > > +				if (i == MLX5_HW_ACTION_FLAG_NONE_ROOT)
> > > +					tag_flags |=
> > > mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
> > > +			}
> > >  		}
> >
> > One small question about the TAG action flags in this case. If unified
> > FDB is supported, should only FDB_RX sub-domain of all FDB sub-domains
> > support the TAG? Or FDB_UNI also supports it. And if no unified FDB,
> > will the TAG also be supported in the legacy FDB domain? Can we add
> > some code comments here and update the limitation?
> Yes, it is allowed only in unified FDB Rx domain. Let's do this.
> 
> >
> > >  		priv->hw_drop[i] = mlx5dr_action_create_dest_drop(priv-
> > > >dr_ctx, act_flags);
> > >  		if (!priv->hw_drop[i])
> > >  			goto err;
> > >  		priv->hw_tag[i] = mlx5dr_action_create_tag
> > > -			(priv->dr_ctx, mlx5_hw_act_flag[i][0]);
> > > +			(priv->dr_ctx, tag_flags);
> > >  		if (!priv->hw_tag[i])
> > >  			goto err;
> > >  	}
> > > --
> > > 2.34.1

This should be with V2 version prefix.
Series Acked-by: Bing Zhao <bingz@nvidia.com>


  reply	other threads:[~2025-02-26 14:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25  0:45 [PATCH 0/3] net/mlx5: support jump FDB Rx Suanming Mou
2025-02-25  0:45 ` [PATCH 1/3] net/mlx5/hws: " Suanming Mou
2025-02-26 10:28   ` Bing Zhao
2025-02-26 13:31     ` Suanming Mou
2025-02-25  0:45 ` [PATCH 2/3] net/mlx5: add jump FDB Rx flag Suanming Mou
2025-02-26 10:37   ` Bing Zhao
2025-02-26 13:36     ` Suanming Mou
2025-02-25  0:45 ` [PATCH 3/3] net/mlx5: allow FDB RSS Suanming Mou
2025-02-26 10:49   ` Bing Zhao
2025-02-26 13:43     ` Suanming Mou
2025-02-26 14:00       ` Bing Zhao [this message]
2025-02-26 14:01 ` [PATCH v2 0/3] net/mlx5: support jump FDB Rx Suanming Mou
2025-02-26 14:01   ` [PATCH v2 1/3] net/mlx5/hws: " Suanming Mou
2025-02-26 18:12     ` Bing Zhao
2025-02-26 14:01   ` [PATCH v2 2/3] net/mlx5: add jump FDB Rx flag Suanming Mou
2025-02-26 14:01   ` [PATCH v2 3/3] net/mlx5: allow FDB RSS Suanming Mou
2025-02-26 16:04   ` [PATCH v3 0/3] net/mlx5: support jump FDB Rx Dariusz Sosnowski
2025-02-26 16:04     ` [PATCH v3 1/3] net/mlx5/hws: " Dariusz Sosnowski
2025-02-26 16:04     ` [PATCH v3 2/3] net/mlx5: add jump FDB Rx flag Dariusz Sosnowski
2025-02-26 16:04     ` [PATCH v3 3/3] net/mlx5: allow FDB RSS Dariusz Sosnowski
2025-02-26 16:53     ` [PATCH v3 0/3] net/mlx5: support jump FDB Rx Raslan Darawsheh
2025-02-26 18:13     ` Bing Zhao

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=PH7PR12MB690585351CFF3CCD1791A02CD0C22@PH7PR12MB6905.namprd12.prod.outlook.com \
    --to=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@nvidia.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).