* Internal validation function. For validating both actions and items. * * @param[in] dev * Pointer to the rte_eth_dev structure. * @param[in] attr * Pointer to the flow attributes. * @param[in] items * Pointer to the list of items. * @param[in] actions * Pointer to the list of actions. * @param[in] external * This flow rule is created by request external to PMD. * @param[in]
| 7386 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 7387 | */ |
| 7388 | static int |
| 7389 | flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, |
| 7390 | const struct rte_flow_item items[], |
| 7391 | const struct rte_flow_action actions[], |
| 7392 | bool external, int hairpin, struct rte_flow_error *error) |
| 7393 | { |
| 7394 | int ret; |
| 7395 | uint64_t aso_mask, action_flags = 0; |
| 7396 | uint64_t item_flags = 0; |
| 7397 | uint64_t last_item = 0; |
| 7398 | uint8_t next_protocol = 0xff; |
| 7399 | uint16_t ether_type = 0; |
| 7400 | int actions_n = 0; |
| 7401 | uint8_t item_ipv6_proto = 0; |
| 7402 | int fdb_mirror = 0; |
| 7403 | int modify_after_mirror = 0; |
| 7404 | const struct rte_flow_item *geneve_item = NULL; |
| 7405 | const struct rte_flow_item *gre_item = NULL; |
| 7406 | const struct rte_flow_item *gtp_item = NULL; |
| 7407 | const struct rte_flow_action_raw_decap *decap; |
| 7408 | const struct rte_flow_action_raw_encap *encap; |
| 7409 | const struct rte_flow_action_rss *rss = NULL; |
| 7410 | const struct rte_flow_action_rss *sample_rss = NULL; |
| 7411 | const struct rte_flow_action_count *sample_count = NULL; |
| 7412 | const struct rte_flow_item_tcp nic_tcp_mask = { |
| 7413 | .hdr = { |
| 7414 | .tcp_flags = 0xFF, |
| 7415 | .src_port = RTE_BE16(UINT16_MAX), |
| 7416 | .dst_port = RTE_BE16(UINT16_MAX), |
| 7417 | } |
| 7418 | }; |
| 7419 | const struct rte_flow_item_ipv6 nic_ipv6_mask = { |
| 7420 | .hdr = { |
| 7421 | .src_addr = |
| 7422 | "\xff\xff\xff\xff\xff\xff\xff\xff" |
| 7423 | "\xff\xff\xff\xff\xff\xff\xff\xff", |
| 7424 | .dst_addr = |
| 7425 | "\xff\xff\xff\xff\xff\xff\xff\xff" |
| 7426 | "\xff\xff\xff\xff\xff\xff\xff\xff", |
| 7427 | .vtc_flow = RTE_BE32(0xffffffff), |
| 7428 | .proto = 0xff, |
| 7429 | .hop_limits = 0xff, |
| 7430 | }, |
| 7431 | .has_frag_ext = 1, |
| 7432 | }; |
| 7433 | const struct rte_flow_item_ecpri nic_ecpri_mask = { |
| 7434 | .hdr = { |
| 7435 | .common = { |
| 7436 | .u32 = |
| 7437 | RTE_BE32(((const struct rte_ecpri_common_hdr) { |
| 7438 | .type = 0xFF, |
| 7439 | }).u32), |
| 7440 | }, |
| 7441 | .dummy[0] = 0xffffffff, |
| 7442 | }, |
| 7443 | }; |
| 7444 | struct mlx5_priv *priv = dev->data->dev_private; |
| 7445 | struct mlx5_sh_config *dev_conf = &priv->sh->config; |
nothing calls this directly
no test coverage detected