- if (devconf->hqos_enabled)
- {
- xd->flags |= DPDK_DEVICE_FLAG_HQOS;
-
- int cpu;
- if (devconf->hqos.hqos_thread_valid)
- {
- if (devconf->hqos.hqos_thread >= dm->hqos_cpu_count)
- return clib_error_return (0, "invalid HQoS thread index");
-
- cpu = dm->hqos_cpu_first_index + devconf->hqos.hqos_thread;
- }
- else
- {
- if (dm->hqos_cpu_count == 0)
- return clib_error_return (0, "no HQoS threads available");
-
- cpu = dm->hqos_cpu_first_index + next_hqos_cpu;
-
- next_hqos_cpu++;
- if (next_hqos_cpu == dm->hqos_cpu_count)
- next_hqos_cpu = 0;
-
- devconf->hqos.hqos_thread_valid = 1;
- devconf->hqos.hqos_thread = cpu;
- }
-
- dpdk_device_and_queue_t *dq;
- vec_add2 (dm->devices_by_hqos_cpu[cpu], dq, 1);
- dq->device = xd->device_index;
- dq->queue_id = 0;
- }