diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 09:22:35 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 16:15:13 +0200 |
commit | 809f08006d56e7ba4ce190b0a63d44acf62d8044 (patch) | |
tree | d93fbe3244ee0cff16a6af830c7efb15c26e5ef4 /examples/ethtool/lib | |
parent | b8ce7c38b99df118002fb460e680fabf16944f6c (diff) |
Imported Upstream version 16.07-rc1
Change-Id: If3f757dc95532706b04053286c6b54492169f1a3
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'examples/ethtool/lib')
-rw-r--r-- | examples/ethtool/lib/Makefile | 4 | ||||
-rw-r--r-- | examples/ethtool/lib/rte_ethtool.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/examples/ethtool/lib/Makefile b/examples/ethtool/lib/Makefile index d7ee9555..5b4991e2 100644 --- a/examples/ethtool/lib/Makefile +++ b/examples/ethtool/lib/Makefile @@ -54,4 +54,8 @@ SRCS-y := rte_ethtool.c CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +# internal dependencies +DEPDIRS-y += lib/librte_eal +DEPDIRS-y += lib/librte_ether + include $(RTE_SDK)/mk/rte.extlib.mk diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c index 42e05f1f..54391f21 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c @@ -51,8 +51,7 @@ rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo) if (drvinfo == NULL) return -EINVAL; - if (!rte_eth_dev_is_valid_port(port_id)) - return -ENODEV; + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); @@ -120,8 +119,7 @@ rte_ethtool_get_link(uint8_t port_id) { struct rte_eth_link link; - if (!rte_eth_dev_is_valid_port(port_id)) - return -ENODEV; + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); rte_eth_link_get(port_id, &link); return link.link_status; } @@ -267,8 +265,7 @@ rte_ethtool_net_open(uint8_t port_id) int rte_ethtool_net_stop(uint8_t port_id) { - if (!rte_eth_dev_is_valid_port(port_id)) - return -ENODEV; + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); rte_eth_dev_stop(port_id); return 0; @@ -277,8 +274,7 @@ rte_ethtool_net_stop(uint8_t port_id) int rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr) { - if (!rte_eth_dev_is_valid_port(port_id)) - return -ENODEV; + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (addr == NULL) return -EINVAL; rte_eth_macaddr_get(port_id, addr); |