[dpdk-dev] [PATCH v2 1/3] ethdev: fix MAC changes when live change not supported

Alejandro Lucero alejandro.lucero at netronome.com
Fri Aug 24 14:45:46 CEST 2018


On Fri, Aug 24, 2018 at 2:27 PM, Ferruh Yigit <ferruh.yigit at intel.com>
wrote:

> On 8/24/2018 12:15 PM, Alejandro Lucero wrote:
> > Current code assumes a MAC change can occur when the port has been
> > started. In fact, there are some NICs which require this port state
> > for being successful, but other NICs not always support MAC change
> > in that case.
> >
> > This patch supports a new device flag for a device advertising this
> > limitation, and if the flag is set, the MAC is changed before the
> > port starts.
> >
> > Fixes: af75078fece3 ("first public release")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
>
> <...>
>
> > @@ -2839,6 +2841,10 @@ int rte_eth_dev_mac_addr_add(uint16_t port_id,
> struct ether_addr *mac_addr,
> >  /**
> >   * Set the default MAC address.
> >   *
> > + * A NIC not supporting MAC change after started should set
> > + * RTE_ETH_DEV_NOLIVE_MAC_ADDR and this function should check such a
> flag
> > + * and NIC state.
> > + *
>
> Only rte_eth_dev_start() API effected from this change, API behavior
> changes
> based on if PMD provides this flag or not, I was thinking to document this
> in
> rte_eth_dev_start(), something like:
> "Driver RTE_ETH_DEV_NOLIVE_MAC_ADDR flag cause MAC address to be set before
> start dev_ops"
>
> As you mentioned in cover letter, rte_eth_dev_mac_addr_add() will return an
> error if not supported, this is not changed with
> RTE_ETH_DEV_NOLIVE_MAC_ADDR
> flag, so I think no need to add this comment.
>

Ok. I will send another version.

Thanks


More information about the dev mailing list