* Forward packets from shared Rx queue. * * Source port of packets are identified by mbuf->port. */
| 63 | * Source port of packets are identified by mbuf->port. |
| 64 | */ |
| 65 | static void |
| 66 | forward_shared_rxq(struct fwd_stream *fs, uint16_t nb_rx, |
| 67 | struct rte_mbuf **pkts_burst) |
| 68 | { |
| 69 | uint16_t i, nb_sub_burst, port, last_port; |
| 70 | |
| 71 | nb_sub_burst = 0; |
| 72 | last_port = pkts_burst[0]->port; |
| 73 | /* Locate sub-burst according to mbuf->port. */ |
| 74 | for (i = 0; i < nb_rx - 1; ++i) { |
| 75 | rte_prefetch0(pkts_burst[i + 1]); |
| 76 | port = pkts_burst[i]->port; |
| 77 | if (i > 0 && last_port != port) { |
| 78 | /* Forward packets with same source port. */ |
| 79 | forward_sub_burst(fs, last_port, nb_sub_burst, |
| 80 | &pkts_burst[i - nb_sub_burst]); |
| 81 | nb_sub_burst = 0; |
| 82 | last_port = port; |
| 83 | } |
| 84 | nb_sub_burst++; |
| 85 | } |
| 86 | /* Last sub-burst. */ |
| 87 | nb_sub_burst++; |
| 88 | forward_sub_burst(fs, last_port, nb_sub_burst, |
| 89 | &pkts_burst[nb_rx - nb_sub_burst]); |
| 90 | } |
| 91 | |
| 92 | static bool |
| 93 | shared_rxq_fwd(struct fwd_stream *fs) |
no test coverage detected