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

Function show_port

dpdk/app/proc-info/main.c:999–1195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997}
998
999static void
1000show_port(void)
1001{
1002 int i, ret, j, k;
1003
1004 snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD ");
1005 STATS_BDR_STR(10, bdr_str);
1006
1007 for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
1008 uint16_t mtu = 0;
1009 struct rte_eth_link link;
1010 struct rte_eth_dev_info dev_info;
1011 struct rte_eth_rss_conf rss_conf;
1012 char link_status_text[RTE_ETH_LINK_MAX_STR_LEN];
1013 struct rte_eth_fc_conf fc_conf;
1014 struct rte_ether_addr mac;
1015 struct rte_eth_dev_owner owner;
1016 uint8_t rss_key[RSS_HASH_KEY_SIZE];
1017
1018 /* Skip if port is not in mask */
1019 if ((enabled_port_mask & (1ul << i)) == 0)
1020 continue;
1021
1022 /* Skip if port is unused */
1023 if (!rte_eth_dev_is_valid_port(i))
1024 continue;
1025
1026 memset(&rss_conf, 0, sizeof(rss_conf));
1027
1028 snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
1029 STATS_BDR_STR(5, bdr_str);
1030 printf(" - generic config\n");
1031
1032 ret = rte_eth_dev_info_get(i, &dev_info);
1033 if (ret != 0) {
1034 printf("Error during getting device info: %s\n",
1035 strerror(-ret));
1036 return;
1037 }
1038
1039 printf("\t -- driver %s device %s socket %d\n",
1040 dev_info.driver_name, rte_dev_name(dev_info.device),
1041 rte_eth_dev_socket_id(i));
1042
1043 ret = rte_eth_dev_owner_get(i, &owner);
1044 if (ret == 0 && owner.id != RTE_ETH_DEV_NO_OWNER)
1045 printf("\t -- owner %#"PRIx64":%s\n",
1046 owner.id, owner.name);
1047
1048 ret = rte_eth_link_get(i, &link);
1049 if (ret < 0) {
1050 printf("Link get failed (port %u): %s\n",
1051 i, rte_strerror(-ret));
1052 } else {
1053 rte_eth_link_to_str(link_status_text,
1054 sizeof(link_status_text),
1055 &link);
1056 printf("\t%s\n", link_status_text);

Callers 1

mainFunction · 0.85

Calls 15

snprintfFunction · 0.85
memsetFunction · 0.85
rte_eth_dev_info_getFunction · 0.85
rte_dev_nameFunction · 0.85
rte_eth_dev_socket_idFunction · 0.85
rte_eth_dev_owner_getFunction · 0.85
rte_eth_link_getFunction · 0.85
rte_strerrorFunction · 0.85
rte_eth_link_to_strFunction · 0.85
rte_eth_macaddr_getFunction · 0.85

Tested by

no test coverage detected