[dpdk-dev] Questions about rte_eth_link_speed_to_str API

Thomas Monjalon thomas at monjalon.net
Mon Sep 13 12:26:47 CEST 2021


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_10M:  return "10 Mbps";
> 	case ETH_SPEED_NUM_100M: return "100 Mbps";
> 	case ETH_SPEED_NUM_1G:   return "1 Gbps";
> 	case ETH_SPEED_NUM_2_5G: return "2.5 Gbps";
> 	case ETH_SPEED_NUM_5G:   return "5 Gbps";
> 	case ETH_SPEED_NUM_10G:  return "10 Gbps";
> 	case ETH_SPEED_NUM_20G:  return "20 Gbps";
> 	case ETH_SPEED_NUM_25G:  return "25 Gbps";
> 	case ETH_SPEED_NUM_40G:  return "40 Gbps";
> 	case ETH_SPEED_NUM_50G:  return "50 Gbps";
> 	case ETH_SPEED_NUM_56G:  return "56 Gbps";
> 	case ETH_SPEED_NUM_100G: return "100 Gbps";
> 	case ETH_SPEED_NUM_200G: return "200 Gbps";
> 	case ETH_SPEED_NUM_UNKNOWN: return "Unknown";
> 	default: return "Invalid";
> 
> 	In some cases, like bonding, for example, three slaves which
> 	link speed are 10Gbps, so link speed of bonding port will be
> 	30Gbps, but it shows "Invalid".
> 
> 	Is this reasonable? any comments will be welcome.

Is it meaningful to print combined slaves speed?
If yes, we can do better then this fixed switch/case logic,
it shouldn't be too hard given it is a standard uint32_t value.




More information about the dev mailing list