On Mon, 18 Dec 2017 22:03:55 +0100 Thomas Monjalon <tho...@monjalon.net> wrote:
> > > > Good question. For the following reasons: > > > > - I forgot about the existence of ether_ntoa() and didn't look it up seeing > > struct ether_addr is (re-)defined by rte_ether.h. What happens when one > > includes netinet/ether.h together with that file results in various > > conflicts that trigger a compilation error. This problem should be > > addressed first. > > > > - ether_ntoa() returns a static buffer and is not reentrant, ether_ntoa_r() > > is but as a GNU extension, I'm not sure it exists on other OSes. Even if > > this driver is currently targeted at Linux, this is likely not the case > > for other DPDK code relying on rte_ether.h. > > > > - I had ether_addr_from_str()'s code already ready and lying around for a > > future update in testpmd's flow command parser. No other MAC-48 conversion > > function I know of is as flexible as this version. The ability to omit ":" > > and entering partial addresses is a big plus IMO. > > > > I think both can coexist on their own merits. Since rte_ether.h needs to be > > fixed either way, how about I move this function in a separate commit and > > address the conflict with netinet/ether.h while there? > > Looks to be a good plan. Agree, rte_ether is where it should go. Please put functions for parsing there. The name and logic conflict between netinet/ether.h and rte is both a blessing and a curse. Although the definitions of ether_addr overlap, they are equivalent.