diff options
author | Jasvinder Singh <jasvinder.singh@intel.com> | 2016-12-08 13:52:47 +0000 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-09 09:00:56 +0000 |
commit | 199ca9c4490be9a53ff22753a1e619fff8195e66 (patch) | |
tree | 05d247ef806fd292254dbaf4d563dc337e38277d /vnet | |
parent | e4504c6320790bba27fccf3746eb38f75f4d2e95 (diff) |
DPDK HQoS: enable vpp control plane thread connection to hqos thread
The vpp control plane thread generates different types of packets such as ARP,
DHCP client, IPv6 RA, etc. which need to go through HQoS thread associated
with the output interfaces. Therefore, this patch enables vpp main thread
connection with the HQoS thread through dedicated SWQ.
Change-Id: Idcb759546d4bcd9b40beedaec4f12b29baae3e40
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/devices/dpdk/device.c | 2 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/hqos.c | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c index f6d9621e64c..b22fbf2e69e 100644 --- a/vnet/vnet/devices/dpdk/device.c +++ b/vnet/vnet/devices/dpdk/device.c @@ -262,6 +262,8 @@ static_always_inline dpdk_device_hqos_per_worker_thread_t *hqos = &xd->hqos_wt[vm->cpu_index]; + ASSERT (hqos->swq != NULL); + dpdk_hqos_metadata_set (hqos, &tx_vector[tx_tail], tx_head - tx_tail); rv = rte_ring_sp_enqueue_burst (hqos->swq, diff --git a/vnet/vnet/devices/dpdk/hqos.c b/vnet/vnet/devices/dpdk/hqos.c index 12bf3fa6388..d68bc48f80b 100644 --- a/vnet/vnet/devices/dpdk/hqos.c +++ b/vnet/vnet/devices/dpdk/hqos.c @@ -277,10 +277,10 @@ dpdk_port_setup_hqos (dpdk_device_t * xd, dpdk_device_config_hqos_t * hqos) memset (xd->hqos_ht, 0, sizeof (xd->hqos_ht[0])); /* Allocate space for one SWQ per worker thread in the I/O TX thread data structure */ - vec_validate (xd->hqos_ht->swq, worker_thread_count - 1); + vec_validate (xd->hqos_ht->swq, worker_thread_count); /* SWQ */ - for (i = 0; i < worker_thread_count; i++) + for (i = 0; i < worker_thread_count + 1; i++) { u32 swq_flags = RING_F_SP_ENQ | RING_F_SC_DEQ; @@ -354,9 +354,13 @@ dpdk_port_setup_hqos (dpdk_device_t * xd, dpdk_device_config_hqos_t * hqos) xd->hqos_ht->flush_count = 0; /* Set up per-thread device data for each worker thread */ - for (i = 0; i < worker_thread_count; i++) + for (i = 0; i < worker_thread_count + 1; i++) { - u32 tid = worker_thread_first + i; + u32 tid; + if (i) + tid = worker_thread_first + (i - 1); + else + tid = i; xd->hqos_wt[tid].swq = xd->hqos_ht->swq[i]; xd->hqos_wt[tid].hqos_field0_slabpos = hqos->pktfield0_slabpos; |