| 261 | } |
| 262 | |
| 263 | extern int |
| 264 | rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx, enum rte_acl_classify_alg alg) |
| 265 | { |
| 266 | int32_t rc; |
| 267 | |
| 268 | /* formal parameters check */ |
| 269 | if (ctx == NULL || (uint32_t)alg >= RTE_DIM(classify_fns)) |
| 270 | return -EINVAL; |
| 271 | |
| 272 | /* user asked us to select the *best* one */ |
| 273 | if (alg == RTE_ACL_CLASSIFY_DEFAULT) |
| 274 | alg = acl_get_best_alg(); |
| 275 | |
| 276 | /* check that given alg is supported */ |
| 277 | rc = acl_check_alg(alg); |
| 278 | if (rc != 0) |
| 279 | return rc; |
| 280 | |
| 281 | ctx->alg = alg; |
| 282 | return 0; |
| 283 | } |
| 284 | |
| 285 | int |
| 286 | rte_acl_classify_alg(const struct rte_acl_ctx *ctx, const uint8_t **data, |