summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-03-20 08:49:02 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-22 13:59:43 +0000
commit32f4e18c59f368e9c43f4483de12353280c2149b (patch)
tree36ade0413bbb5389993202018077eaaf04e9eb72 /src
parent0bbe57636732d1eade17c3fe881864d33451cf11 (diff)
Avoid atomic ops when polling queues
Change-Id: I31c6a0a1d11b5b12d8a5c32c29fea9618b1a53d4 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/devices/devices.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vnet/devices/devices.h b/src/vnet/devices/devices.h
index c303cb67b40..ac5be229b76 100644
--- a/src/vnet/devices/devices.h
+++ b/src/vnet/devices/devices.h
@@ -153,10 +153,11 @@ vnet_device_input_set_interrupt_pending (vnet_main_t * vnm, u32 hw_if_index,
vlib_node_set_interrupt_pending (vm, hw->input_node_index);
}
-#define foreach_device_and_queue(var,vec) \
- for (var = (vec); var < vec_end (vec); var++) \
- if (clib_smp_swap (&((var)->interrupt_pending), 0) || \
- var->mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+#define foreach_device_and_queue(var,vec) \
+ for (var = (vec); var < vec_end (vec); var++) \
+ if ((var->mode == VNET_HW_INTERFACE_RX_MODE_POLLING) \
+ || clib_smp_swap (&((var)->interrupt_pending), 0))
+
#endif /* included_vnet_vnet_device_h */