| 190 | } |
| 191 | |
| 192 | static inline void |
| 193 | check_sp_sa_bulk(struct sp_ctx *sp, struct sa_ctx *sa_ctx, |
| 194 | struct traffic_type *ip) |
| 195 | { |
| 196 | struct ipsec_sa *sa; |
| 197 | uint32_t i, j, res; |
| 198 | struct rte_mbuf *m; |
| 199 | |
| 200 | if (unlikely(sp == NULL || ip->num == 0)) |
| 201 | return; |
| 202 | |
| 203 | rte_acl_classify((struct rte_acl_ctx *)sp, ip->data, ip->res, ip->num, |
| 204 | DEFAULT_MAX_CATEGORIES); |
| 205 | |
| 206 | j = 0; |
| 207 | for (i = 0; i < ip->num; i++) { |
| 208 | m = ip->pkts[i]; |
| 209 | res = ip->res[i]; |
| 210 | if (unlikely(res == DISCARD)) |
| 211 | free_pkts(&m, 1); |
| 212 | else if (res == BYPASS) |
| 213 | ip->pkts[j++] = m; |
| 214 | else { |
| 215 | sa = *(struct ipsec_sa **)rte_security_dynfield(m); |
| 216 | if (sa == NULL) { |
| 217 | free_pkts(&m, 1); |
| 218 | continue; |
| 219 | } |
| 220 | |
| 221 | /* SPI on the packet should match with the one in SA */ |
| 222 | if (unlikely(sa->spi != sa_ctx->sa[res - 1].spi)) { |
| 223 | free_pkts(&m, 1); |
| 224 | continue; |
| 225 | } |
| 226 | |
| 227 | ip->pkts[j++] = m; |
| 228 | } |
| 229 | } |
| 230 | ip->num = j; |
| 231 | } |
| 232 | |
| 233 | static inline void |
| 234 | ipv4_pkt_l3_len_set(struct rte_mbuf *pkt) |
no test coverage detected