Lines Matching refs:sw

35 	struct sw_evdev *sw = sw_pmd_priv(dev);  in sw_port_link()  local
40 struct sw_qid *q = &sw->qids[queues[i]]; in sw_port_link()
97 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_port_unlink() local
102 struct sw_qid *q = &sw->qids[queues[i]]; in sw_port_unlink()
139 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_port_setup() local
140 struct sw_port *p = &sw->ports[port_id]; in sw_port_setup()
155 rte_atomic32_sub(&sw->inflights, possible_inflights); in sw_port_setup()
160 p->sw = sw; in sw_port_setup()
201 sw->cq_ring_space[port_id] = conf->dequeue_depth; in sw_port_setup()
228 qid_init(struct sw_evdev *sw, unsigned int idx, int type, in qid_init() argument
232 int dev_id = sw->data->dev_id; in qid_init()
233 int socket_id = sw->data->socket_id; in qid_init()
235 struct sw_qid *qid = &sw->qids[idx]; in qid_init()
319 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_queue_release() local
320 struct sw_qid *qid = &sw->qids[id]; in sw_queue_release()
345 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_queue_setup() local
347 if (sw->qids[queue_id].initialized) in sw_queue_setup()
350 return qid_init(sw, queue_id, type, conf); in sw_queue_setup()
354 sw_init_qid_iqs(struct sw_evdev *sw) in sw_init_qid_iqs() argument
360 struct sw_qid *qid = &sw->qids[i]; in sw_init_qid_iqs()
366 iq_init(sw, &qid->iq[j]); in sw_init_qid_iqs()
371 sw_qids_empty(struct sw_evdev *sw) in sw_qids_empty() argument
375 for (i = 0; i < sw->qid_count; i++) { in sw_qids_empty()
377 if (iq_count(&sw->qids[i].iq[j])) in sw_qids_empty()
386 sw_ports_empty(struct sw_evdev *sw) in sw_ports_empty() argument
390 for (i = 0; i < sw->port_count; i++) { in sw_ports_empty()
391 if ((rte_event_ring_count(sw->ports[i].rx_worker_ring)) || in sw_ports_empty()
392 rte_event_ring_count(sw->ports[i].cq_worker_ring)) in sw_ports_empty()
402 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_drain_ports() local
412 for (i = 0; i < sw->port_count; i++) { in sw_drain_ports()
428 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_drain_queue() local
440 iq_dequeue_burst(sw, iq, &ev, 1); in sw_drain_queue()
450 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_drain_queues() local
453 for (i = 0; i < sw->qid_count; i++) { in sw_drain_queues()
455 sw_drain_queue(dev, &sw->qids[i].iq[j]); in sw_drain_queues()
462 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_clean_qid_iqs() local
467 struct sw_qid *qid = &sw->qids[i]; in sw_clean_qid_iqs()
472 iq_free_chunk_list(sw, qid->iq[j].head); in sw_clean_qid_iqs()
511 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_dev_configure() local
516 sw->qid_count = conf->nb_event_queues; in sw_dev_configure()
517 sw->port_count = conf->nb_event_ports; in sw_dev_configure()
518 sw->nb_events_limit = conf->nb_events_limit; in sw_dev_configure()
519 rte_atomic32_set(&sw->inflights, 0); in sw_dev_configure()
523 sw->qid_count*SW_IQS_MAX*2; in sw_dev_configure()
529 if (sw->chunks) in sw_dev_configure()
530 rte_free(sw->chunks); in sw_dev_configure()
532 sw->chunks = rte_malloc_socket(NULL, in sw_dev_configure()
536 sw->data->socket_id); in sw_dev_configure()
537 if (!sw->chunks) in sw_dev_configure()
540 sw->chunk_list_head = NULL; in sw_dev_configure()
542 iq_free_chunk(sw, &sw->chunks[i]); in sw_dev_configure()
622 const struct sw_evdev *sw = sw_pmd_priv(dev); in sw_dump() local
629 sw->port_count, sw->qid_count); in sw_dump()
632 sw->stats.rx_pkts, sw->stats.rx_dropped, sw->stats.tx_pkts); in sw_dump()
633 fprintf(f, "\tsched calls: %"PRIu64"\n", sw->sched_called); in sw_dump()
634 fprintf(f, "\tsched cq/qid call: %"PRIu64"\n", sw->sched_cq_qid_called); in sw_dump()
635 fprintf(f, "\tsched no IQ enq: %"PRIu64"\n", sw->sched_no_iq_enqueues); in sw_dump()
636 fprintf(f, "\tsched no CQ enq: %"PRIu64"\n", sw->sched_no_cq_enqueues); in sw_dump()
637 uint32_t inflights = rte_atomic32_read(&sw->inflights); in sw_dump()
638 uint32_t credits = sw->nb_events_limit - inflights; in sw_dump()
644 for (i = 0; i < sw->port_count; i++) { in sw_dump()
646 const struct sw_port *p = &sw->ports[i]; in sw_dump()
655 "\t%sinflight %d%s\n", sw->ports[i].stats.rx_pkts, in sw_dump()
656 sw->ports[i].stats.rx_dropped, in sw_dump()
657 sw->ports[i].stats.tx_pkts, in sw_dump()
660 sw->ports[i].inflights, COL_RESET); in sw_dump()
664 sw->ports[i].inflight_max, in sw_dump()
665 sw->ports[i].avg_pkt_ticks, in sw_dump()
666 sw->ports[i].inflight_credits); in sw_dump()
707 for (i = 0; i < sw->qid_count; i++) { in sw_dump()
708 const struct sw_qid *qid = &sw->qids[i]; in sw_dump()
741 for (port = 0; port < sw->port_count; port++) { in sw_dump()
772 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_start() local
774 rte_service_component_runstate_set(sw->service_id, 1); in sw_start()
777 if (!rte_service_runstate_get(sw->service_id)) { in sw_start()
779 sw->service_name); in sw_start()
784 for (i = 0; i < sw->port_count; i++) in sw_start()
785 if (sw->ports[i].rx_worker_ring == NULL) { in sw_start()
791 for (i = 0; i < sw->qid_count; i++) in sw_start()
792 if (!sw->qids[i].initialized || in sw_start()
793 sw->qids[i].cq_num_mapped_cqs == 0) { in sw_start()
806 for (i = 0; i < sw->qid_count; i++) { in sw_start()
807 if (sw->qids[i].priority == j) { in sw_start()
808 sw->qids_prioritized[qidx] = &sw->qids[i]; in sw_start()
814 sw_init_qid_iqs(sw); in sw_start()
816 if (sw_xstats_init(sw) < 0) in sw_start()
820 sw->started = 1; in sw_start()
828 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_stop() local
832 runstate = rte_service_runstate_get(sw->service_id); in sw_stop()
834 rte_service_runstate_set(sw->service_id, 0); in sw_stop()
836 while (rte_service_may_be_active(sw->service_id)) in sw_stop()
840 while (!(sw_qids_empty(sw) && sw_ports_empty(sw))) { in sw_stop()
847 sw_xstats_uninit(sw); in sw_stop()
848 sw->started = 0; in sw_stop()
852 rte_service_runstate_set(sw->service_id, 1); in sw_stop()
858 struct sw_evdev *sw = sw_pmd_priv(dev); in sw_close() local
861 for (i = 0; i < sw->qid_count; i++) in sw_close()
863 sw->qid_count = 0; in sw_close()
865 for (i = 0; i < sw->port_count; i++) in sw_close()
866 sw_port_release(&sw->ports[i]); in sw_close()
867 sw->port_count = 0; in sw_close()
869 memset(&sw->stats, 0, sizeof(sw->stats)); in sw_close()
870 sw->sched_called = 0; in sw_close()
871 sw->sched_no_iq_enqueues = 0; in sw_close()
872 sw->sched_no_cq_enqueues = 0; in sw_close()
873 sw->sched_cq_qid_called = 0; in sw_close()
992 struct sw_evdev *sw; in sw_probe() local
1098 sw = dev->data->dev_private; in sw_probe()
1099 sw->data = dev->data; in sw_probe()
1102 sw->credit_update_quanta = credit_quanta; in sw_probe()
1103 sw->sched_quanta = sched_quanta; in sw_probe()
1104 sw->sched_min_burst_size = min_burst_size; in sw_probe()
1105 sw->sched_deq_burst_size = deq_burst_size; in sw_probe()
1106 sw->refill_once_per_iter = refill_once; in sw_probe()
1112 snprintf(sw->service_name, sizeof(sw->service_name), "%s_service", in sw_probe()
1118 int32_t ret = rte_service_component_register(&service, &sw->service_id); in sw_probe()
1125 dev->data->service_id = sw->service_id; in sw_probe()
1154 RTE_LOG_REGISTER(eventdev_sw_log_level, pmd.event.sw, NOTICE);