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

Function sw_schedule_reorder

dpdk/drivers/event/sw/sw_evdev_scheduler.c:267–342  ·  view source on GitHub ↗

This function will perform re-ordering of packets, and injecting into * the appropriate QID IQ. As LB and DIR QIDs are in the same array, but *NOT* * contiguous in that array, this function accepts a "range" of QIDs to scan. */

Source from the content-addressed store, hash-verified

265 * contiguous in that array, this function accepts a "range" of QIDs to scan.
266 */
267static uint16_t
268sw_schedule_reorder(struct sw_evdev *sw, int qid_start, int qid_end)
269{
270 /* Perform egress reordering */
271 struct rte_event *qe;
272 uint32_t pkts_iter = 0;
273
274 for (; qid_start < qid_end; qid_start++) {
275 struct sw_qid *qid = &sw->qids[qid_start];
276 unsigned int i, num_entries_in_use;
277
278 if (qid->type != RTE_SCHED_TYPE_ORDERED)
279 continue;
280
281 num_entries_in_use = rob_ring_free_count(
282 qid->reorder_buffer_freelist);
283
284 if (num_entries_in_use < sw->sched_min_burst)
285 num_entries_in_use = 0;
286
287 for (i = 0; i < num_entries_in_use; i++) {
288 struct reorder_buffer_entry *entry;
289 int j;
290
291 entry = &qid->reorder_buffer[qid->reorder_buffer_index];
292
293 if (!entry->ready)
294 break;
295
296 for (j = 0; j < entry->num_fragments; j++) {
297 uint16_t dest_qid;
298 uint16_t dest_iq;
299
300 int idx = entry->fragment_index + j;
301 qe = &entry->fragments[idx];
302
303 dest_qid = qe->queue_id;
304 dest_iq = PRIO_TO_IQ(qe->priority);
305
306 if (dest_qid >= sw->qid_count) {
307 sw->stats.rx_dropped++;
308 continue;
309 }
310
311 pkts_iter++;
312
313 struct sw_qid *q = &sw->qids[dest_qid];
314 struct sw_iq *iq = &q->iq[dest_iq];
315
316 /* we checked for space above, so enqueue must
317 * succeed
318 */
319 iq_enqueue(sw, iq, qe);
320 q->iq_pkt_mask |= (1 << (dest_iq));
321 q->iq_pkt_count[dest_iq]++;
322 q->stats.rx_pkts++;
323 }
324

Callers 1

sw_event_scheduleFunction · 0.85

Calls 3

rob_ring_free_countFunction · 0.85
iq_enqueueFunction · 0.85
rob_ring_enqueueFunction · 0.85

Tested by

no test coverage detected