[dpdk-dev] [dpdk-stable] [PATCH] net/mlx5: fix VF MAC address set over Bluefield

Raslan Darawsheh rasland at mellanox.com
Thu Jul 23 12:55:35 CEST 2020


Hi,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit at intel.com>
> Sent: Thursday, July 23, 2020 1:44 PM
> To: Raslan Darawsheh <rasland at mellanox.com>; dev at dpdk.org
> Cc: stable at dpdk.org; Slava Ovsiienko <viacheslavo at 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 at dpdk.org
> >
> > Signed-off-by: Raslan Darawsheh <rasland at mellanox.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo at 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


More information about the dev mailing list