aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Kiss <zoltan.kiss@linaro.org>2016-05-25 18:28:44 +0100
committerZoltan Kiss <zoltan.kiss@linaro.org>2016-05-26 17:26:27 +0100
commitbd6e1c5c4d25ddbe0394ae7a1ee4201751e46085 (patch)
tree1031d94bcc2d0ce351bcb8851d5292e7bcc229f3
parent0d2a6b1b8342d39031a9994c9dd089fed75989bf (diff)
linux-dpdk: packet_dpdk: check rte_eth_dev_info_get() returnv1.8.0.0_DPDK_2.2.0
This function doesn't really handle if the port doesn't exist. In that case there won't be a driver name string, check for that. Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reported-by: Dominic Pigott <dom@intelligentcompute.com>
-rw-r--r--platform/linux-dpdk/odp_packet_dpdk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c
index d4029a99b..1ed88e6ae 100644
--- a/platform/linux-dpdk/odp_packet_dpdk.c
+++ b/platform/linux-dpdk/odp_packet_dpdk.c
@@ -152,6 +152,8 @@ static int setup_pkt_dpdk(odp_pktio_t pktio ODP_UNUSED, pktio_entry_t *pktio_ent
pkt_dpdk->portid = portid;
memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
rte_eth_dev_info_get(portid, &dev_info);
+ if (dev_info.driver_name == NULL)
+ return -1;
if (!strcmp(dev_info.driver_name, "rte_ixgbe_pmd"))
pkt_dpdk->min_rx_burst = 4;
else