net/mlx5: fix allocation when no memory on device NUMA node
[dpdk.git] / drivers / net / mlx5 / mlx5.h
index e740a4e..a7ec607 100644 (file)
@@ -53,7 +53,7 @@
 
 #include <rte_pci.h>
 #include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
 #include <rte_spinlock.h>
 #include <rte_interrupts.h>
 #include <rte_errno.h>
@@ -123,6 +123,24 @@ struct mlx5_dev_config {
        int inline_max_packet_sz; /* Max packet size for inlining. */
 };
 
+/**
+ * Type of objet being allocated.
+ */
+enum mlx5_verbs_alloc_type {
+       MLX5_VERBS_ALLOC_TYPE_NONE,
+       MLX5_VERBS_ALLOC_TYPE_TX_QUEUE,
+       MLX5_VERBS_ALLOC_TYPE_RX_QUEUE,
+};
+
+/**
+ * Verbs allocator needs a context to know in the callback which kind of
+ * resources it is allocating.
+ */
+struct mlx5_verbs_alloc_ctx {
+       enum mlx5_verbs_alloc_type type; /* Kind of object being allocated. */
+       const void *obj; /* Pointer to the DPDK object. */
+};
+
 struct priv {
        struct rte_eth_dev *dev; /* Ethernet device of master process. */
        struct ibv_context *ctx; /* Verbs context. */
@@ -164,6 +182,8 @@ struct priv {
        int primary_socket; /* Unix socket for primary process. */
        struct rte_intr_handle intr_handle_socket; /* Interrupt handler. */
        struct mlx5_dev_config config; /* Device configuration. */
+       struct mlx5_verbs_alloc_ctx verbs_alloc_ctx;
+       /* Context for Verbs allocator. */
 };
 
 /**
@@ -225,6 +245,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 priv_link_update(struct priv *, 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 *);
@@ -237,6 +258,7 @@ void priv_dev_interrupt_handler_uninstall(struct priv *, struct rte_eth_dev *);
 void priv_dev_interrupt_handler_install(struct priv *, struct rte_eth_dev *);
 int mlx5_set_link_down(struct rte_eth_dev *dev);
 int mlx5_set_link_up(struct rte_eth_dev *dev);
+int mlx5_is_removed(struct rte_eth_dev *dev);
 eth_tx_burst_t priv_select_tx_function(struct priv *, struct rte_eth_dev *);
 eth_rx_burst_t priv_select_rx_function(struct priv *, struct rte_eth_dev *);