MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sw_dev_configure

Function sw_dev_configure

dpdk/drivers/event/sw/sw_evdev.c:504–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504static int
505sw_dev_configure(const struct rte_eventdev *dev)
506{
507 struct sw_evdev *sw = sw_pmd_priv(dev);
508 const struct rte_eventdev_data *data = dev->data;
509 const struct rte_event_dev_config *conf = &data->dev_conf;
510 int num_chunks, i;
511
512 sw->qid_count = conf->nb_event_queues;
513 sw->port_count = conf->nb_event_ports;
514 sw->nb_events_limit = conf->nb_events_limit;
515 rte_atomic32_set(&sw->inflights, 0);
516
517 /* Number of chunks sized for worst-case spread of events across IQs */
518 num_chunks = ((SW_INFLIGHT_EVENTS_TOTAL/SW_EVS_PER_Q_CHUNK)+1) +
519 sw->qid_count*SW_IQS_MAX*2;
520
521 /* If this is a reconfiguration, free the previous IQ allocation. All
522 * IQ chunk references were cleaned out of the QIDs in sw_stop(), and
523 * will be reinitialized in sw_start().
524 */
525 rte_free(sw->chunks);
526
527 sw->chunks = rte_malloc_socket(NULL,
528 sizeof(struct sw_queue_chunk) *
529 num_chunks,
530 0,
531 sw->data->socket_id);
532 if (!sw->chunks)
533 return -ENOMEM;
534
535 sw->chunk_list_head = NULL;
536 for (i = 0; i < num_chunks; i++)
537 iq_free_chunk(sw, &sw->chunks[i]);
538
539 if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT)
540 return -ENOTSUP;
541
542 return 0;
543}
544
545struct rte_eth_dev;
546

Callers

nothing calls this directly

Calls 5

sw_pmd_privFunction · 0.85
rte_atomic32_setFunction · 0.85
rte_freeFunction · 0.85
rte_malloc_socketFunction · 0.85
iq_free_chunkFunction · 0.85

Tested by

no test coverage detected