Re: [dpdk-dev] Questions about rte_eth_link_speed_to_str API

2021-09-14 Thread Min Hu (Connor)
Thanks Stephen, While I think this option is more clear and simple: +const char * +rte_eth_link_speed_to_str(uint32_t link_speed) +{ +#define SPEED_STRING_LEN 16 + static char name[SPEED_STRING_LEN]; + + if (link_speed == ETH_SPEED_NUM_NONE) + return "None"; + if (l

Re: [dpdk-dev] Questions about rte_eth_link_speed_to_str API

2021-09-13 Thread Stephen Hemminger
On Tue, 14 Sep 2021 11:25:44 +0800 "Min Hu (Connor)" wrote: > Thanks Thomas, > I am not sure if we need to print combined slaves speed. > How about others' opinion ? @all > > BTW, If yes, one possible option may be like that: > +const char * > +rte_eth_link_speed_to_str(uint32

Re: [dpdk-dev] Questions about rte_eth_link_speed_to_str API

2021-09-13 Thread Min Hu (Connor)
Thanks Thomas, I am not sure if we need to print combined slaves speed. How about others' opinion ? @all BTW, If yes, one possible option may be like that: +const char * +rte_eth_link_speed_to_str(uint32_t link_speed) +{ + char name[16]; + + if (link_speed ==

Re: [dpdk-dev] Questions about rte_eth_link_speed_to_str API

2021-09-13 Thread Thomas Monjalon
13/09/2021 10:45, Min Hu (Connor): > Hi all, > I have questions about rte_eth_link_speed_to_str API. > The API converts link speed to string for display, But it only > supports the following speeds, like that: > case ETH_SPEED_NUM_NONE: return "None"; > case ETH_SPEED_NUM_10

[dpdk-dev] Questions about rte_eth_link_speed_to_str API

2021-09-13 Thread Min Hu (Connor)
Hi all, I have questions about rte_eth_link_speed_to_str API. The API converts link speed to string for display, But it only supports the following speeds, like that: case ETH_SPEED_NUM_NONE: return "None"; case ETH_SPEED_NUM_10M: return "10 Mbps"; case ETH