Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vppinfra: add spinlock inline functions
[vpp.git]
/
src
/
vnet
/
devices
/
af_packet
/
device.c
diff --git
a/src/vnet/devices/af_packet/device.c
b/src/vnet/devices/af_packet/device.c
index
9a94fc5
..
2ba3f57
100644
(file)
--- a/
src/vnet/devices/af_packet/device.c
+++ b/
src/vnet/devices/af_packet/device.c
@@
-92,11
+92,7
@@
af_packet_interface_tx (vlib_main_t * vm,
struct tpacket2_hdr *tph;
u32 frame_not_ready = 0;
struct tpacket2_hdr *tph;
u32 frame_not_ready = 0;
- if (PREDICT_FALSE (apif->lockp != 0))
- {
- while (__sync_lock_test_and_set (apif->lockp, 1))
- ;
- }
+ clib_spinlock_lock_if_init (&apif->lockp);
while (n_left > 0)
{
while (n_left > 0)
{
@@
-159,8
+155,7
@@
af_packet_interface_tx (vlib_main_t * vm,
}
}
}
}
- if (PREDICT_FALSE (apif->lockp != 0))
- *apif->lockp = 0;
+ clib_spinlock_unlock_if_init (&apif->lockp);
if (PREDICT_FALSE (frame_not_ready))
vlib_error_count (vm, node->node_index,
if (PREDICT_FALSE (frame_not_ready))
vlib_error_count (vm, node->node_index,