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

Function ip6_rewrite_node_process

dpdk/lib/node/ip6_rewrite.c:33–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 (((struct ip6_rewrite_node_ctx *)ctx)->mbuf_priv1_off)
32
33static uint16_t
34ip6_rewrite_node_process(struct rte_graph *graph, struct rte_node *node,
35 void **objs, uint16_t nb_objs)
36{
37 struct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts;
38 struct ip6_rewrite_nh_header *nh = ip6_rewrite_nm->nh;
39 const int dyn = IP6_REWRITE_NODE_PRIV1_OFF(node->ctx);
40 uint16_t next0, next1, next2, next3, next_index;
41 uint16_t n_left_from, held = 0, last_spec = 0;
42 struct rte_ipv6_hdr *ip0, *ip1, *ip2, *ip3;
43 void *d0, *d1, *d2, *d3;
44 void **to_next, **from;
45 rte_xmm_t priv01;
46 rte_xmm_t priv23;
47 int i;
48
49 /* Speculative next as last next */
50 next_index = IP6_REWRITE_NODE_LAST_NEXT(node->ctx);
51 rte_prefetch0(nh);
52
53 pkts = (struct rte_mbuf **)objs;
54 from = objs;
55 n_left_from = nb_objs;
56
57 for (i = 0; i < 4 && i < n_left_from; i++)
58 rte_prefetch0(pkts[i]);
59
60 /* Get stream for the speculated next node */
61 to_next = rte_node_next_stream_get(graph, node, next_index, nb_objs);
62 /* Update Ethernet header of pkts */
63 while (n_left_from >= 4) {
64 if (likely(n_left_from > 7)) {
65 /* Prefetch only next-mbuf struct and priv area.
66 * Data need not be prefetched as we only write.
67 */
68 rte_prefetch0(pkts[4]);
69 rte_prefetch0(pkts[5]);
70 rte_prefetch0(pkts[6]);
71 rte_prefetch0(pkts[7]);
72 }
73
74 mbuf0 = pkts[0];
75 mbuf1 = pkts[1];
76 mbuf2 = pkts[2];
77 mbuf3 = pkts[3];
78
79 pkts += 4;
80 n_left_from -= 4;
81 priv01.u64[0] = node_mbuf_priv1(mbuf0, dyn)->u;
82 priv01.u64[1] = node_mbuf_priv1(mbuf1, dyn)->u;
83 priv23.u64[0] = node_mbuf_priv1(mbuf2, dyn)->u;
84 priv23.u64[1] = node_mbuf_priv1(mbuf3, dyn)->u;
85
86 /* Update next_hop rewrite ethernet hdr on mbuf0 */
87 d0 = rte_pktmbuf_mtod(mbuf0, void *);
88 rte_memcpy(d0, nh[priv01.u16[0]].rewrite_data,
89 nh[priv01.u16[0]].rewrite_len);
90

Callers

nothing calls this directly

Calls 7

rte_node_next_stream_getFunction · 0.85
rte_node_enqueue_x1Function · 0.85
rte_node_next_stream_putFunction · 0.85
node_mbuf_priv1Function · 0.70
rte_prefetch0Function · 0.50
rte_memcpyFunction · 0.50

Tested by

no test coverage detected