Enqueue packets for TX and prepare them to be sent. 8< */
| 583 | |
| 584 | /* Enqueue packets for TX and prepare them to be sent. 8< */ |
| 585 | static int |
| 586 | l2fwd_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 | |
| 609 | static void |
no test coverage detected