From 199ca9c4490be9a53ff22753a1e619fff8195e66 Mon Sep 17 00:00:00 2001 From: Jasvinder Singh Date: Thu, 8 Dec 2016 13:52:47 +0000 Subject: 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 --- vnet/vnet/devices/dpdk/device.c | 2 ++ vnet/vnet/devices/dpdk/hqos.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'vnet') 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; -- cgit 1.2.3-korg