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_ethdev_driver.h>
23 #include <rte_flow_driver.h>
24 #include <rte_byteorder.h>
26 /** Last and lowest priority level for a flow rule. */
27 #define MLX4_FLOW_PRIORITY_LAST UINT32_C(0xfff)
29 /** Meta pattern item used to distinguish internal rules. */
30 #define MLX4_FLOW_ITEM_TYPE_INTERNAL ((enum rte_flow_item_type)-1)
32 /** PMD-specific (mlx4) definition of a flow rule handle. */
34 LIST_ENTRY(rte_flow) next; /**< Pointer to the next flow structure. */
35 struct ibv_flow *ibv_flow; /**< Verbs flow. */
36 struct ibv_flow_attr *ibv_attr; /**< Pointer to Verbs attributes. */
37 uint32_t ibv_attr_size; /**< Size of Verbs attributes. */
38 uint32_t select:1; /**< Used by operations on the linked list. */
39 uint32_t internal:1; /**< Internal flow rule outside isolated mode. */
40 uint32_t mac:1; /**< Rule associated with a configured MAC address. */
41 uint32_t promisc:1; /**< This rule matches everything. */
42 uint32_t allmulti:1; /**< This rule matches all multicast traffic. */
43 uint32_t drop:1; /**< This rule drops packets. */
44 uint32_t priority; /**< Flow rule priority. */
45 struct mlx4_rss *rss; /**< Rx target. */
50 uint64_t mlx4_conv_rss_types(struct mlx4_priv *priv, uint64_t types,
52 int mlx4_flow_sync(struct mlx4_priv *priv, struct rte_flow_error *error);
53 void mlx4_flow_clean(struct mlx4_priv *priv);
54 int mlx4_filter_ctrl(struct rte_eth_dev *dev,
55 enum rte_filter_type filter_type,
56 enum rte_filter_op filter_op,
59 #endif /* RTE_PMD_MLX4_FLOW_H_ */