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

Function l2fwd_send_packet

dpdk/examples/l2fwd-crypto/main.c:585–606  ·  view source on GitHub ↗

Enqueue packets for TX and prepare them to be sent. 8< */

Source from the content-addressed store, hash-verified

583
584/* Enqueue packets for TX and prepare them to be sent. 8< */
585static int
586l2fwd_send_packet(struct rte_mbuf *m, uint16_t port)
587{
588 unsigned lcore_id, len;
589 struct lcore_queue_conf *qconf;
590
591 lcore_id = rte_lcore_id();
592
593 qconf = &lcore_queue_conf[lcore_id];
594 len = qconf->pkt_buf[port].len;
595 qconf->pkt_buf[port].buffer[len] = m;
596 len++;
597
598 /* enough pkts to be sent */
599 if (unlikely(len == MAX_PKT_BURST)) {
600 l2fwd_send_burst(qconf, MAX_PKT_BURST, port);
601 len = 0;
602 }
603
604 qconf->pkt_buf[port].len = len;
605 return 0;
606}
607/* >8 End of Enqueuing packets for TX. */
608
609static void

Callers 1

l2fwd_simple_forwardFunction · 0.85

Calls 2

rte_lcore_idFunction · 0.85
l2fwd_send_burstFunction · 0.85

Tested by

no test coverage detected