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

Function nfp_flow_compile_items

dpdk/drivers/net/nfp/nfp_flow.c:2108–2161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2106}
2107
2108static int
2109nfp_flow_compile_items(struct nfp_flower_representor *representor,
2110 const struct rte_flow_item items[],
2111 struct rte_flow *nfp_flow)
2112{
2113 int ret;
2114 char *mbuf_off_mask;
2115 char *mbuf_off_exact;
2116 bool is_tun_flow = false;
2117 bool is_outer_layer = true;
2118 struct nfp_flower_meta_tci *meta_tci;
2119 const struct rte_flow_item *loop_item;
2120
2121 mbuf_off_exact = nfp_flow->payload.unmasked_data +
2122 sizeof(struct nfp_flower_meta_tci) +
2123 sizeof(struct nfp_flower_in_port);
2124 mbuf_off_mask = nfp_flow->payload.mask_data +
2125 sizeof(struct nfp_flower_meta_tci) +
2126 sizeof(struct nfp_flower_in_port);
2127
2128 meta_tci = (struct nfp_flower_meta_tci *)nfp_flow->payload.unmasked_data;
2129 if ((meta_tci->nfp_flow_key_layer & NFP_FLOWER_LAYER_EXT_META) != 0) {
2130 mbuf_off_exact += sizeof(struct nfp_flower_ext_meta);
2131 mbuf_off_mask += sizeof(struct nfp_flower_ext_meta);
2132 }
2133
2134 if (nfp_flow_tcp_flag_check(items))
2135 nfp_flow->tcp_flag = true;
2136
2137 /* Check if this is a tunnel flow and get the inner item */
2138 is_tun_flow = nfp_flow_inner_item_get(items, &loop_item);
2139 if (is_tun_flow)
2140 is_outer_layer = false;
2141
2142 /* Go over items */
2143 ret = nfp_flow_compile_item_proc(representor, loop_item, nfp_flow,
2144 &mbuf_off_exact, &mbuf_off_mask, is_outer_layer);
2145 if (ret != 0) {
2146 PMD_DRV_LOG(ERR, "nfp flow item compile failed.");
2147 return -EINVAL;
2148 }
2149
2150 /* Go over inner items */
2151 if (is_tun_flow) {
2152 ret = nfp_flow_compile_item_proc(representor, items, nfp_flow,
2153 &mbuf_off_exact, &mbuf_off_mask, true);
2154 if (ret != 0) {
2155 PMD_DRV_LOG(ERR, "nfp flow outer item compile failed.");
2156 return -EINVAL;
2157 }
2158 }
2159
2160 return 0;
2161}
2162
2163static int
2164nfp_flow_action_output(char *act_data,

Callers 1

nfp_flow_processFunction · 0.85

Calls 3

nfp_flow_tcp_flag_checkFunction · 0.85
nfp_flow_inner_item_getFunction · 0.85

Tested by

no test coverage detected