[dpdk-dev] [PATCH v4 5/7] ethdev: add API to retrieve multiple ethernet addresses
Thomas Monjalon
thomas at monjalon.net
Tue Oct 5 19:41:40 CEST 2021
05/10/2021 19:12, Ananyev, Konstantin:
> > 05/10/2021 18:35, Ananyev, Konstantin:
> > > > 04/10/2021 15:56, Konstantin Ananyev:
> > > > > Introduce rte_eth_macaddrs_get() to allow user to retrieve all ethernet
> > > > > addresses assigned to given port.
> > > >
> > > > We already have functions to get MAC addresses.
> > > > Please explain the difference.
> > >
> > > rte_eth_macaddr_get() returns just first (primary) MAC address
> > > assigned to the port.
> > > That one allow user to retrieve all addresses assigned to the port.
> >
> > I was sure we had other function.
>
> I didn't find one.
> If we do, I am ok to drop that change and rework testpmd code to use
> existing one instead.
No there is no alternative, so your patch is welcome.
> > Anyway, would be good to reference rte_eth_macaddr_get in the commit.
> >
> >
> > > > > +/**
> > > > > + * Retrieve the Ethernet addresses of an Ethernet device.
> > > > > + *
> > > > > + * @param port_id
> > > > > + * The port identifier of the Ethernet device.
> > > > > + * @param ma
> > > > > + * A pointer to an array of structures of type *ether_addr* to be filled with
> > > > > + * the Ethernet addresses of the Ethernet device.
> > > > > + * @param num
> > > > > + * Number of elements in the *ma* array.
> > > > > + * @return
> > > > > + * - number of retrieved addresses if successful
> > > > > + * - (-ENODEV) if *port_id* invalid.
> > > > > + * - (-EINVAL) if bad parameter.
> > > >
> > > > Which error if the array is too small?
> > >
> > > None, we just return up to *num* addresses, that's it.
> >
> > So we don't know know whether there are more.
>
> rte_eth_dev_info. max_mac_addrs tells max number of MACs for this port.
Right. Please mention it in the comment of this function.
More information about the dev
mailing list