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

Function kernel_tx_process_mbuf

dpdk/lib/node/kernel_tx.c:19–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include "node_private.h"
18
19static __rte_always_inline void
20kernel_tx_process_mbuf(struct rte_node *node, struct rte_mbuf **mbufs, uint16_t cnt)
21{
22 kernel_tx_node_ctx_t *ctx = (kernel_tx_node_ctx_t *)node->ctx;
23 struct sockaddr_in sin = {0};
24 struct rte_ipv4_hdr *ip4;
25 size_t len;
26 char *buf;
27 int i;
28
29 for (i = 0; i < cnt; i++) {
30 ip4 = rte_pktmbuf_mtod(mbufs[i], struct rte_ipv4_hdr *);
31 len = rte_pktmbuf_data_len(mbufs[i]);
32 buf = (char *)ip4;
33
34 sin.sin_family = AF_INET;
35 sin.sin_port = 0;
36 sin.sin_addr.s_addr = ip4->dst_addr;
37
38 if (sendto(ctx->sock, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0)
39 node_err("kernel_tx", "Unable to send packets: %s", strerror(errno));
40 }
41}
42
43static uint16_t
44kernel_tx_node_process(struct rte_graph *graph __rte_unused, struct rte_node *node, void **objs,

Callers 1

kernel_tx_node_processFunction · 0.85

Calls 1

sendtoFunction · 0.50

Tested by

no test coverage detected