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

Function check_sp_bulk

dpdk/examples/ipsec-secgw/ipsec_worker.c:163–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static inline void
164check_sp_bulk(struct sp_ctx *sp, struct traffic_type *ip,
165 struct traffic_type *ipsec)
166{
167 uint32_t i, j, res;
168 struct rte_mbuf *m;
169
170 if (unlikely(sp == NULL || ip->num == 0))
171 return;
172
173 rte_acl_classify((struct rte_acl_ctx *)sp, ip->data, ip->res, ip->num,
174 DEFAULT_MAX_CATEGORIES);
175
176 j = 0;
177 for (i = 0; i < ip->num; i++) {
178 m = ip->pkts[i];
179 res = ip->res[i];
180 if (unlikely(res == DISCARD))
181 free_pkts(&m, 1);
182 else if (res == BYPASS)
183 ip->pkts[j++] = m;
184 else {
185 ipsec->res[ipsec->num] = res - 1;
186 ipsec->pkts[ipsec->num++] = m;
187 }
188 }
189 ip->num = j;
190}
191
192static inline void
193check_sp_sa_bulk(struct sp_ctx *sp, struct sa_ctx *sa_ctx,

Callers 1

Calls 2

rte_acl_classifyFunction · 0.85
free_pktsFunction · 0.70

Tested by

no test coverage detected