1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2017 6WIND S.A.
3 * Copyright 2017 Mellanox Technologies, Ltd
6 #ifndef RTE_PMD_MLX4_FLOW_H_
7 #define RTE_PMD_MLX4_FLOW_H_
10 #include <sys/queue.h>
12 /* Verbs headers do not support -pedantic. */
14 #pragma GCC diagnostic ignored "-Wpedantic"
16 #include <infiniband/verbs.h>
18 #pragma GCC diagnostic error "-Wpedantic"
21 #include <rte_eth_ctrl.h>
22 #include <rte_ethdev_driver.h>
24 #include <rte_flow_driver.h>
25 #include <rte_byteorder.h>
27 /** Last and lowest priority level for a flow rule. */
28 #define MLX4_FLOW_PRIORITY_LAST UINT32_C(0xfff)
30 /** Meta pattern item used to distinguish internal rules. */
31 #define MLX4_FLOW_ITEM_TYPE_INTERNAL ((enum rte_flow_item_type)-1)
33 /** PMD-specific (mlx4) definition of a flow rule handle. */
35 LIST_ENTRY(rte_flow) next; /**< Pointer to the next flow structure. */
36 struct ibv_flow *ibv_flow; /**< Verbs flow. */
37 struct ibv_flow_attr *ibv_attr; /**< Pointer to Verbs attributes. */
38 uint32_t ibv_attr_size; /**< Size of Verbs attributes. */
39 uint32_t select:1; /**< Used by operations on the linked list. */
40 uint32_t internal:1; /**< Internal flow rule outside isolated mode. */
41 uint32_t mac:1; /**< Rule associated with a configured MAC address. */
42 uint32_t promisc:1; /**< This rule matches everything. */
43 uint32_t allmulti:1; /**< This rule matches all multicast traffic. */
44 uint32_t drop:1; /**< This rule drops packets. */
45 struct mlx4_rss *rss; /**< Rx target. */
50 uint64_t mlx4_conv_rss_types(struct priv *priv, uint64_t rss_hf);
51 int mlx4_flow_sync(struct priv *priv, struct rte_flow_error *error);
52 void mlx4_flow_clean(struct priv *priv);
53 int mlx4_filter_ctrl(struct rte_eth_dev *dev,
54 enum rte_filter_type filter_type,
55 enum rte_filter_op filter_op,
58 #endif /* RTE_PMD_MLX4_FLOW_H_ */