| 504 | } |
| 505 | |
| 506 | int32_t |
| 507 | sw_event_schedule(struct rte_eventdev *dev) |
| 508 | { |
| 509 | struct sw_evdev *sw = sw_pmd_priv(dev); |
| 510 | uint32_t in_pkts, out_pkts; |
| 511 | uint32_t out_pkts_total = 0, in_pkts_total = 0; |
| 512 | int32_t sched_quanta = sw->sched_quanta; |
| 513 | uint32_t i; |
| 514 | |
| 515 | sw->sched_called++; |
| 516 | if (unlikely(!sw->started)) |
| 517 | return -EAGAIN; |
| 518 | |
| 519 | do { |
| 520 | uint32_t in_pkts_this_iteration = 0; |
| 521 | |
| 522 | /* Pull from rx_ring for ports */ |
| 523 | do { |
| 524 | in_pkts = 0; |
| 525 | for (i = 0; i < sw->port_count; i++) { |
| 526 | /* ack the unlinks in progress as done */ |
| 527 | if (sw->ports[i].unlinks_in_progress) |
| 528 | sw->ports[i].unlinks_in_progress = 0; |
| 529 | |
| 530 | if (sw->ports[i].is_directed) |
| 531 | in_pkts += sw_schedule_pull_port_dir(sw, i); |
| 532 | else if (sw->ports[i].num_ordered_qids > 0) |
| 533 | in_pkts += sw_schedule_pull_port_lb(sw, i); |
| 534 | else |
| 535 | in_pkts += sw_schedule_pull_port_no_reorder(sw, i); |
| 536 | } |
| 537 | |
| 538 | /* QID scan for re-ordered */ |
| 539 | in_pkts += sw_schedule_reorder(sw, 0, |
| 540 | sw->qid_count); |
| 541 | in_pkts_this_iteration += in_pkts; |
| 542 | } while (in_pkts > 4 && |
| 543 | (int)in_pkts_this_iteration < sched_quanta); |
| 544 | |
| 545 | out_pkts = sw_schedule_qid_to_cq(sw); |
| 546 | out_pkts_total += out_pkts; |
| 547 | in_pkts_total += in_pkts_this_iteration; |
| 548 | |
| 549 | if (in_pkts == 0 && out_pkts == 0) |
| 550 | break; |
| 551 | } while ((int)out_pkts_total < sched_quanta); |
| 552 | |
| 553 | sw->stats.tx_pkts += out_pkts_total; |
| 554 | sw->stats.rx_pkts += in_pkts_total; |
| 555 | |
| 556 | sw->sched_no_iq_enqueues += (in_pkts_total == 0); |
| 557 | sw->sched_no_cq_enqueues += (out_pkts_total == 0); |
| 558 | |
| 559 | uint64_t work_done = (in_pkts_total + out_pkts_total) != 0; |
| 560 | sw->sched_progress_last_iter = work_done; |
| 561 | |
| 562 | uint64_t cqs_scheds_last_iter = 0; |
| 563 |
no test coverage detected