DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding
@ 2020-11-04  6:04 Bill Zhou
  2020-11-08  9:49 ` Raslan Darawsheh
  2020-11-13 18:54 ` Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Bill Zhou @ 2020-11-04  6:04 UTC (permalink / raw)
  To: viacheslavo, matan; +Cc: stable, dev, rasland, Bill Zhou

From: Bill Zhou <dongzhou@nvidia.com>

In the bonding configurations the port switch id for representors
was composed of pf index in bonding as the 1 msb and the representor's
index as the remaining 15 lsbs. The special corner case for the host
PF representor on BF setups with representor id 0xFFFF was missed as well.

The new switch port id consists of 4 msbs for the pf bonding index and
the remaining 12 lsbs for the representor index. The switch port id ranges
for each type of representors are as follows:

Uplink representor(AKA master): 0xFFFF
Host PF representor: 0x<pf_bond>FFF
VF representor: 0x<pf_bond>[0-FFE]

Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding configuration")
Cc: stable@dpdk.org

Signed-off-by: Bill Zhou <dongzhou@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_defs.h   |  2 +-
 drivers/net/mlx5/mlx5_ethdev.c | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 4980352..f8f8a1f 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -50,7 +50,7 @@
 
 /* Switch port ID parameters for bonding configurations. */
 #define MLX5_PORT_ID_BONDING_PF_MASK 0xf
-#define MLX5_PORT_ID_BONDING_PF_SHIFT 0xf
+#define MLX5_PORT_ID_BONDING_PF_SHIFT 12
 
 /* Alarm timeout. */
 #define MLX5_ALARM_TIMEOUT_US 100000
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index ee97480..a3910cf 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -338,14 +338,22 @@
 			 * representors (more than 4K) or PFs (more than 15)
 			 * this approach must be reconsidered.
 			 */
-			if ((info->switch_info.port_id >>
-				MLX5_PORT_ID_BONDING_PF_SHIFT) ||
+			/* Switch port ID for VF representors: 0 - 0xFFE */
+			if ((info->switch_info.port_id != 0xffff &&
+				info->switch_info.port_id >=
+				((1 << MLX5_PORT_ID_BONDING_PF_SHIFT) - 1)) ||
 			    priv->pf_bond > MLX5_PORT_ID_BONDING_PF_MASK) {
 				DRV_LOG(ERR, "can't update switch port ID"
 					     " for bonding device");
 				MLX5_ASSERT(false);
 				return -ENODEV;
 			}
+			/*
+			 * Switch port ID for Host PF representor
+			 * (representor_id is -1) , set to 0xFFF
+			 */
+			if (info->switch_info.port_id == 0xffff)
+				info->switch_info.port_id = 0xfff;
 			info->switch_info.port_id |=
 				priv->pf_bond << MLX5_PORT_ID_BONDING_PF_SHIFT;
 		}
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding
  2020-11-04  6:04 [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding Bill Zhou
@ 2020-11-08  9:49 ` Raslan Darawsheh
  2020-11-13 18:54 ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2020-11-08  9:49 UTC (permalink / raw)
  To: Bill Zhou, Slava Ovsiienko, Matan Azrad; +Cc: stable, dev, Bill Zhou

Hi,

> -----Original Message-----
> From: Bill Zhou <dongz@mellanox.com>
> Sent: Wednesday, November 4, 2020 8:05 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: stable@dpdk.org; dev@dpdk.org; Raslan Darawsheh
> <rasland@nvidia.com>; Bill Zhou <dongzhou@nvidia.com>
> Subject: [PATCH] net/mlx5: fix switch port id when representor in bonding
> 
> From: Bill Zhou <dongzhou@nvidia.com>
> 
> In the bonding configurations the port switch id for representors
> was composed of pf index in bonding as the 1 msb and the representor's
> index as the remaining 15 lsbs. The special corner case for the host
> PF representor on BF setups with representor id 0xFFFF was missed as well.
> 
> The new switch port id consists of 4 msbs for the pf bonding index and
> the remaining 12 lsbs for the representor index. The switch port id ranges
> for each type of representors are as follows:
> 
> Uplink representor(AKA master): 0xFFFF
> Host PF representor: 0x<pf_bond>FFF
> VF representor: 0x<pf_bond>[0-FFE]
> 
> Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding
> configuration")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bill Zhou <dongzhou@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding
  2020-11-04  6:04 [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding Bill Zhou
  2020-11-08  9:49 ` Raslan Darawsheh
@ 2020-11-13 18:54 ` Ferruh Yigit
  2020-11-15 12:36   ` Bill Zhou
  1 sibling, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2020-11-13 18:54 UTC (permalink / raw)
  To: Bill Zhou, viacheslavo, matan, Thomas Monjalon
  Cc: stable, dev, rasland, Bill Zhou

On 11/4/2020 6:04 AM, Bill Zhou wrote:
> From: Bill Zhou <dongzhou@nvidia.com>
> 
> In the bonding configurations the port switch id for representors
> was composed of pf index in bonding as the 1 msb and the representor's
> index as the remaining 15 lsbs. The special corner case for the host
> PF representor on BF setups with representor id 0xFFFF was missed as well.
> 
> The new switch port id consists of 4 msbs for the pf bonding index and
> the remaining 12 lsbs for the representor index. The switch port id ranges
> for each type of representors are as follows:
> 
> Uplink representor(AKA master): 0xFFFF
> Host PF representor: 0x<pf_bond>FFF
> VF representor: 0x<pf_bond>[0-FFE]
> 
> Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding configuration")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bill Zhou <dongzhou@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Sign off tag is updated as following in the next-net, to keep consistent to 
previously used name:
  Signed-off-by: Dong Zhou <dongzhou@nvidia.com>


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding
  2020-11-13 18:54 ` Ferruh Yigit
@ 2020-11-15 12:36   ` Bill Zhou
  0 siblings, 0 replies; 4+ messages in thread
From: Bill Zhou @ 2020-11-15 12:36 UTC (permalink / raw)
  To: Ferruh Yigit, Slava Ovsiienko, Matan Azrad, NBU-Contact-Thomas Monjalon
  Cc: stable, dev, Raslan Darawsheh



> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Saturday, November 14, 2020 2:54 AM
> To: Bill Zhou <dongz@mellanox.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; NBU-Contact-
> Thomas Monjalon <thomas@monjalon.net>
> Cc: stable@dpdk.org; dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> Bill Zhou <dongzhou@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in
> bonding
> 
> On 11/4/2020 6:04 AM, Bill Zhou wrote:
> > From: Bill Zhou <dongzhou@nvidia.com>
> >
> > In the bonding configurations the port switch id for representors was
> > composed of pf index in bonding as the 1 msb and the representor's
> > index as the remaining 15 lsbs. The special corner case for the host
> > PF representor on BF setups with representor id 0xFFFF was missed as well.
> >
> > The new switch port id consists of 4 msbs for the pf bonding index and
> > the remaining 12 lsbs for the representor index. The switch port id
> > ranges for each type of representors are as follows:
> >
> > Uplink representor(AKA master): 0xFFFF Host PF representor:
> > 0x<pf_bond>FFF VF representor: 0x<pf_bond>[0-FFE]
> >
> > Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding
> > configuration")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bill Zhou <dongzhou@nvidia.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> Sign off tag is updated as following in the next-net, to keep consistent to
> previously used name:
>   Signed-off-by: Dong Zhou <dongzhou@nvidia.com>

Yes, it's fine.

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

end of thread, other threads:[~2020-11-15 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  6:04 [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding Bill Zhou
2020-11-08  9:49 ` Raslan Darawsheh
2020-11-13 18:54 ` Ferruh Yigit
2020-11-15 12:36   ` Bill Zhou

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).