patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield
@ 2020-07-22  9:07 Raslan Darawsheh
  2020-07-23  8:57 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Raslan Darawsheh @ 2020-07-22  9:07 UTC (permalink / raw)
  To: dev; +Cc: stable, Viacheslav Ovsiienko

When trying to set MAC address of an ethethet device and if it was
a representor, PMD sets the MAC over the corresponding VF instead.

For the case of HPF (Host PF representor on BluueField), PMD shouldn't
attempt to set it, since it doesn't have any corresponding VF and fails.

This will fix the issue by setting the MAC on the dev directly.

Fixes: 0d1d73170820 ("net/mlx5: set VF MAC address from host")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_mac.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 2d808d629..c75b1a169 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -157,8 +157,11 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
 	uint16_t port_id;
 	struct mlx5_priv *priv = dev->data->dev_private;
 
-	/* Configuring the VF instead of its representor. */
-	if (priv->representor) {
+	/*
+	 * Configuring the VF instead of its representor,
+	 * need to skip the special case of HPF on Bluefield.
+	 */
+	if (priv->representor && priv->representor >= 0) {
 		DRV_LOG(DEBUG, "VF represented by port %u setting primary MAC address",
 			dev->data->port_id);
 		RTE_ETH_FOREACH_DEV_SIBLING(port_id, dev->data->port_id) {
-- 
2.27.0


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix VF MAC address set over Bluefield
  2020-07-22  9:07 [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield Raslan Darawsheh
@ 2020-07-23  8:57 ` Raslan Darawsheh
  2020-07-23 10:43 ` [dpdk-stable] " Ferruh Yigit
  2020-07-23 11:06 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
  2 siblings, 0 replies; 6+ messages in thread
From: Raslan Darawsheh @ 2020-07-23  8:57 UTC (permalink / raw)
  To: Raslan Darawsheh, dev; +Cc: stable, Slava Ovsiienko

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Raslan Darawsheh
> Sent: Wednesday, July 22, 2020 12:08 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Slava Ovsiienko <viacheslavo@mellanox.com>
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix VF MAC address set over Bluefield
> 
> When trying to set MAC address of an ethethet device and if it was
> a representor, PMD sets the MAC over the corresponding VF instead.
> 
> For the case of HPF (Host PF representor on BluueField), PMD shouldn't
> attempt to set it, since it doesn't have any corresponding VF and fails.
> 
> This will fix the issue by setting the MAC on the dev directly.
> 
> Fixes: 0d1d73170820 ("net/mlx5: set VF MAC address from host")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_mac.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
> index 2d808d629..c75b1a169 100644
> --- a/drivers/net/mlx5/mlx5_mac.c
> +++ b/drivers/net/mlx5/mlx5_mac.c
> @@ -157,8 +157,11 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct
> rte_ether_addr *mac_addr)
>  	uint16_t port_id;
>  	struct mlx5_priv *priv = dev->data->dev_private;
> 
> -	/* Configuring the VF instead of its representor. */
> -	if (priv->representor) {
> +	/*
> +	 * Configuring the VF instead of its representor,
> +	 * need to skip the special case of HPF on Bluefield.
> +	 */
> +	if (priv->representor && priv->representor >= 0) {
>  		DRV_LOG(DEBUG, "VF represented by port %u setting
> primary MAC address",
>  			dev->data->port_id);
>  		RTE_ETH_FOREACH_DEV_SIBLING(port_id, dev->data-
> >port_id) {
> --
> 2.27.0


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield
  2020-07-22  9:07 [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield Raslan Darawsheh
  2020-07-23  8:57 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
@ 2020-07-23 10:43 ` Ferruh Yigit
  2020-07-23 10:55   ` Raslan Darawsheh
  2020-07-23 11:06 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
  2 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2020-07-23 10:43 UTC (permalink / raw)
  To: Raslan Darawsheh, dev; +Cc: stable, Viacheslav Ovsiienko

On 7/22/2020 10:07 AM, Raslan Darawsheh wrote:
> When trying to set MAC address of an ethethet device and if it was
> a representor, PMD sets the MAC over the corresponding VF instead.
> 
> For the case of HPF (Host PF representor on BluueField), PMD shouldn't
> attempt to set it, since it doesn't have any corresponding VF and fails.
> 
> This will fix the issue by setting the MAC on the dev directly.
> 
> Fixes: 0d1d73170820 ("net/mlx5: set VF MAC address from host")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_mac.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
> index 2d808d629..c75b1a169 100644
> --- a/drivers/net/mlx5/mlx5_mac.c
> +++ b/drivers/net/mlx5/mlx5_mac.c
> @@ -157,8 +157,11 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
>  	uint16_t port_id;
>  	struct mlx5_priv *priv = dev->data->dev_private;
>  
> -	/* Configuring the VF instead of its representor. */
> -	if (priv->representor) {
> +	/*
> +	 * Configuring the VF instead of its representor,
> +	 * need to skip the special case of HPF on Bluefield.
> +	 */
> +	if (priv->representor && priv->representor >= 0) {


'priv->representor' is 1 bit size bitfield (unsigned int representor:1), what is
the point of additional ">=0" check?
Can it be "representor_id >= 0" by any chance?

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

* Re: [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield
  2020-07-23 10:43 ` [dpdk-stable] " Ferruh Yigit
@ 2020-07-23 10:55   ` Raslan Darawsheh
  0 siblings, 0 replies; 6+ messages in thread
From: Raslan Darawsheh @ 2020-07-23 10:55 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: stable, Slava Ovsiienko

Hi,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Thursday, July 23, 2020 1:44 PM
> To: Raslan Darawsheh <rasland@mellanox.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Slava Ovsiienko <viacheslavo@mellanox.com>
> Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over
> Bluefield
> 
> On 7/22/2020 10:07 AM, Raslan Darawsheh wrote:
> > When trying to set MAC address of an ethethet device and if it was
> > a representor, PMD sets the MAC over the corresponding VF instead.
> >
> > For the case of HPF (Host PF representor on BluueField), PMD shouldn't
> > attempt to set it, since it doesn't have any corresponding VF and fails.
> >
> > This will fix the issue by setting the MAC on the dev directly.
> >
> > Fixes: 0d1d73170820 ("net/mlx5: set VF MAC address from host")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> > ---
> >  drivers/net/mlx5/mlx5_mac.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
> > index 2d808d629..c75b1a169 100644
> > --- a/drivers/net/mlx5/mlx5_mac.c
> > +++ b/drivers/net/mlx5/mlx5_mac.c
> > @@ -157,8 +157,11 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev,
> struct rte_ether_addr *mac_addr)
> >  	uint16_t port_id;
> >  	struct mlx5_priv *priv = dev->data->dev_private;
> >
> > -	/* Configuring the VF instead of its representor. */
> > -	if (priv->representor) {
> > +	/*
> > +	 * Configuring the VF instead of its representor,
> > +	 * need to skip the special case of HPF on Bluefield.
> > +	 */
> > +	if (priv->representor && priv->representor >= 0) {
> 
> 
> 'priv->representor' is 1 bit size bitfield (unsigned int representor:1), what is
> the point of additional ">=0" check?
> Can it be "representor_id >= 0" by any chance?
Yes it should be representor_id >= 0, will fix 

Kindest regards
Raslan Darawsheh

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

* [dpdk-stable] [PATCH v2] net/mlx5: fix VF MAC address set over Bluefield
  2020-07-22  9:07 [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield Raslan Darawsheh
  2020-07-23  8:57 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  2020-07-23 10:43 ` [dpdk-stable] " Ferruh Yigit
@ 2020-07-23 11:06 ` Raslan Darawsheh
  2020-07-23 11:25   ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  2 siblings, 1 reply; 6+ messages in thread
From: Raslan Darawsheh @ 2020-07-23 11:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable, Viacheslav Ovsiienko

When trying to set MAC address of an ethethet device and if it was
a representor, PMD sets the MAC over the corresponding VF instead.

For the case of HPF (Host PF representor on BluueField), PMD shouldn't
attempt to set it, since it doesn't have any corresponding VF and fails.

This will fix the issue by setting the MAC on the dev directly.

Fixes: 0d1d73170820 ("net/mlx5: set VF MAC address from host")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
v2: fix the use of representor bit to use the representor id instead
---
 drivers/net/mlx5/mlx5_mac.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 2d808d629..88c52b29f 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -157,8 +157,11 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
 	uint16_t port_id;
 	struct mlx5_priv *priv = dev->data->dev_private;
 
-	/* Configuring the VF instead of its representor. */
-	if (priv->representor) {
+	/*
+	 * Configuring the VF instead of its representor,
+	 * need to skip the special case of HPF on Bluefield.
+	 */
+	if (priv->representor && priv->representor_id >= 0) {
 		DRV_LOG(DEBUG, "VF represented by port %u setting primary MAC address",
 			dev->data->port_id);
 		RTE_ETH_FOREACH_DEV_SIBLING(port_id, dev->data->port_id) {
-- 
2.27.0


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/mlx5: fix VF MAC address set over Bluefield
  2020-07-23 11:06 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
@ 2020-07-23 11:25   ` Raslan Darawsheh
  0 siblings, 0 replies; 6+ messages in thread
From: Raslan Darawsheh @ 2020-07-23 11:25 UTC (permalink / raw)
  To: Raslan Darawsheh, dev; +Cc: ferruh.yigit, stable, Slava Ovsiienko

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Raslan Darawsheh
> Sent: Thursday, July 23, 2020 2:06 PM
> To: dev@dpdk.org
> Cc: ferruh.yigit@intel.com; stable@dpdk.org; Slava Ovsiienko
> <viacheslavo@mellanox.com>
> Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix VF MAC address set over
> Bluefield
> 
> When trying to set MAC address of an ethethet device and if it was
> a representor, PMD sets the MAC over the corresponding VF instead.
> 
> For the case of HPF (Host PF representor on BluueField), PMD shouldn't
> attempt to set it, since it doesn't have any corresponding VF and fails.
> 
> This will fix the issue by setting the MAC on the dev directly.
> 
> Fixes: 0d1d73170820 ("net/mlx5: set VF MAC address from host")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
> v2: fix the use of representor bit to use the representor id instead
> ---
>  drivers/net/mlx5/mlx5_mac.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
> index 2d808d629..88c52b29f 100644
> --- a/drivers/net/mlx5/mlx5_mac.c
> +++ b/drivers/net/mlx5/mlx5_mac.c
> @@ -157,8 +157,11 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct
> rte_ether_addr *mac_addr)
>  	uint16_t port_id;
>  	struct mlx5_priv *priv = dev->data->dev_private;
> 
> -	/* Configuring the VF instead of its representor. */
> -	if (priv->representor) {
> +	/*
> +	 * Configuring the VF instead of its representor,
> +	 * need to skip the special case of HPF on Bluefield.
> +	 */
> +	if (priv->representor && priv->representor_id >= 0) {
>  		DRV_LOG(DEBUG, "VF represented by port %u setting
> primary MAC address",
>  			dev->data->port_id);
>  		RTE_ETH_FOREACH_DEV_SIBLING(port_id, dev->data-
> >port_id) {
> --
> 2.27.0


Removed V1 from next-net-mlx, 
And V2 is applied with the fix.

Kindest regards
Raslan Darawsheh

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

end of thread, other threads:[~2020-07-23 11:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22  9:07 [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield Raslan Darawsheh
2020-07-23  8:57 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
2020-07-23 10:43 ` [dpdk-stable] " Ferruh Yigit
2020-07-23 10:55   ` Raslan Darawsheh
2020-07-23 11:06 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
2020-07-23 11:25   ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh

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