| 352 | } |
| 353 | |
| 354 | static __rte_always_inline uint32_t |
| 355 | __pull_port_lb(struct sw_evdev *sw, uint32_t port_id, int allow_reorder) |
| 356 | { |
| 357 | static struct reorder_buffer_entry dummy_rob; |
| 358 | uint32_t pkts_iter = 0; |
| 359 | struct sw_port *port = &sw->ports[port_id]; |
| 360 | |
| 361 | /* If shadow ring has 0 pkts, pull from worker ring */ |
| 362 | if (!sw->refill_once_per_iter && port->pp_buf_count == 0) |
| 363 | sw_refill_pp_buf(sw, port); |
| 364 | |
| 365 | while (port->pp_buf_count) { |
| 366 | const struct rte_event *qe = &port->pp_buf[port->pp_buf_start]; |
| 367 | struct sw_hist_list_entry *hist_entry = NULL; |
| 368 | uint8_t flags = qe->op; |
| 369 | const uint16_t eop = !(flags & QE_FLAG_NOT_EOP); |
| 370 | int needs_reorder = 0; |
| 371 | /* if no-reordering, having PARTIAL == NEW */ |
| 372 | if (!allow_reorder && !eop) |
| 373 | flags = QE_FLAG_VALID; |
| 374 | |
| 375 | uint32_t iq_num = PRIO_TO_IQ(qe->priority); |
| 376 | struct sw_qid *qid = &sw->qids[qe->queue_id]; |
| 377 | |
| 378 | /* now process based on flags. Note that for directed |
| 379 | * queues, the enqueue_flush masks off all but the |
| 380 | * valid flag. This makes FWD and PARTIAL enqueues just |
| 381 | * NEW type, and makes DROPS no-op calls. |
| 382 | */ |
| 383 | if ((flags & QE_FLAG_COMPLETE) && port->inflights > 0) { |
| 384 | const uint32_t hist_tail = port->hist_tail & |
| 385 | (SW_PORT_HIST_LIST - 1); |
| 386 | |
| 387 | hist_entry = &port->hist_list[hist_tail]; |
| 388 | const uint32_t hist_qid = hist_entry->qid; |
| 389 | const uint32_t hist_fid = hist_entry->fid; |
| 390 | |
| 391 | struct sw_fid_t *fid = |
| 392 | &sw->qids[hist_qid].fids[hist_fid]; |
| 393 | fid->pcount -= eop; |
| 394 | if (fid->pcount == 0) |
| 395 | fid->cq = -1; |
| 396 | |
| 397 | if (allow_reorder) { |
| 398 | /* set reorder ready if an ordered QID */ |
| 399 | uintptr_t rob_ptr = |
| 400 | (uintptr_t)hist_entry->rob_entry; |
| 401 | const uintptr_t valid = (rob_ptr != 0); |
| 402 | needs_reorder = valid; |
| 403 | rob_ptr |= |
| 404 | ((valid - 1) & (uintptr_t)&dummy_rob); |
| 405 | struct reorder_buffer_entry *tmp_rob_ptr = |
| 406 | (struct reorder_buffer_entry *)rob_ptr; |
| 407 | tmp_rob_ptr->ready = eop * needs_reorder; |
| 408 | } |
| 409 | |
| 410 | port->inflights -= eop; |
| 411 | port->hist_tail += eop; |
no test coverage detected