MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pcmd_link_callback

Function pcmd_link_callback

dpdk/examples/ethtool/ethtool-app/ethapp.c:184–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182
183
184static void
185pcmd_link_callback(__rte_unused void *ptr_params,
186 __rte_unused struct cmdline *ctx,
187 __rte_unused void *ptr_data)
188{
189 uint16_t id_port;
190 int stat_port;
191
192 RTE_ETH_FOREACH_DEV(id_port) {
193 if (!rte_eth_dev_is_valid_port(id_port))
194 continue;
195 stat_port = rte_ethtool_get_link(id_port);
196 switch (stat_port) {
197 case 0:
198 printf("Port %i: Down\n", id_port);
199 break;
200 case 1:
201 printf("Port %i: Up\n", id_port);
202 break;
203 default:
204 printf("Port %i: Error getting link status\n",
205 id_port
206 );
207 break;
208 }
209 }
210 printf("\n");
211}
212
213
214static void

Callers

nothing calls this directly

Calls 3

rte_ethtool_get_linkFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected