| 2547 | } |
| 2548 | |
| 2549 | static inline void |
| 2550 | grinder_tccache_populate(struct rte_sched_subport *subport, |
| 2551 | uint32_t pos, uint32_t qindex, uint16_t qmask) |
| 2552 | { |
| 2553 | struct rte_sched_grinder *grinder = subport->grinder + pos; |
| 2554 | uint8_t b, i; |
| 2555 | |
| 2556 | grinder->tccache_w = 0; |
| 2557 | grinder->tccache_r = 0; |
| 2558 | |
| 2559 | for (i = 0; i < RTE_SCHED_TRAFFIC_CLASS_BE; i++) { |
| 2560 | b = (uint8_t) ((qmask >> i) & 0x1); |
| 2561 | grinder->tccache_qmask[grinder->tccache_w] = b; |
| 2562 | grinder->tccache_qindex[grinder->tccache_w] = qindex + i; |
| 2563 | grinder->tccache_w += (b != 0); |
| 2564 | } |
| 2565 | |
| 2566 | b = (uint8_t) (qmask >> (RTE_SCHED_TRAFFIC_CLASS_BE)); |
| 2567 | grinder->tccache_qmask[grinder->tccache_w] = b; |
| 2568 | grinder->tccache_qindex[grinder->tccache_w] = qindex + |
| 2569 | RTE_SCHED_TRAFFIC_CLASS_BE; |
| 2570 | grinder->tccache_w += (b != 0); |
| 2571 | } |
| 2572 | |
| 2573 | static inline int |
| 2574 | grinder_next_tc(struct rte_sched_port *port, |