From 5e3a4c7748f0b1c080e907f0afb3aa4d580dfc0a Mon Sep 17 00:00:00 2001 From: logwang Date: Mon, 15 May 2017 13:16:52 +0800 Subject: [PATCH] Fix #7:arp ring lookup called after create. --- lib/ff_dpdk_if.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ff_dpdk_if.c b/lib/ff_dpdk_if.c index b91d4dbd5..b915fde96 100644 --- a/lib/ff_dpdk_if.c +++ b/lib/ff_dpdk_if.c @@ -477,6 +477,8 @@ init_arp_ring(void) arp_ring[i][port_id] = rte_ring_create(name_buf, ARP_RING_SIZE, socketid, RING_F_SC_DEQ); + if (rte_ring_lookup(name_buf) != arp_ring[i][port_id]) + rte_panic("lookup kni ring:%s failed!\n", name_buf); } else { arp_ring[i][port_id] = rte_ring_lookup(name_buf); } @@ -484,9 +486,6 @@ init_arp_ring(void) if (arp_ring[i][port_id] == NULL) rte_panic("create kni ring::%s failed!\n", name_buf); - if (rte_ring_lookup(name_buf) != arp_ring[i][port_id]) - rte_panic("lookup kni ring:%s failed!\n", name_buf); - printf("create arp ring:%s success, %u ring entries are now free!\n", name_buf, rte_ring_free_count(arp_ring[i][port_id])); }