MCPcopy Index your code
hub / github.com/F-Stack/f-stack / rte_event_queue_setup

Function rte_event_queue_setup

dpdk/lib/eventdev/rte_eventdev.c:607–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605
606
607int
608rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
609 const struct rte_event_queue_conf *queue_conf)
610{
611 struct rte_eventdev *dev;
612 struct rte_event_queue_conf def_conf;
613
614 RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
615 dev = &rte_eventdevs[dev_id];
616
617 if (!is_valid_queue(dev, queue_id)) {
618 RTE_EDEV_LOG_ERR("Invalid queue_id=%" PRIu8, queue_id);
619 return -EINVAL;
620 }
621
622 /* Check nb_atomic_flows limit */
623 if (is_valid_atomic_queue_conf(queue_conf)) {
624 if (queue_conf->nb_atomic_flows == 0 ||
625 queue_conf->nb_atomic_flows >
626 dev->data->dev_conf.nb_event_queue_flows) {
627 RTE_EDEV_LOG_ERR(
628 "dev%d queue%d Invalid nb_atomic_flows=%d max_flows=%d",
629 dev_id, queue_id, queue_conf->nb_atomic_flows,
630 dev->data->dev_conf.nb_event_queue_flows);
631 return -EINVAL;
632 }
633 }
634
635 /* Check nb_atomic_order_sequences limit */
636 if (is_valid_ordered_queue_conf(queue_conf)) {
637 if (queue_conf->nb_atomic_order_sequences == 0 ||
638 queue_conf->nb_atomic_order_sequences >
639 dev->data->dev_conf.nb_event_queue_flows) {
640 RTE_EDEV_LOG_ERR(
641 "dev%d queue%d Invalid nb_atomic_order_seq=%d max_flows=%d",
642 dev_id, queue_id, queue_conf->nb_atomic_order_sequences,
643 dev->data->dev_conf.nb_event_queue_flows);
644 return -EINVAL;
645 }
646 }
647
648 if (dev->data->dev_started) {
649 RTE_EDEV_LOG_ERR(
650 "device %d must be stopped to allow queue setup", dev_id);
651 return -EBUSY;
652 }
653
654 if (*dev->dev_ops->queue_setup == NULL)
655 return -ENOTSUP;
656
657 if (queue_conf == NULL) {
658 if (*dev->dev_ops->queue_def_conf == NULL)
659 return -ENOTSUP;
660 (*dev->dev_ops->queue_def_conf)(dev, queue_id, &def_conf);
661 queue_conf = &def_conf;
662 }
663
664 dev->data->queues_cfg[queue_id] = *queue_conf;

Callers 15

octeontx_probeFunction · 0.85
create_lb_qidsFunction · 0.85
test_single_linkFunction · 0.85
test_directed_trafficFunction · 0.85
test_deferred_schedFunction · 0.85
test_delayed_popFunction · 0.85
create_queues_typeFunction · 0.85
create_lb_qidsFunction · 0.85
create_directed_qidsFunction · 0.85
port_reconfig_creditsFunction · 0.85

Calls 3

is_valid_queueFunction · 0.85

Tested by 15

create_lb_qidsFunction · 0.68
test_single_linkFunction · 0.68
test_directed_trafficFunction · 0.68
test_deferred_schedFunction · 0.68
test_delayed_popFunction · 0.68
create_queues_typeFunction · 0.68
create_lb_qidsFunction · 0.68
create_directed_qidsFunction · 0.68
port_reconfig_creditsFunction · 0.68
port_single_lb_reconfigFunction · 0.68