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

Function send_single_packet

dpdk/examples/ipsec-secgw/ipsec_worker.h:362–393  ·  view source on GitHub ↗

Enqueue a single packet, and send burst if queue is filled */

Source from the content-addressed store, hash-verified

360
361/* Enqueue a single packet, and send burst if queue is filled */
362static __rte_always_inline int32_t
363send_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
395static __rte_always_inline void
396inbound_sp_sa(struct sp_ctx *sp, struct sa_ctx *sa, struct traffic_type *ip,

Callers 4

send_packetsFunction · 0.70
route4_pktsFunction · 0.70
route6_pktsFunction · 0.70

Calls 4

rte_lcore_idFunction · 0.85
send_fragment_packetFunction · 0.85
free_pktsFunction · 0.70
send_burstFunction · 0.70

Tested by

no test coverage detected