Skip to content

Commit

Permalink
Fix F-Stack#7:arp ring lookup called after create.
Browse files Browse the repository at this point in the history
  • Loading branch information
logwang committed May 15, 2017
1 parent 8f57dbb commit 5e3a4c7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/ff_dpdk_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,16 +477,15 @@ 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);
}

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

0 comments on commit 5e3a4c7

Please sign in to comment.