[dpdk-dev] [RFC] ethdev: improve link speed to string

Stephen Hemminger stephen at networkplumber.org
Thu Jan 19 17:45:59 CET 2023


On Thu, 19 Jan 2023 11:41:12 +0000
Ferruh Yigit <ferruh.yigit at amd.com> wrote:

> >>>> Nothing good will happen if you try to use the function to
> >>>> print two different link speeds in one log message.  
> >>> You are right.
> >>> And use malloc for "name" will result in memory leakage, which is also
> >>> not a good option.
> >>>
> >>> BTW, do you think if we need to modify the function
> >>> "rte_eth_link_speed_to_str"?  
> >>
> >> IMHO it would be more pain than gain in this case.
> >>
> >> .
> >>  
> > Agree with you. Thanks Andrew
> >  
> 
> It can be option to update the API as following in next ABI break release:
> 
> const char *
> rte_eth_link_speed_to_str(uint32_t link_speed, char *buf, size_t buf_size);
> 
> For this a deprecation notice needs to be sent and approved, not sure
> though if it worth.
> 
> 
> Meanwhile, what do you think to update string 'Invalid' to something
> like 'Irregular' or 'Erratic', does this help to convey the right message?


API versioning is possible here.


More information about the dev mailing list