summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-10-07 08:37:28 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-10-13 08:13:37 +0000
commit9876520f9ba746ed4d9923f392911c4f1888a105 (patch)
treea6dfa09134fcb79c5ff56cbf04c3425a1f637e97 /vnet
parent1946a12a52deddfb501d2bdf320ff280cb42a076 (diff)
vpp_lite: add cpu pinning support (VPP-467)
Proper cpu pinning in vpp_lite platform, like in normal vpp image. Extended “show threads” command to show propper information. Changed handling of coreID and socketID for threads in "show threads" CLI, pthread_getaffinity is used instead of info stored in DPDK. Change-Id: Ic8299ec5e284472bb10a37a95fadeed57b6edae8 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/dpdk/cli.c6
-rw-r--r--vnet/vnet/devices/dpdk/init.c4
-rw-r--r--vnet/vnet/devices/dpdk/vhost_user.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/vnet/vnet/devices/dpdk/cli.c b/vnet/vnet/devices/dpdk/cli.c
index 7941f9e0e16..2683030658a 100644
--- a/vnet/vnet/devices/dpdk/cli.c
+++ b/vnet/vnet/devices/dpdk/cli.c
@@ -757,7 +757,7 @@ show_dpdk_if_placement (vlib_main_t * vm, unformat_input_t * input,
if (vec_len (dm->devices_by_cpu[cpu]))
vlib_cli_output (vm, "Thread %u (%s at lcore %u):", cpu,
vlib_worker_threads[cpu].name,
- vlib_worker_threads[cpu].dpdk_lcore_id);
+ vlib_worker_threads[cpu].lcore_id);
/* *INDENT-OFF* */
vec_foreach(dq, dm->devices_by_cpu[cpu])
@@ -857,7 +857,7 @@ set_dpdk_if_placement (vlib_main_t * vm, unformat_input_t * input,
dq->queue_id = queue;
dq->device = xd->device_index;
xd->cpu_socket_id_by_queue[queue] =
- rte_lcore_to_socket_id(vlib_worker_threads[cpu].dpdk_lcore_id);
+ rte_lcore_to_socket_id(vlib_worker_threads[cpu].lcore_id);
vec_sort_with_function(dm->devices_by_cpu[i],
dpdk_device_queue_sort);
@@ -907,7 +907,7 @@ show_dpdk_if_hqos_placement (vlib_main_t * vm, unformat_input_t * input,
if (vec_len (dm->devices_by_hqos_cpu[cpu]))
vlib_cli_output (vm, "Thread %u (%s at lcore %u):", cpu,
vlib_worker_threads[cpu].name,
- vlib_worker_threads[cpu].dpdk_lcore_id);
+ vlib_worker_threads[cpu].lcore_id);
vec_foreach (dq, dm->devices_by_hqos_cpu[cpu])
{
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index a5c056c6a68..73edc4a97a5 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -652,7 +652,7 @@ dpdk_lib_init (dpdk_main_t * dm)
/* *INDENT-OFF* */
clib_bitmap_foreach (i, devconf->workers, ({
int cpu = dm->input_cpu_first_index + i;
- unsigned lcore = vlib_worker_threads[cpu].dpdk_lcore_id;
+ unsigned lcore = vlib_worker_threads[cpu].lcore_id;
vec_validate(xd->cpu_socket_id_by_queue, q);
xd->cpu_socket_id_by_queue[q] = rte_lcore_to_socket_id(lcore);
vec_add2(dm->devices_by_cpu[cpu], dq, 1);
@@ -665,7 +665,7 @@ dpdk_lib_init (dpdk_main_t * dm)
for (q = 0; q < xd->rx_q_used; q++)
{
int cpu = dm->input_cpu_first_index + next_cpu;
- unsigned lcore = vlib_worker_threads[cpu].dpdk_lcore_id;
+ unsigned lcore = vlib_worker_threads[cpu].lcore_id;
/*
* numa node for worker thread handling this queue
diff --git a/vnet/vnet/devices/dpdk/vhost_user.c b/vnet/vnet/devices/dpdk/vhost_user.c
index 9e53c96f599..46fae60dac7 100644
--- a/vnet/vnet/devices/dpdk/vhost_user.c
+++ b/vnet/vnet/devices/dpdk/vhost_user.c
@@ -393,7 +393,7 @@ dpdk_create_vhost_user_if_internal (u32 * hw_if_index, u32 if_id, u8 * hwaddr)
{
int cpu = dm->input_cpu_first_index + (next_cpu % dm->input_cpu_count);
- unsigned lcore = vlib_worker_threads[cpu].dpdk_lcore_id;
+ unsigned lcore = vlib_worker_threads[cpu].lcore_id;
vec_validate (xd->cpu_socket_id_by_queue, q);
xd->cpu_socket_id_by_queue[q] = rte_lcore_to_socket_id (lcore);