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

Function init_peer_eth_addrs

dpdk/app/test-pmd/parameters.c:214–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212
213#ifdef RTE_LIB_CMDLINE
214static int
215init_peer_eth_addrs(const char *config_filename)
216{
217 FILE *config_file;
218 portid_t i;
219 char buf[50];
220
221 config_file = fopen(config_filename, "r");
222 if (config_file == NULL) {
223 perror("Failed to open eth config file\n");
224 return -1;
225 }
226
227 for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
228
229 if (fgets(buf, sizeof(buf), config_file) == NULL)
230 break;
231
232 if (rte_ether_unformat_addr(buf, &peer_eth_addrs[i]) < 0) {
233 fprintf(stderr, "Bad MAC address format on line %d\n",
234 i + 1);
235 fclose(config_file);
236 return -1;
237 }
238 }
239 fclose(config_file);
240 nb_peer_eth_addrs = (portid_t) i;
241 return 0;
242}
243#endif
244
245/*

Callers 1

launch_args_parseFunction · 0.85

Calls 1

rte_ether_unformat_addrFunction · 0.85

Tested by

no test coverage detected