diff options
author | Matias Elo <matias.elo@nokia.com> | 2017-03-03 13:53:16 +0200 |
---|---|---|
committer | Balakrishna Garapati <balakrishna.garapati@linaro.org> | 2017-03-03 14:05:26 +0100 |
commit | 7f5fa185004547dd74304c8c33ebab485891682e (patch) | |
tree | 9f0b19dc71543cfc7ae24674ff2584d0c2c23aca | |
parent | 3ed5cffff2dffdb8ada42353729bb16741a2985d (diff) |
linux-dpdk: pktio: return 0 on odp_pktio_mtu() failurev1.13.0.0_DPDK_17.02
Follow the ODP API definion and return 0 on odp_pktio_mtu() failure.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
-rw-r--r-- | platform/linux-dpdk/odp_packet_dpdk.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c index a2acbd6f0..26d32370b 100644 --- a/platform/linux-dpdk/odp_packet_dpdk.c +++ b/platform/linux-dpdk/odp_packet_dpdk.c @@ -486,7 +486,7 @@ static int send_pkt_dpdk(pktio_entry_t *pktio_entry, int index, return pkts; } -static int _dpdk_vdev_mtu(uint8_t port_id) +static uint32_t _dpdk_vdev_mtu(uint8_t port_id) { struct rte_eth_dev_info dev_info = {0}; struct ifreq ifr; @@ -500,7 +500,7 @@ static int _dpdk_vdev_mtu(uint8_t port_id) close(sockfd); if (ret < 0) { ODP_DBG("ioctl SIOCGIFMTU error\n"); - return -1; + return 0; } return ifr.ifr_mtu; @@ -508,13 +508,12 @@ static int _dpdk_vdev_mtu(uint8_t port_id) static uint32_t mtu_get_pkt_dpdk(pktio_entry_t *pktio_entry) { - uint16_t mtu; + uint16_t mtu = 0; int ret; - ret = rte_eth_dev_get_mtu(pktio_entry->s.pkt_dpdk.portid, - &mtu); + ret = rte_eth_dev_get_mtu(pktio_entry->s.pkt_dpdk.portid, &mtu); if (ret < 0) - return -2; + return 0; /* some dpdk PMD vdev does not support getting mtu size, * try to use system call if dpdk cannot get mtu value. |