X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Flink.c;h=16bcffe356bcb2a06288484168403ec4f35260c5;hb=6c02043e9967a9d8f6e8c058256e257efe1d6d1a;hp=787eb866abed98388f736085325594c1bd21f3d7;hpb=323e7b667f18376c60351282950b28d4d0cc6165;p=dpdk.git diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c index 787eb866ab..16bcffe356 100644 --- a/examples/ip_pipeline/link.c +++ b/examples/ip_pipeline/link.c @@ -129,7 +129,8 @@ link_create(const char *name, struct link_params *params) if (!rte_eth_dev_is_valid_port(port_id)) return NULL; - rte_eth_dev_info_get(port_id, &port_info); + if (rte_eth_dev_info_get(port_id, &port_info) != 0) + return NULL; mempool = mempool_find(params->rx.mempool_name); if (mempool == NULL) @@ -175,8 +176,11 @@ link_create(const char *name, struct link_params *params) if (status < 0) return NULL; - if (params->promiscuous) - rte_eth_promiscuous_enable(port_id); + if (params->promiscuous) { + status = rte_eth_promiscuous_enable(port_id); + if (status != 0) + return NULL; + } /* Port RX */ for (i = 0; i < params->rx.n_queues; i++) { @@ -260,7 +264,8 @@ link_is_up(const char *name) return 0; /* Resource */ - rte_eth_link_get(link->port_id, &link_params); + if (rte_eth_link_get(link->port_id, &link_params) < 0) + return 0; return (link_params.link_status == ETH_LINK_DOWN) ? 0 : 1; }