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

Function inline_tx_mbuf

dpdk/drivers/net/cxgbe/sge.c:1287–1302  ·  view source on GitHub ↗

* inline_tx_mbuf: inline a packet's data into TX descriptors * @q: the TX queue where the packet will be inlined * @from: pointer to data portion of packet * @to: pointer after cpl where data has to be inlined * @len: length of data to inline * * Inline a packet's contents directly to TX descriptors, starting at * the given position within the TX DMA ring. * Most of the complexity of this

Source from the content-addressed store, hash-verified

1285 * in the middle of the packet we want to inline.
1286 */
1287static void inline_tx_mbuf(const struct sge_txq *q, caddr_t from, caddr_t *to,
1288 int len)
1289{
1290 int left = RTE_PTR_DIFF(q->stat, *to);
1291
1292 if (likely((uintptr_t)*to + len <= (uintptr_t)q->stat)) {
1293 rte_memcpy(*to, from, len);
1294 *to = RTE_PTR_ADD(*to, len);
1295 } else {
1296 rte_memcpy(*to, from, left);
1297 from = RTE_PTR_ADD(from, left);
1298 left = len - left;
1299 rte_memcpy((void *)q->desc, from, left);
1300 *to = RTE_PTR_ADD((void *)q->desc, left);
1301 }
1302}
1303
1304/**
1305 * ctrl_xmit - send a packet through an SGE control Tx queue

Callers 1

ctrl_xmitFunction · 0.85

Calls 1

rte_memcpyFunction · 0.50

Tested by

no test coverage detected