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

Function forward_shared_rxq

dpdk/app/test-pmd/shared_rxq_fwd.c:65–90  ·  view source on GitHub ↗

* Forward packets from shared Rx queue. * * Source port of packets are identified by mbuf->port. */

Source from the content-addressed store, hash-verified

63 * Source port of packets are identified by mbuf->port.
64 */
65static void
66forward_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
92static bool
93shared_rxq_fwd(struct fwd_stream *fs)

Callers 1

shared_rxq_fwdFunction · 0.85

Calls 2

forward_sub_burstFunction · 0.85
rte_prefetch0Function · 0.50

Tested by

no test coverage detected