[RFC] rte_ether_unformat: accept more inputs

Stephen Hemminger stephen at networkplumber.org
Sat Sep 30 01:08:35 CEST 2023


On Fri, 29 Sep 2023 21:35:45 +0200
Morten Brørup <mb at smartsharesystems.com> wrote:

> > From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> > Sent: Friday, 29 September 2023 18.36
> > 
> > This updates rte_ether_addr_unformat() to accept more types
> > of input. There have been requests to handle Windows and other formats.  
> 
> Seems very useful.
> 
> [...]
> 
> > +/*
> > + * Be libreal in accepting a wide variety of notational formats  
> 
> Typo: libreal -> liberal.
> 
> > + * for MAC address including:
> > + *  - Linux format six groups of hexadecimal digits seperated by colon
> > + *  - Windows format six groups seperated by hyphen  
> 
> Typo (twice): seperated -> separated

Typos will be fixed in next version in addition to adding tests.

> 
> > --- a/lib/net/rte_ether.h
> > +++ b/lib/net/rte_ether.h
> > @@ -254,8 +254,10 @@ rte_ether_format_addr(char *buf, uint16_t size,
> >   *
> >   * @param str
> >   *   A pointer to buffer contains the formatted MAC address.
> > - *   The supported formats are:
> > - *     XX:XX:XX:XX:XX:XX or XXXX:XXXX:XXXX
> > + *   The example formats are:
> > + *     XX:XX:XX:XX:XX:XX - Canonical form
> > + *     XX-XX-XX-XX-XX-XX - Windows and IEEE 802
> > + *     XXXX:XXXX:XXXX    - original DPDK
> >   *   where XX is a hex digit: 0-9, a-f, or A-F.  
> 
> Actually, XX is a hex number, not a hex digit.
> 
> But I think the intention of this patch is also to allow a hex number of 1 or 2 (or up to 4) hex digits for XX and XXXX?
> 


Good point, the single hex digit format came as a later request.


More information about the dev mailing list