[PATCH v6 5/5] net/mlx5: accept more unicast MAC addresses
Dariusz Sosnowski
dsosnowski at nvidia.com
Fri Sep 11 12:01:01 CEST 2026
> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Friday, September 11, 2026 11:55 AM
> To: Dariusz Sosnowski <dsosnowski at nvidia.com>
> Cc: dev at dpdk.org; rjarry at redhat.com; cfontain at redhat.com; Slava
> Ovsiienko <viacheslavo at nvidia.com>; Bing Zhao <bingz at nvidia.com>; Ori
> Kam <orika at nvidia.com>; Suanming Mou <suanmingm at nvidia.com>; Matan
> Azrad <matan at nvidia.com>
> Subject: Re: [PATCH v6 5/5] net/mlx5: accept more unicast MAC addresses
>
> External email: Use caution opening links or attachments
>
>
> Hello Dariusz,
>
> Thanks for the review.
>
> On Fri, 11 Sept 2026 at 11:00, Dariusz Sosnowski <dsosnowski at nvidia.com>
> wrote:
> > > @@ -1963,17 +1989,15 @@ mlx5_dev_spawn(struct rte_device
> *dpdk_dev,
> > > mlx5_flex_item_port_cleanup(eth_dev);
> > > mlx5_free(priv->ext_rxqs);
> > > mlx5_free(priv->ext_txqs);
> > > + mlx5_free(priv->mac);
> > > + eth_dev->data->mac_addrs = NULL;
> >
> > This can segfault because eth_dev is allocated later than priv.
> > Previous version of the error rollback accounted for that (where
> > mac_addrs was reset only if eth_dev != NULL).
> > The same logic applies in Windows code.
> >
> > Could you please revert that?
>
> Well, the code before looked fishy to me.
> Resetting mac_addrs if (eth_dev != NULL) outside of the if (priv !=
> NULL) block seems incorrect.
>
>
> > > + mlx5_free(priv->mac_own);
> > > mlx5_free(priv);
> > > if (eth_dev != NULL)
> > > eth_dev->data->dev_private = NULL;
>
> I would rather reset mac_addrs to NULL along the dev_private reset in the if
> (eth_dev != NULL) block right after.
> The comment about mac_addrs (see below) being in dev_private can also be
> removed.
>
> WDYT?
Resetting it along with dev_private reset sounds good to me.
More information about the dev
mailing list