summaryrefslogtreecommitdiffstats
path: root/src/plugins/vmxnet3/vmxnet3_api.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-01-29 15:13:31 -0800
committerDamjan Marion <dmarion@me.com>2019-02-02 15:31:22 +0000
commit773291163a4f72f131afc6a84b065bcfed13aeb7 (patch)
tree55a50c027d91bef911d84e6c437b7aa57bbc9dad /src/plugins/vmxnet3/vmxnet3_api.c
parent900cbadde906a000ce1b431fc637a9c0f7089339 (diff)
vmxnet3: multiple TX queues support
Add num-tx-queues to the vmxnet3 create CLI/API. Default is 1. Max is min (8, the number of cores assigned to VPP). Change-Id: I7e0a659a82d01c719665c228dd8a71e3288a2895 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/plugins/vmxnet3/vmxnet3_api.c')
-rw-r--r--src/plugins/vmxnet3/vmxnet3_api.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/plugins/vmxnet3/vmxnet3_api.c b/src/plugins/vmxnet3/vmxnet3_api.c
index b41866be117..635657c2bb6 100644
--- a/src/plugins/vmxnet3/vmxnet3_api.c
+++ b/src/plugins/vmxnet3/vmxnet3_api.c
@@ -71,6 +71,7 @@ vl_api_vmxnet3_create_t_handler (vl_api_vmxnet3_create_t * mp)
args.addr.as_u32 = ntohl (mp->pci_addr);
args.rxq_size = ntohs (mp->rxq_size);
args.txq_size = ntohs (mp->txq_size);
+ args.txq_num = ntohs (mp->txq_num);
vmxnet3_create_if (vm, &args);
rv = args.rv;
@@ -111,8 +112,7 @@ reply:
static void
send_vmxnet3_details (vl_api_registration_t * reg, vmxnet3_device_t * vd,
- u16 rx_qid, vmxnet3_rxq_t * rxq, u16 tx_qid,
- vmxnet3_txq_t * txq, vnet_sw_interface_t * swif,
+ vmxnet3_rxq_t * rxq, vnet_sw_interface_t * swif,
u8 * interface_name, u32 context)
{
vl_api_vmxnet3_details_t *mp;
@@ -120,7 +120,7 @@ send_vmxnet3_details (vl_api_registration_t * reg, vmxnet3_device_t * vd,
vmxnet3_main_t *vmxm = &vmxnet3_main;
vnet_hw_interface_t *hwif;
vmxnet3_rx_ring *ring;
- u16 rid;
+ u16 rid, qid;
hwif = vnet_get_sup_hw_interface (vnm, swif->sw_if_index);
@@ -139,6 +139,7 @@ send_vmxnet3_details (vl_api_registration_t * reg, vmxnet3_device_t * vd,
mp->version = vd->version;
mp->pci_addr = ntohl (vd->pci_addr.as_u32);
+ mp->admin_up_down = (swif->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) ? 1 : 0;
mp->rx_qsize = htons (rxq->size);
mp->rx_next = htons (rxq->rx_comp_ring.next);
@@ -149,12 +150,19 @@ send_vmxnet3_details (vl_api_registration_t * reg, vmxnet3_device_t * vd,
mp->rx_produce[rid] = htons (ring->produce);
mp->rx_consume[rid] = htons (ring->consume);
}
- mp->tx_qsize = htons (txq->size);
- mp->tx_next = htons (txq->tx_comp_ring.next);
- mp->tx_produce = htons (txq->tx_ring.produce);
- mp->tx_consume = htons (txq->tx_ring.consume);
- mp->admin_up_down = (swif->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) ? 1 : 0;
+ mp->tx_count = clib_min (vec_len (vd->txqs), VMXNET3_TXQ_MAX);
+ vec_foreach_index (qid, vd->txqs)
+ {
+ vmxnet3_txq_t *txq = vec_elt_at_index (vd->txqs, qid);
+ vl_api_vmxnet3_tx_list_t *tx_list = &mp->tx_list[qid];
+
+ ASSERT (qid < VMXNET3_TXQ_MAX);
+ tx_list->tx_qsize = htons (txq->size);
+ tx_list->tx_next = htons (txq->tx_comp_ring.next);
+ tx_list->tx_produce = htons (txq->tx_ring.produce);
+ tx_list->tx_consume = htons (txq->tx_ring.consume);
+ }
vl_api_send_msg (reg, (u8 *) mp);
}
@@ -173,7 +181,6 @@ vl_api_vmxnet3_dump_t_handler (vl_api_vmxnet3_dump_t * mp)
u8 *if_name = 0;
vl_api_registration_t *reg;
vmxnet3_rxq_t *rxq;
- vmxnet3_txq_t *txq;
u16 qid = 0;
reg = vl_api_client_index_to_registration (mp->client_index);
@@ -187,9 +194,7 @@ vl_api_vmxnet3_dump_t_handler (vl_api_vmxnet3_dump_t * mp)
if_name = format (if_name, "%U%c", format_vnet_sw_interface_name, vnm,
swif, 0);
rxq = vec_elt_at_index (vd->rxqs, qid);
- txq = vec_elt_at_index (vd->txqs, qid);
- send_vmxnet3_details (reg, vd, qid, rxq, qid, txq, swif, if_name,
- mp->context);
+ send_vmxnet3_details (reg, vd, rxq, swif, if_name, mp->context);
_vec_len (if_name) = 0;
}));
/* *INDENT-ON* */