1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2015 6WIND S.A.
3 * Copyright 2015 Mellanox Technologies, Ltd
6 #ifndef RTE_PMD_MLX5_RXTX_H_
7 #define RTE_PMD_MLX5_RXTX_H_
11 #include <sys/queue.h>
14 #include <rte_mempool.h>
15 #include <rte_common.h>
16 #include <rte_hexdump.h>
17 #include <rte_spinlock.h>
19 #include <rte_bus_pci.h>
20 #include <rte_cycles.h>
22 #include <mlx5_common.h>
23 #include <mlx5_common_mr.h>
25 #include "mlx5_utils.h"
27 #include "mlx5_autoconf.h"
34 extern uint32_t mlx5_ptype_table[];
35 extern uint8_t mlx5_cksum_table[];
36 extern uint8_t mlx5_swp_types_table[];
38 void mlx5_set_ptype_table(void);
39 void mlx5_set_cksum_table(void);
40 void mlx5_set_swp_types_table(void);
41 void mlx5_dump_debug_information(const char *path, const char *title,
42 const void *buf, unsigned int len);
43 int mlx5_queue_state_modify_primary(struct rte_eth_dev *dev,
44 const struct mlx5_mp_arg_queue_state_modify *sm);
45 int mlx5_queue_state_modify(struct rte_eth_dev *dev,
46 struct mlx5_mp_arg_queue_state_modify *sm);
50 void mlx5_mr_flush_local_cache(struct mlx5_mr_ctrl *mr_ctrl);
51 int mlx5_dma_map(struct rte_pci_device *pdev, void *addr, uint64_t iova,
53 int mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, uint64_t iova,
57 * Get Memory Pool (MP) from mbuf. If mbuf is indirect, the pool from which the
58 * cloned mbuf is allocated is returned instead.
64 * Memory pool where data is located for given mbuf.
66 static inline struct rte_mempool *
67 mlx5_mb2mp(struct rte_mbuf *buf)
69 if (unlikely(RTE_MBUF_CLONED(buf)))
70 return rte_mbuf_from_indirect(buf)->pool;
74 #endif /* RTE_PMD_MLX5_RXTX_H_ */