Enqueue a single packet, and send burst if queue is filled */
| 360 | |
| 361 | /* Enqueue a single packet, and send burst if queue is filled */ |
| 362 | static __rte_always_inline int32_t |
| 363 | send_single_packet(struct rte_mbuf *m, uint16_t port, uint8_t proto) |
| 364 | { |
| 365 | uint32_t lcore_id; |
| 366 | uint16_t len; |
| 367 | struct lcore_conf *qconf; |
| 368 | |
| 369 | lcore_id = rte_lcore_id(); |
| 370 | |
| 371 | qconf = &lcore_conf[lcore_id]; |
| 372 | len = qconf->tx_mbufs[port].len; |
| 373 | |
| 374 | /* L2 header is already part of packet */ |
| 375 | if (m->pkt_len - RTE_ETHER_HDR_LEN <= mtu_size) { |
| 376 | qconf->tx_mbufs[port].m_table[len] = m; |
| 377 | len++; |
| 378 | |
| 379 | /* need to fragment the packet */ |
| 380 | } else if (frag_tbl_sz > 0) |
| 381 | len = send_fragment_packet(qconf, m, port, proto); |
| 382 | else |
| 383 | free_pkts(&m, 1); |
| 384 | |
| 385 | /* enough pkts to be sent */ |
| 386 | if (unlikely(len == MAX_PKT_BURST)) { |
| 387 | send_burst(qconf, MAX_PKT_BURST, port); |
| 388 | len = 0; |
| 389 | } |
| 390 | |
| 391 | qconf->tx_mbufs[port].len = len; |
| 392 | return 0; |
| 393 | } |
| 394 | |
| 395 | static __rte_always_inline void |
| 396 | inbound_sp_sa(struct sp_ctx *sp, struct sa_ctx *sa, struct traffic_type *ip, |
no test coverage detected