Fix #7:arp ring lookup called after create.

This commit is contained in:
logwang 2017-05-15 13:16:52 +08:00
parent 8f57dbbcb5
commit 5e3a4c7748
1 changed files with 2 additions and 3 deletions

View File

@ -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]));
}