rmp = vm->buffer_main->pktmbuf_pools[i];
if (rmp)
{
-#if RTE_VERSION >= RTE_VERSION_NUM(16, 7, 0, 0)
unsigned count = rte_mempool_avail_count (rmp);
unsigned free_count = rte_mempool_in_use_count (rmp);
-#else
- unsigned count = rte_mempool_count (rmp);
- unsigned free_count = rte_mempool_free_count (rmp);
-#endif
vlib_cli_output (vm,
"name=\"%s\" available = %7d allocated = %7d total = %7d\n",
else if (unformat (input, "worker"))
{
vlib_thread_main_t *tm = vlib_get_thread_main ();
- vlib_frame_queue_t *fq;
vlib_thread_registration_t *tr;
- int thread_id;
u32 num_workers = 0;
u32 first_worker_index = 0;
uword *p;
vlib_cli_output (vm,
"num_workers %d\n"
- "first_worker_index %d\n"
- "vlib_frame_queues[%d]:\n",
- num_workers, first_worker_index, tm->n_vlib_mains);
+ "first_worker_index %d\n",
+ num_workers, first_worker_index);
- for (thread_id = 0; thread_id < tm->n_vlib_mains; thread_id++)
- {
- fq = vlib_frame_queues[thread_id];
- if (fq)
- {
- vlib_cli_output (vm,
- "%2d: frames_queued %u\n"
- " frames_queued_hint %u\n"
- " enqueue_full_events %u\n"
- " enqueue_efd_discards %u\n",
- thread_id,
- (fq->tail - fq->head),
- (fq->tail - fq->head_hint),
- fq->enqueue_full_events,
- fq->enqueue_efd_discards);
- }
- }
}
else if (unformat (input, "help"))
{
{
dpdk_main_t *dm = &dpdk_main;
dpdk_device_t *xd;
- vlib_thread_main_t *tm = vlib_get_thread_main ();
- vlib_frame_queue_t *fq;
- int thread_id;
/* *INDENT-OFF* */
vec_foreach (xd, dm->devices)
}
/* *INDENT-ON* */
- for (thread_id = 0; thread_id < tm->n_vlib_mains; thread_id++)
- {
- fq = vlib_frame_queues[thread_id];
- if (fq)
- {
- fq->enqueue_full_events = 0;
- fq->enqueue_efd_discards = 0;
- }
- }
-
return 0;
}
vnet_hw_interface_t *hw;
dpdk_device_t *xd;
u32 hw_if_index = (u32) ~ 0;
- u32 entry, tc, queue, val, i;
+ u32 tc = (u32) ~ 0;
+ u32 queue = (u32) ~ 0;
+ u32 entry = (u32) ~ 0;
+ u32 val, i;
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
/* Detect the set of worker threads */
uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+ /* Should never happen, shut up Coverity warning */
+ if (p == 0)
+ return clib_error_return (0, "no worker registrations?");
+
vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
int worker_thread_first = tr->first_index;
int worker_thread_count = tr->count;
/* Detect the set of worker threads */
uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+ /* Should never happen, shut up Coverity warning */
+ if (p == 0)
+ return clib_error_return (0, "no worker registrations?");
+
vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
int worker_thread_first = tr->first_index;
int worker_thread_count = tr->count;
/* Packet field configuration */
- u64 mask;
- u32 id, offset;
+ u64 mask = (u64) ~ 0;
+ u32 id = (u32) ~ 0;
+ u32 offset = (u32) ~ 0;
/* HQoS params */
u32 n_subports_per_port, n_pipes_per_subport, tctbl_size;
case 0:
xd->hqos_wt[worker_thread_first + i].hqos_field0_slabpos = offset;
xd->hqos_wt[worker_thread_first + i].hqos_field0_slabmask = mask;
+ xd->hqos_wt[worker_thread_first + i].hqos_field0_slabshr =
+ __builtin_ctzll (mask);
break;
case 1:
xd->hqos_wt[worker_thread_first + i].hqos_field1_slabpos = offset;
xd->hqos_wt[worker_thread_first + i].hqos_field1_slabmask = mask;
+ xd->hqos_wt[worker_thread_first + i].hqos_field1_slabshr =
+ __builtin_ctzll (mask);
break;
case 2:
default:
xd->hqos_wt[worker_thread_first + i].hqos_field2_slabpos = offset;
xd->hqos_wt[worker_thread_first + i].hqos_field2_slabmask = mask;
+ xd->hqos_wt[worker_thread_first + i].hqos_field2_slabshr =
+ __builtin_ctzll (mask);
}
return 0;
/* Detect the set of worker threads */
p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+
+ /* Should never happen, shut up Coverity warning */
+ if (p == 0)
+ return clib_error_return (0, "no worker registrations?");
+
tr = (vlib_thread_registration_t *) p[0];
cfg = &devconf->hqos;