net/mlx5: support ConnectX-5 devices
[dpdk.git] / drivers / net / mlx5 / mlx5.h
index 8349e5b..ee62e04 100644 (file)
 /* Verbs header. */
 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
 #ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
+#pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 #include <infiniband/verbs.h>
 #ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
+#pragma GCC diagnostic error "-Wpedantic"
 #endif
 
 /* DPDK headers don't like -pedantic. */
 #ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
+#pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_spinlock.h>
 #include <rte_interrupts.h>
 #include <rte_errno.h>
+#include <rte_flow.h>
 #ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
+#pragma GCC diagnostic error "-Wpedantic"
 #endif
 
 #include "mlx5_utils.h"
@@ -82,6 +83,10 @@ enum {
        PCI_DEVICE_ID_MELLANOX_CONNECTX4VF = 0x1014,
        PCI_DEVICE_ID_MELLANOX_CONNECTX4LX = 0x1015,
        PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF = 0x1016,
+       PCI_DEVICE_ID_MELLANOX_CONNECTX5 = 0x1017,
+       PCI_DEVICE_ID_MELLANOX_CONNECTX5VF = 0x1018,
+       PCI_DEVICE_ID_MELLANOX_CONNECTX5EX = 0x1019,
+       PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF = 0x101a,
 };
 
 struct priv {
@@ -135,6 +140,8 @@ struct priv {
        unsigned int reta_idx_n; /* RETA index size. */
        struct fdir_filter_list *fdir_filter_list; /* Flow director rules. */
        struct fdir_queue *fdir_drop_queue; /* Flow director drop queue. */
+       LIST_HEAD(mlx5_flows, rte_flow) flows; /* RTE Flow rules. */
+       uint32_t link_speed_capa; /* Link speed capabilities. */
        rte_spinlock_t lock; /* Lock for control functions. */
 };
 
@@ -187,6 +194,7 @@ int priv_set_flags(struct priv *, unsigned int, unsigned int);
 int mlx5_dev_configure(struct rte_eth_dev *);
 void mlx5_dev_infos_get(struct rte_eth_dev *, struct rte_eth_dev_info *);
 const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev);
+int mlx5_link_update_unlocked(struct rte_eth_dev *, int);
 int mlx5_link_update(struct rte_eth_dev *, int);
 int mlx5_dev_set_mtu(struct rte_eth_dev *, uint16_t);
 int mlx5_dev_get_flow_ctrl(struct rte_eth_dev *, struct rte_eth_fc_conf *);
@@ -266,4 +274,21 @@ void priv_fdir_enable(struct priv *);
 int mlx5_dev_filter_ctrl(struct rte_eth_dev *, enum rte_filter_type,
                         enum rte_filter_op, void *);
 
+/* mlx5_flow.c */
+
+int mlx5_flow_validate(struct rte_eth_dev *, const struct rte_flow_attr *,
+                      const struct rte_flow_item [],
+                      const struct rte_flow_action [],
+                      struct rte_flow_error *);
+struct rte_flow *mlx5_flow_create(struct rte_eth_dev *,
+                                 const struct rte_flow_attr *,
+                                 const struct rte_flow_item [],
+                                 const struct rte_flow_action [],
+                                 struct rte_flow_error *);
+int mlx5_flow_destroy(struct rte_eth_dev *, struct rte_flow *,
+                     struct rte_flow_error *);
+int mlx5_flow_flush(struct rte_eth_dev *, struct rte_flow_error *);
+int priv_flow_start(struct priv *);
+void priv_flow_stop(struct priv *);
+
 #endif /* RTE_PMD_MLX5_H_ */