| 161 | } |
| 162 | |
| 163 | static inline void |
| 164 | check_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 | |
| 192 | static inline void |
| 193 | check_sp_sa_bulk(struct sp_ctx *sp, struct sa_ctx *sa_ctx, |
no test coverage detected