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

Function lsi_simple_forward

dpdk/examples/link_status_interrupt/main.c:170–192  ·  view source on GitHub ↗

Replacing the source and destination MAC addresses. 8< */

Source from the content-addressed store, hash-verified

168
169/* Replacing the source and destination MAC addresses. 8< */
170static void
171lsi_simple_forward(struct rte_mbuf *m, unsigned portid)
172{
173 struct rte_ether_hdr *eth;
174 void *tmp;
175 unsigned dst_port = lsi_dst_ports[portid];
176 int sent;
177 struct rte_eth_dev_tx_buffer *buffer;
178
179 eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
180
181 /* 02:00:00:00:00:xx */
182 tmp = &eth->dst_addr.addr_bytes[0];
183 *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
184
185 /* src addr */
186 rte_ether_addr_copy(&lsi_ports_eth_addr[dst_port], &eth->src_addr);
187
188 buffer = tx_buffer[dst_port];
189 sent = rte_eth_tx_buffer(dst_port, 0, buffer, m);
190 if (sent)
191 port_statistics[dst_port].tx += sent;
192}
193/* >8 End of replacing the source and destination MAC addresses. */
194
195/* main processing loop */

Callers 1

lsi_main_loopFunction · 0.85

Calls 2

rte_ether_addr_copyFunction · 0.85
rte_eth_tx_bufferFunction · 0.85

Tested by

no test coverage detected