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

Function l2fwd_simple_forward

dpdk/examples/l2fwd-keepalive/main.c:163–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static void
164l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
165{
166 struct rte_ether_hdr *eth;
167 void *tmp;
168 int sent;
169 unsigned dst_port;
170 struct rte_eth_dev_tx_buffer *buffer;
171
172 dst_port = l2fwd_dst_ports[portid];
173 eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
174
175 /* 02:00:00:00:00:xx */
176 tmp = &eth->dst_addr.addr_bytes[0];
177 *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
178
179 /* src addr */
180 rte_ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], &eth->src_addr);
181
182 buffer = tx_buffer[dst_port];
183 sent = rte_eth_tx_buffer(dst_port, 0, buffer, m);
184 if (sent)
185 port_statistics[dst_port].tx += sent;
186}
187
188/* main processing loop */
189static void

Callers 1

l2fwd_main_loopFunction · 0.70

Calls 2

rte_ether_addr_copyFunction · 0.85
rte_eth_tx_bufferFunction · 0.85

Tested by

no test coverage detected