X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fsoftnicfwd.c;h=e9d437364467415c0172db9c76c4089770e3eca7;hb=7edbf7ddfd7d2453afaad3b72666491d30b616af;hp=94e6669d385238a7469557fd07ddf26a7cdce21b;hpb=8bf02b320e27ec27af12d345663f557b04a4c677;p=dpdk.git diff --git a/app/test-pmd/softnicfwd.c b/app/test-pmd/softnicfwd.c index 94e6669d38..e9d4373644 100644 --- a/app/test-pmd/softnicfwd.c +++ b/app/test-pmd/softnicfwd.c @@ -163,16 +163,22 @@ softnic_begin(void *arg __rte_unused) return 0; } -static void +static int set_tm_hiearchy_nodes_shaper_rate(portid_t port_id, struct tm_hierarchy *h) { struct rte_eth_link link_params; uint64_t tm_port_rate; + int ret; memset(&link_params, 0, sizeof(link_params)); - rte_eth_link_get(port_id, &link_params); + ret = rte_eth_link_get(port_id, &link_params); + if (ret < 0) { + printf("Error during getting device (port %u) link info: %s\n", + port_id, rte_strerror(-ret)); + return ret; + } tm_port_rate = (uint64_t)ETH_SPEED_NUM_10G * BYTES_IN_MBPS; /* Set tm hierarchy shapers rate */ @@ -183,6 +189,8 @@ set_tm_hiearchy_nodes_shaper_rate(portid_t port_id, = h->subport_node_shaper_rate / PIPE_NODES_PER_SUBPORT; h->tc_node_shaper_rate = h->pipe_node_shaper_rate; h->tc_node_shared_shaper_rate = h->subport_node_shaper_rate; + + return 0; } static int @@ -554,7 +562,9 @@ softport_tm_hierarchy_specify(portid_t port_id, memset(&h, 0, sizeof(struct tm_hierarchy)); /* TM hierarchy shapers rate */ - set_tm_hiearchy_nodes_shaper_rate(port_id, &h); + status = set_tm_hiearchy_nodes_shaper_rate(port_id, &h); + if (status) + return status; /* Add root node (level 0) */ status = softport_tm_root_node_add(port_id, &h, error);