patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix the wrong representor ID checking for sample
@ 2021-06-29  6:59 Jiawei Wang
  2021-06-30  7:45 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawei Wang @ 2021-06-29  6:59 UTC (permalink / raw)
  To: viacheslavo, matan, orika, thomas, Shahaf Shuler, Xueming Li
  Cc: dev, rasland, stable

The representor definition was introduced in the latest code.
For non-representor port, like PF port, use the 0xffff instead of -1.

This patch updates the representor id checking during splitting sample
flow.

Fixes: cb95feefdd03 ("net/mlx5: support sub-function representor")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
---
 drivers/net/mlx5/mlx5.h         | 2 +-
 drivers/net/mlx5/mlx5_flow.c    | 4 ++--
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 32b2817bf2..1b2dc8f815 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1331,7 +1331,7 @@ struct mlx5_priv {
 	uint16_t vport_id; /* Associated VF vport index (if any). */
 	uint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */
 	uint32_t vport_meta_mask; /* Used for vport index field match mask. */
-	int32_t representor_id; /* -1 if not a representor. */
+	uint16_t representor_id; /* UINT16_MAX if not a representor. */
 	int32_t pf_bond; /* >=0, representor owner PF index in bonding. */
 	unsigned int if_index; /* Associated kernel network device index. */
 	/* RX/TX queues. */
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index c5d4a95a8f..3b7c94d92f 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5900,8 +5900,8 @@ flow_create_split_sample(struct rte_eth_dev *dev,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL, "no memory to split "
 						  "sample flow");
-		/* The representor_id is -1 for uplink. */
-		fdb_tx = (attr->transfer && priv->representor_id != -1);
+		/* The representor_id is UINT16_MAX for uplink. */
+		fdb_tx = (attr->transfer && priv->representor_id != UINT16_MAX);
 		/*
 		 * When reg_c_preserve is set, metadata registers Cx preserve
 		 * their value even through packet duplication.
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index c5d4b01e57..929d006dd8 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5524,7 +5524,7 @@ flow_dv_validate_action_sample(uint64_t *action_flags,
 						  "E-Switch must has a dest "
 						  "port for mirroring");
 		if (!priv->config.hca_attr.reg_c_preserve &&
-		     priv->representor_id != -1)
+		     priv->representor_id != UINT16_MAX)
 			*fdb_mirror_limit = 1;
 	}
 	/* Continue validation for Xcap actions.*/
-- 
2.18.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/mlx5: fix the wrong representor ID checking for sample
  2021-06-29  6:59 [dpdk-stable] [PATCH] net/mlx5: fix the wrong representor ID checking for sample Jiawei Wang
@ 2021-06-30  7:45 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2021-06-30  7:45 UTC (permalink / raw)
  To: Jiawei(Jonny) Wang, Slava Ovsiienko, Matan Azrad, Ori Kam,
	NBU-Contact-Thomas Monjalon, Shahaf Shuler, Xueming(Steven) Li
  Cc: dev, stable

Hi,

> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Tuesday, June 29, 2021 10:00 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-Thomas
> Monjalon <thomas@monjalon.net>; Shahaf Shuler <shahafs@nvidia.com>;
> Xueming(Steven) Li <xuemingl@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix the wrong representor ID checking for sample
> 
> The representor definition was introduced in the latest code.
> For non-representor port, like PF port, use the 0xffff instead of -1.
> 
> This patch updates the representor id checking during splitting sample flow.
> 
> Fixes: cb95feefdd03 ("net/mlx5: support sub-function representor")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Xueming Li <xuemingl@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-30  7:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  6:59 [dpdk-stable] [PATCH] net/mlx5: fix the wrong representor ID checking for sample Jiawei Wang
2021-06-30  7:45 ` Raslan Darawsheh

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git