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

Function send_burst

lib/ff_dpdk_if.c:1972–2011  ·  view source on GitHub ↗

Send burst of packets on an output interface */

Source from the content-addressed store, hash-verified

1970
1971/* Send burst of packets on an output interface */
1972static inline int
1973send_burst(struct lcore_conf *qconf, uint16_t n, uint8_t port)
1974{
1975 struct rte_mbuf **m_table;
1976 int ret;
1977 uint16_t queueid;
1978
1979 queueid = qconf->tx_queue_id[port];
1980 m_table = (struct rte_mbuf **)qconf->tx_mbufs[port].m_table;
1981
1982 if (unlikely(ff_global_cfg.pcap.enable)) {
1983 uint16_t i;
1984 for (i = 0; i < n; i++) {
1985 ff_dump_packets( ff_global_cfg.pcap.save_path, m_table[i],
1986 ff_global_cfg.pcap.snap_len, ff_global_cfg.pcap.save_len);
1987 }
1988 }
1989
1990 ret = rte_eth_tx_burst(port, queueid, m_table, n);
1991 uint16_t i;
1992 for (i = 0; i < ret; i++) {
1993 ff_traffic.tx_packets += m_table[i]->nb_segs; // use ret or rets' nb_segs?
1994 ff_traffic.tx_bytes += rte_pktmbuf_pkt_len(m_table[i]);
1995#ifdef FF_USE_PAGE_ARRAY
1996 if (qconf->tx_mbufs[port].bsd_m_table[i])
1997 ff_enq_tx_bsdmbuf(port, qconf->tx_mbufs[port].bsd_m_table[i], m_table[i]->nb_segs);
1998#endif
1999 }
2000 if (unlikely(ret < n)) {
2001 do {
2002 ff_traffic.tx_dropped += m_table[ret]->nb_segs;
2003 rte_pktmbuf_free(m_table[ret]);
2004#ifdef FF_USE_PAGE_ARRAY
2005 if ( qconf->tx_mbufs[port].bsd_m_table[ret] )
2006 ff_mbuf_free(qconf->tx_mbufs[port].bsd_m_table[ret]);
2007#endif
2008 } while (++ret < n);
2009 }
2010 return 0;
2011}
2012
2013/* Enqueue a single packet, and send burst if queue is filled */
2014static inline int

Callers 3

send_single_packetFunction · 0.70
ff_dpdk_if_sendFunction · 0.70
main_loopFunction · 0.70

Calls 5

ff_dump_packetsFunction · 0.85
rte_eth_tx_burstFunction · 0.85
ff_enq_tx_bsdmbufFunction · 0.85
rte_pktmbuf_freeFunction · 0.85
ff_mbuf_freeFunction · 0.85

Tested by

no test coverage detected