interface: shorten vnet_hw_if_rx_mode
This is part of bigger refactor.
Type: refactor
Change-Id: I6fc2c0a1e2d217a70952901bcf775b8485bd3c20
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index 32df1df..eab8106 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -1654,13 +1654,13 @@
static clib_error_t *
avf_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
- vnet_hw_interface_rx_mode mode)
+ vnet_hw_if_rx_mode mode)
{
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
avf_device_t *ad = avf_get_device (hw->dev_instance);
avf_rxq_t *rxq = vec_elt_at_index (ad->rxqs, qid);
- if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (mode == VNET_HW_IF_RX_MODE_POLLING)
{
if (rxq->int_mode == 0)
return 0;
diff --git a/src/plugins/marvell/pp2/pp2.c b/src/plugins/marvell/pp2/pp2.c
index 36b191a..fdd0e85 100644
--- a/src/plugins/marvell/pp2/pp2.c
+++ b/src/plugins/marvell/pp2/pp2.c
@@ -305,7 +305,7 @@
mrvl_pp2_input_node.index);
vnet_hw_interface_assign_rx_thread (vnm, ppif->hw_if_index, 0, ~0);
vnet_hw_interface_set_rx_mode (vnm, ppif->hw_if_index, 0,
- VNET_HW_INTERFACE_RX_MODE_POLLING);
+ VNET_HW_IF_RX_MODE_POLLING);
vnet_hw_interface_set_flags (vnm, ppif->hw_if_index,
VNET_HW_INTERFACE_FLAG_LINK_UP);
goto done;
diff --git a/src/plugins/memif/device.c b/src/plugins/memif/device.c
index 28bf825..aa79f88 100644
--- a/src/plugins/memif/device.c
+++ b/src/plugins/memif/device.c
@@ -459,14 +459,14 @@
static clib_error_t *
memif_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
- vnet_hw_interface_rx_mode mode)
+ vnet_hw_if_rx_mode mode)
{
memif_main_t *mm = &memif_main;
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
memif_if_t *mif = pool_elt_at_index (mm->interfaces, hw->dev_instance);
memif_queue_t *mq = vec_elt_at_index (mif->rx_queues, qid);
- if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (mode == VNET_HW_IF_RX_MODE_POLLING)
mq->ring->flags |= MEMIF_RING_FLAG_MASK_INT;
else
mq->ring->flags &= ~MEMIF_RING_FLAG_MASK_INT;
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index c1bab0b..3a2ed36 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -296,17 +296,17 @@
mq->buffer_pool_index =
vlib_buffer_pool_get_default_for_numa (vm, vlib_mains[ti]->numa_node);
rv = vnet_hw_interface_set_rx_mode (vnm, mif->hw_if_index, i,
- VNET_HW_INTERFACE_RX_MODE_DEFAULT);
+ VNET_HW_IF_RX_MODE_DEFAULT);
if (rv)
memif_log_err
(mif, "Warning: unable to set rx mode for interface %d queue %d: "
"rc=%d", mif->hw_if_index, i, rv);
else
{
- vnet_hw_interface_rx_mode rxmode;
+ vnet_hw_if_rx_mode rxmode;
vnet_hw_interface_get_rx_mode (vnm, mif->hw_if_index, i, &rxmode);
- if (rxmode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (rxmode == VNET_HW_IF_RX_MODE_POLLING)
mq->ring->flags |= MEMIF_RING_FLAG_MASK_INT;
else
vnet_device_input_set_interrupt_pending (vnm, mif->hw_if_index, i);
diff --git a/src/plugins/vmxnet3/vmxnet3.c b/src/plugins/vmxnet3/vmxnet3.c
index 9209c3e..ec0ab2b 100644
--- a/src/plugins/vmxnet3/vmxnet3.c
+++ b/src/plugins/vmxnet3/vmxnet3.c
@@ -62,14 +62,14 @@
static clib_error_t *
vmxnet3_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
- vnet_hw_interface_rx_mode mode)
+ vnet_hw_if_rx_mode mode)
{
vmxnet3_main_t *vmxm = &vmxnet3_main;
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
vmxnet3_device_t *vd = pool_elt_at_index (vmxm->devices, hw->dev_instance);
vmxnet3_rxq_t *rxq = vec_elt_at_index (vd->rxqs, qid);
- if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (mode == VNET_HW_IF_RX_MODE_POLLING)
rxq->int_mode = 0;
else
rxq->int_mode = 1;
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 1c22651..4dd3f05 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -3987,7 +3987,7 @@
int ret;
u8 queue_id_valid = 0;
u32 queue_id;
- vnet_hw_interface_rx_mode mode = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
+ vnet_hw_if_rx_mode mode = VNET_HW_IF_RX_MODE_UNKNOWN;
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
@@ -3995,11 +3995,11 @@
if (unformat (i, "queue %d", &queue_id))
queue_id_valid = 1;
else if (unformat (i, "polling"))
- mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+ mode = VNET_HW_IF_RX_MODE_POLLING;
else if (unformat (i, "interrupt"))
- mode = VNET_HW_INTERFACE_RX_MODE_INTERRUPT;
+ mode = VNET_HW_IF_RX_MODE_INTERRUPT;
else if (unformat (i, "adaptive"))
- mode = VNET_HW_INTERFACE_RX_MODE_ADAPTIVE;
+ mode = VNET_HW_IF_RX_MODE_ADAPTIVE;
else
if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
sw_if_index_set = 1;
@@ -4014,7 +4014,7 @@
errmsg ("missing interface name or sw_if_index");
return -99;
}
- if (mode == VNET_HW_INTERFACE_RX_MODE_UNKNOWN)
+ if (mode == VNET_HW_IF_RX_MODE_UNKNOWN)
{
errmsg ("missing rx-mode");
return -99;
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index 455e76b..62371cd 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -396,7 +396,7 @@
VNET_HW_INTERFACE_FLAG_LINK_UP);
vnet_hw_interface_set_rx_mode (vnm, apif->hw_if_index, 0,
- VNET_HW_INTERFACE_RX_MODE_INTERRUPT);
+ VNET_HW_IF_RX_MODE_INTERRUPT);
mhash_set_mem (&apm->if_index_by_host_if_name, host_if_name_dup, &if_index,
0);
diff --git a/src/vnet/devices/devices.c b/src/vnet/devices/devices.c
index cfce2ac..82b46f7 100644
--- a/src/vnet/devices/devices.c
+++ b/src/vnet/devices/devices.c
@@ -170,14 +170,14 @@
dq->hw_if_index = hw_if_index;
dq->dev_instance = hw->dev_instance;
dq->queue_id = queue_id;
- dq->mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+ dq->mode = VNET_HW_IF_RX_MODE_POLLING;
rt->enabled_node_state = VLIB_NODE_STATE_POLLING;
vnet_device_queue_update (vnm, rt);
vec_validate (hw->input_node_thread_index_by_queue, queue_id);
vec_validate (hw->rx_mode_by_queue, queue_id);
hw->input_node_thread_index_by_queue[queue_id] = thread_index;
- hw->rx_mode_by_queue[queue_id] = VNET_HW_INTERFACE_RX_MODE_POLLING;
+ hw->rx_mode_by_queue[queue_id] = VNET_HW_IF_RX_MODE_POLLING;
vlib_worker_thread_barrier_release (vm0);
@@ -193,7 +193,7 @@
vnet_device_input_runtime_t *rt;
vnet_device_and_queue_t *dq;
uword old_thread_index;
- vnet_hw_interface_rx_mode mode;
+ vnet_hw_if_rx_mode mode;
if (hw->input_node_thread_index_by_queue == 0)
return VNET_API_ERROR_INVALID_INTERFACE;
@@ -222,12 +222,12 @@
vlib_worker_thread_barrier_sync (vm0);
vec_del1 (rt->devices_and_queues, dq - rt->devices_and_queues);
vnet_device_queue_update (vnm, rt);
- hw->rx_mode_by_queue[queue_id] = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
+ hw->rx_mode_by_queue[queue_id] = VNET_HW_IF_RX_MODE_UNKNOWN;
vlib_worker_thread_barrier_release (vm0);
if (vec_len (rt->devices_and_queues) == 0)
vlib_node_set_state (vm, hw->input_node_index, VLIB_NODE_STATE_DISABLED);
- else if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ else if (mode == VNET_HW_IF_RX_MODE_POLLING)
{
/*
* if the deleted interface is polling, we may need to set the node state
@@ -238,7 +238,7 @@
*/
vec_foreach (dq, rt->devices_and_queues)
{
- if (dq->mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (dq->mode == VNET_HW_IF_RX_MODE_POLLING)
return 0;
}
rt->enabled_node_state = VLIB_NODE_STATE_INTERRUPT;
@@ -251,18 +251,18 @@
int
vnet_hw_interface_set_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
- u16 queue_id, vnet_hw_interface_rx_mode mode)
+ u16 queue_id, vnet_hw_if_rx_mode mode)
{
vlib_main_t *vm;
uword thread_index;
vnet_device_and_queue_t *dq;
vlib_node_state_t enabled_node_state;
- ASSERT (mode < VNET_HW_INTERFACE_NUM_RX_MODES);
+ ASSERT (mode < VNET_HW_IF_NUM_RX_MODES);
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
vnet_device_input_runtime_t *rt;
int is_polling = 0;
- if (mode == VNET_HW_INTERFACE_RX_MODE_DEFAULT)
+ if (mode == VNET_HW_IF_RX_MODE_DEFAULT)
mode = hw->default_rx_mode;
if (hw->input_node_thread_index_by_queue == 0 || hw->rx_mode_by_queue == 0)
@@ -271,7 +271,7 @@
if (hw->rx_mode_by_queue[queue_id] == mode)
return 0;
- if (mode != VNET_HW_INTERFACE_RX_MODE_POLLING &&
+ if (mode != VNET_HW_IF_RX_MODE_POLLING &&
(hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE) == 0)
return VNET_API_ERROR_UNSUPPORTED;
@@ -289,7 +289,7 @@
{
if (dq->hw_if_index == hw_if_index && dq->queue_id == queue_id)
dq->mode = mode;
- if (dq->mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (dq->mode == VNET_HW_IF_RX_MODE_POLLING)
is_polling = 1;
}
@@ -311,7 +311,7 @@
int
vnet_hw_interface_get_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
- u16 queue_id, vnet_hw_interface_rx_mode * mode)
+ u16 queue_id, vnet_hw_if_rx_mode * mode)
{
vlib_main_t *vm;
uword thread_index;
diff --git a/src/vnet/devices/devices.h b/src/vnet/devices/devices.h
index d561563..4e7f30d 100644
--- a/src/vnet/devices/devices.h
+++ b/src/vnet/devices/devices.h
@@ -60,7 +60,7 @@
u32 hw_if_index;
u32 dev_instance;
u16 queue_id;
- vnet_hw_interface_rx_mode mode;
+ vnet_hw_if_rx_mode mode;
u32 interrupt_pending;
} vnet_device_and_queue_t;
@@ -88,11 +88,9 @@
int vnet_hw_interface_unassign_rx_thread (vnet_main_t * vnm, u32 hw_if_index,
u16 queue_id);
int vnet_hw_interface_set_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
- u16 queue_id,
- vnet_hw_interface_rx_mode mode);
+ u16 queue_id, vnet_hw_if_rx_mode mode);
int vnet_hw_interface_get_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
- u16 queue_id,
- vnet_hw_interface_rx_mode * mode);
+ u16 queue_id, vnet_hw_if_rx_mode * mode);
static inline u64
vnet_get_aggregate_rx_packets (void)
@@ -160,7 +158,7 @@
*/
#define foreach_device_and_queue(var,vec) \
for (var = (vec); var < vec_end (vec); var++) \
- if ((var->mode == VNET_HW_INTERFACE_RX_MODE_POLLING) \
+ if ((var->mode == VNET_HW_IF_RX_MODE_POLLING) \
|| clib_atomic_swap_acq_n (&((var)->interrupt_pending), 0))
#endif /* included_vnet_vnet_device_h */
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c
index 040ec1f..4a02c5a 100644
--- a/src/vnet/devices/tap/tap.c
+++ b/src/vnet/devices/tap/tap.c
@@ -740,7 +740,7 @@
{
vnet_hw_interface_assign_rx_thread (vnm, vif->hw_if_index, i, ~0);
vnet_hw_interface_set_rx_mode (vnm, vif->hw_if_index, i,
- VNET_HW_INTERFACE_RX_MODE_DEFAULT);
+ VNET_HW_IF_RX_MODE_DEFAULT);
virtio_vring_set_numa_node (vm, vif, RX_QUEUE (i));
}
diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c
index 334da18..32c1eab 100644
--- a/src/vnet/devices/virtio/device.c
+++ b/src/vnet/devices/virtio/device.c
@@ -762,7 +762,7 @@
static clib_error_t *
virtio_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
- vnet_hw_interface_rx_mode mode)
+ vnet_hw_if_rx_mode mode)
{
virtio_main_t *mm = &virtio_main;
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
@@ -776,7 +776,7 @@
return clib_error_return (0, "interrupt mode is not supported");
}
- if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (mode == VNET_HW_IF_RX_MODE_POLLING)
{
vec_foreach (tx_vring, vif->txq_vrings)
{
diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c
index 9b68b1c..177f764 100644
--- a/src/vnet/devices/virtio/pci.c
+++ b/src/vnet/devices/virtio/pci.c
@@ -1190,7 +1190,7 @@
virtio_vring_set_numa_node (vm, vif, RX_QUEUE (i));
/* Set default rx mode to POLLING */
vnet_hw_interface_set_rx_mode (vnm, vif->hw_if_index, i,
- VNET_HW_INTERFACE_RX_MODE_POLLING);
+ VNET_HW_IF_RX_MODE_POLLING);
}
if (virtio_pci_is_link_up (vm, vif) & VIRTIO_NET_S_LINK_UP)
{
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c
index 92aee00..5b42a27 100644
--- a/src/vnet/devices/virtio/vhost_user.c
+++ b/src/vnet/devices/virtio/vhost_user.c
@@ -170,9 +170,9 @@
vnet_hw_interface_set_input_node (vnm, vui->hw_if_index,
vhost_user_input_node.index);
vnet_hw_interface_assign_rx_thread (vnm, vui->hw_if_index, q, ~0);
- if (txvq->mode == VNET_HW_INTERFACE_RX_MODE_UNKNOWN)
+ if (txvq->mode == VNET_HW_IF_RX_MODE_UNKNOWN)
/* Set polling as the default */
- txvq->mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+ txvq->mode = VNET_HW_IF_RX_MODE_POLLING;
txvq->qid = q;
rv = vnet_hw_interface_set_rx_mode (vnm, vui->hw_if_index, q, txvq->mode);
if (rv)
@@ -1358,8 +1358,8 @@
if (txvq->qid == -1)
continue;
if ((vum->ifq_count > 0) &&
- ((txvq->mode == VNET_HW_INTERFACE_RX_MODE_INTERRUPT) ||
- (txvq->mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE)))
+ ((txvq->mode == VNET_HW_IF_RX_MODE_INTERRUPT) ||
+ (txvq->mode == VNET_HW_IF_RX_MODE_ADAPTIVE)))
{
vum->ifq_count--;
// Stop the timer if there is no more interrupt interface/queue
@@ -2164,7 +2164,7 @@
{
vnet_main_t *vnm = vnet_get_main ();
uword thread_index;
- vnet_hw_interface_rx_mode mode;
+ vnet_hw_if_rx_mode mode;
vhost_user_vring_t *txvq = &vui->vrings[qid];
if (txvq->qid == -1)
@@ -2176,7 +2176,7 @@
&mode);
vlib_cli_output (vm, " thread %d on vring %d, %U\n",
thread_index, qid,
- format_vnet_hw_interface_rx_mode, mode);
+ format_vnet_hw_if_rx_mode, mode);
}
vlib_cli_output (vm, " tx placement: %s\n",
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index ea8e7d6..8d0ee4a 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -380,7 +380,7 @@
vhost_user_main_t * vum,
vhost_user_intf_t * vui,
u16 qid, vlib_node_runtime_t * node,
- vnet_hw_interface_rx_mode mode, u8 enable_csum)
+ vnet_hw_if_rx_mode mode, u8 enable_csum)
{
vhost_user_vring_t *txvq = &vui->vrings[VHOST_VRING_IDX_TX (qid)];
vnet_feature_main_t *fm = &feature_main;
@@ -415,7 +415,7 @@
* When the traffic subsides, the scheduler switches the node back to
* interrupt mode. We must tell the driver we want interrupt.
*/
- if (PREDICT_FALSE (mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE))
+ if (PREDICT_FALSE (mode == VNET_HW_IF_RX_MODE_ADAPTIVE))
{
if ((node->flags &
VLIB_NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE) ||
@@ -1088,7 +1088,7 @@
vhost_user_if_input_packed (vlib_main_t * vm, vhost_user_main_t * vum,
vhost_user_intf_t * vui, u16 qid,
vlib_node_runtime_t * node,
- vnet_hw_interface_rx_mode mode, u8 enable_csum)
+ vnet_hw_if_rx_mode mode, u8 enable_csum)
{
vhost_user_vring_t *txvq = &vui->vrings[VHOST_VRING_IDX_TX (qid)];
vnet_feature_main_t *fm = &feature_main;
@@ -1130,7 +1130,7 @@
* When the traffic subsides, the scheduler switches the node back to
* interrupt mode. We must tell the driver we want interrupt.
*/
- if (PREDICT_FALSE (mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE))
+ if (PREDICT_FALSE (mode == VNET_HW_IF_RX_MODE_ADAPTIVE))
{
if ((node->flags &
VLIB_NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE) ||
diff --git a/src/vnet/devices/virtio/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c
index 2d17ddf..8ac9d0b 100644
--- a/src/vnet/devices/virtio/vhost_user_output.c
+++ b/src/vnet/devices/virtio/vhost_user_output.c
@@ -1059,7 +1059,7 @@
static __clib_unused clib_error_t *
vhost_user_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index,
- u32 qid, vnet_hw_interface_rx_mode mode)
+ u32 qid, vnet_hw_if_rx_mode mode)
{
vlib_main_t *vm = vnm->vlib_main;
vnet_hw_interface_t *hif = vnet_get_hw_interface (vnm, hw_if_index);
@@ -1068,15 +1068,15 @@
pool_elt_at_index (vum->vhost_user_interfaces, hif->dev_instance);
vhost_user_vring_t *txvq = &vui->vrings[VHOST_VRING_IDX_TX (qid)];
- if ((mode == VNET_HW_INTERFACE_RX_MODE_INTERRUPT) ||
- (mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE))
+ if ((mode == VNET_HW_IF_RX_MODE_INTERRUPT) ||
+ (mode == VNET_HW_IF_RX_MODE_ADAPTIVE))
{
if (txvq->kickfd_idx == ~0)
{
// We cannot support interrupt mode if the driver opts out
return clib_error_return (0, "Driver does not support interrupt");
}
- if (txvq->mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (txvq->mode == VNET_HW_IF_RX_MODE_POLLING)
{
vum->ifq_count++;
// Start the timer if this is the first encounter on interrupt
@@ -1088,11 +1088,10 @@
VHOST_USER_EVENT_START_TIMER, 0);
}
}
- else if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ else if (mode == VNET_HW_IF_RX_MODE_POLLING)
{
- if (((txvq->mode == VNET_HW_INTERFACE_RX_MODE_INTERRUPT) ||
- (txvq->mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE)) &&
- vum->ifq_count)
+ if (((txvq->mode == VNET_HW_IF_RX_MODE_INTERRUPT) ||
+ (txvq->mode == VNET_HW_IF_RX_MODE_ADAPTIVE)) && vum->ifq_count)
{
vum->ifq_count--;
// Stop the timer if there is no more interrupt interface/queue
@@ -1105,10 +1104,10 @@
}
txvq->mode = mode;
- if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (mode == VNET_HW_IF_RX_MODE_POLLING)
txvq->used->flags = VRING_USED_F_NO_NOTIFY;
- else if ((mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE) ||
- (mode == VNET_HW_INTERFACE_RX_MODE_INTERRUPT))
+ else if ((mode == VNET_HW_IF_RX_MODE_ADAPTIVE) ||
+ (mode == VNET_HW_IF_RX_MODE_INTERRUPT))
txvq->used->flags = 0;
else
{
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index ad8bde3..8ca9c1a 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -775,7 +775,7 @@
hw_index = hw - im->hw_interfaces;
hw->hw_if_index = hw_index;
- hw->default_rx_mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+ hw->default_rx_mode = VNET_HW_IF_RX_MODE_POLLING;
if (dev_class->format_device_name)
hw->name = format (0, "%U", dev_class->format_device_name, dev_instance);
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
index 895ce2e..5c04c5d 100644
--- a/src/vnet/interface.h
+++ b/src/vnet/interface.h
@@ -52,13 +52,13 @@
typedef enum
{
- VNET_HW_INTERFACE_RX_MODE_UNKNOWN,
- VNET_HW_INTERFACE_RX_MODE_POLLING,
- VNET_HW_INTERFACE_RX_MODE_INTERRUPT,
- VNET_HW_INTERFACE_RX_MODE_ADAPTIVE,
- VNET_HW_INTERFACE_RX_MODE_DEFAULT,
- VNET_HW_INTERFACE_NUM_RX_MODES,
-} vnet_hw_interface_rx_mode;
+ VNET_HW_IF_RX_MODE_UNKNOWN,
+ VNET_HW_IF_RX_MODE_POLLING,
+ VNET_HW_IF_RX_MODE_INTERRUPT,
+ VNET_HW_IF_RX_MODE_ADAPTIVE,
+ VNET_HW_IF_RX_MODE_DEFAULT,
+ VNET_HW_IF_NUM_RX_MODES,
+} vnet_hw_if_rx_mode;
/* Interface up/down callback. */
typedef clib_error_t *(vnet_interface_function_t)
@@ -81,7 +81,7 @@
/* Interface set rx mode callback. */
typedef clib_error_t *(vnet_interface_set_rx_mode_function_t)
(struct vnet_main_t * vnm, u32 if_index, u32 queue_id,
- vnet_hw_interface_rx_mode mode);
+ vnet_hw_if_rx_mode mode);
/* Interface set l2 mode callback. */
typedef clib_error_t *(vnet_interface_set_l2_mode_function_t)
@@ -600,9 +600,9 @@
/* input node cpu index by queue */
u32 *input_node_thread_index_by_queue;
- /* vnet_hw_interface_rx_mode by queue */
+ /* vnet_hw_if_rx_mode by queue */
u8 *rx_mode_by_queue;
- vnet_hw_interface_rx_mode default_rx_mode;
+ vnet_hw_if_rx_mode default_rx_mode;
/* device input device_and_queue runtime index */
uword *dq_runtime_index_by_queue;
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index f8056c2..51555ca 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -1006,7 +1006,7 @@
vnet_sw_interface_t *si;
clib_error_t *error;
int rv = 0;
- vnet_hw_interface_rx_mode rx_mode;
+ vnet_hw_if_rx_mode rx_mode;
VALIDATE_SW_IF_INDEX (mp);
@@ -1017,12 +1017,11 @@
goto bad_sw_if_index;
}
- rx_mode = (vnet_hw_interface_rx_mode) ntohl (mp->mode);
+ rx_mode = (vnet_hw_if_rx_mode) ntohl (mp->mode);
error = set_hw_interface_change_rx_mode (vnm, si->hw_if_index,
mp->queue_id_valid,
ntohl (mp->queue_id),
- (vnet_hw_interface_rx_mode)
- rx_mode);
+ (vnet_hw_if_rx_mode) rx_mode);
if (error)
{
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index 55433fe..b720f44 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -1477,16 +1477,16 @@
static clib_error_t *
set_hw_interface_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
- u32 queue_id, vnet_hw_interface_rx_mode mode)
+ u32 queue_id, vnet_hw_if_rx_mode mode)
{
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
vnet_device_class_t *dev_class =
vnet_get_device_class (vnm, hw->dev_class_index);
clib_error_t *error;
- vnet_hw_interface_rx_mode old_mode;
+ vnet_hw_if_rx_mode old_mode;
int rv;
- if (mode == VNET_HW_INTERFACE_RX_MODE_DEFAULT)
+ if (mode == VNET_HW_IF_RX_MODE_DEFAULT)
mode = hw->default_rx_mode;
rv = vnet_hw_interface_get_rx_mode (vnm, hw_if_index, queue_id, &old_mode);
@@ -1533,7 +1533,7 @@
clib_error_t *
set_hw_interface_change_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
u8 queue_id_valid, u32 queue_id,
- vnet_hw_interface_rx_mode mode)
+ vnet_hw_if_rx_mode mode)
{
clib_error_t *error = 0;
vnet_hw_interface_t *hw;
@@ -1566,7 +1566,7 @@
vnet_main_t *vnm = vnet_get_main ();
u32 hw_if_index = (u32) ~ 0;
u32 queue_id = (u32) ~ 0;
- vnet_hw_interface_rx_mode mode = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
+ vnet_hw_if_rx_mode mode = VNET_HW_IF_RX_MODE_UNKNOWN;
u8 queue_id_valid = 0;
if (!unformat_user (input, unformat_line_input, line_input))
@@ -1580,11 +1580,11 @@
else if (unformat (line_input, "queue %d", &queue_id))
queue_id_valid = 1;
else if (unformat (line_input, "polling"))
- mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+ mode = VNET_HW_IF_RX_MODE_POLLING;
else if (unformat (line_input, "interrupt"))
- mode = VNET_HW_INTERFACE_RX_MODE_INTERRUPT;
+ mode = VNET_HW_IF_RX_MODE_INTERRUPT;
else if (unformat (line_input, "adaptive"))
- mode = VNET_HW_INTERFACE_RX_MODE_ADAPTIVE;
+ mode = VNET_HW_IF_RX_MODE_ADAPTIVE;
else
{
error = clib_error_return (0, "parse error: '%U'",
@@ -1599,7 +1599,7 @@
if (hw_if_index == (u32) ~ 0)
return clib_error_return (0, "please specify valid interface name");
- if (mode == VNET_HW_INTERFACE_RX_MODE_UNKNOWN)
+ if (mode == VNET_HW_IF_RX_MODE_UNKNOWN)
return clib_error_return (0, "please specify valid rx-mode");
error = set_hw_interface_change_rx_mode (vnm, hw_if_index, queue_id_valid,
@@ -1677,7 +1677,7 @@
s = format (s, " %U queue %u (%U)\n",
format_vnet_sw_if_index_name, vnm, hi->sw_if_index,
dq->queue_id,
- format_vnet_hw_interface_rx_mode, dq->mode);
+ format_vnet_hw_if_rx_mode, dq->mode);
}
}));
if (vec_len (s) > 0)
@@ -1734,7 +1734,7 @@
vnet_main_t *vnm = vnet_get_main ();
vnet_device_main_t *vdm = &vnet_device_main;
clib_error_t *error = 0;
- vnet_hw_interface_rx_mode mode = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
+ vnet_hw_if_rx_mode mode = VNET_HW_IF_RX_MODE_UNKNOWN;
int rv;
if (is_main)
diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c
index 5f995b8..a2adc9b 100644
--- a/src/vnet/interface_format.c
+++ b/src/vnet/interface_format.c
@@ -97,17 +97,17 @@
}
u8 *
-format_vnet_hw_interface_rx_mode (u8 * s, va_list * args)
+format_vnet_hw_if_rx_mode (u8 * s, va_list * args)
{
- vnet_hw_interface_rx_mode mode = va_arg (*args, vnet_hw_interface_rx_mode);
+ vnet_hw_if_rx_mode mode = va_arg (*args, vnet_hw_if_rx_mode);
- if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ if (mode == VNET_HW_IF_RX_MODE_POLLING)
return format (s, "polling");
- if (mode == VNET_HW_INTERFACE_RX_MODE_INTERRUPT)
+ if (mode == VNET_HW_IF_RX_MODE_INTERRUPT)
return format (s, "interrupt");
- if (mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE)
+ if (mode == VNET_HW_IF_RX_MODE_ADAPTIVE)
return format (s, "adaptive");
return format (s, "unknown");
diff --git a/src/vnet/interface_funcs.h b/src/vnet/interface_funcs.h
index 8f589d1..120d92c 100644
--- a/src/vnet/interface_funcs.h
+++ b/src/vnet/interface_funcs.h
@@ -407,8 +407,7 @@
u32 hw_if_index,
u8 queue_id_valid,
u32 queue_id,
- vnet_hw_interface_rx_mode
- mode);
+ vnet_hw_if_rx_mode mode);
/* Set rx-placement on the interface */
clib_error_t *set_hw_interface_rx_placement (u32 hw_if_index, u32 queue_id,
@@ -438,7 +437,7 @@
/* Formats sw/hw interface. */
format_function_t format_vnet_hw_interface;
-format_function_t format_vnet_hw_interface_rx_mode;
+format_function_t format_vnet_hw_if_rx_mode;
format_function_t format_vnet_hw_if_index_name;
format_function_t format_vnet_sw_interface;
format_function_t format_vnet_sw_interface_name;