mlx5_common is shared library between mlx5 net, VDPA and regex PMD.
It is better to use common initialization helper instead of using
RTE_PRIORITY_CLASS priority.
Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE);
}
rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE);
}
+static bool mlx5_common_initialized;
+
- * Initialization routine for run-time dependency on glue library.
+ * One time innitialization routine for run-time dependency on glue library
+ * for multiple PMDs. Each mlx5 PMD that depends on mlx5_common module,
+ * must invoke in its constructor.
-RTE_INIT_PRIO(mlx5_glue_init, CLASS)
+void
+mlx5_common_init(void)
+ if (mlx5_common_initialized)
+ return;
+
+ mlx5_common_initialized = true;
uint64_t offset);
extern uint8_t haswell_broadwell_cpu;
uint64_t offset);
extern uint8_t haswell_broadwell_cpu;
+__rte_internal
+void mlx5_common_init(void);
+
#endif /* RTE_PMD_MLX5_COMMON_H_ */
#endif /* RTE_PMD_MLX5_COMMON_H_ */
mlx5_common_verbs_reg_mr;
mlx5_common_verbs_dereg_mr;
mlx5_common_verbs_reg_mr;
mlx5_common_verbs_dereg_mr;
*/
RTE_INIT(rte_mlx5_pmd_init)
{
*/
RTE_INIT(rte_mlx5_pmd_init)
{
/* Build the static tables for Verbs conversion. */
mlx5_set_ptype_table();
mlx5_set_cksum_table();
/* Build the static tables for Verbs conversion. */
mlx5_set_ptype_table();
mlx5_set_cksum_table();
RTE_INIT(rte_mlx5_regex_init)
{
RTE_INIT(rte_mlx5_regex_init)
{
if (mlx5_glue)
rte_pci_register(&mlx5_regex_driver);
}
if (mlx5_glue)
rte_pci_register(&mlx5_regex_driver);
}
*/
RTE_INIT(rte_mlx5_vdpa_init)
{
*/
RTE_INIT(rte_mlx5_vdpa_init)
{
if (mlx5_glue)
rte_pci_register(&mlx5_vdpa_driver);
}
if (mlx5_glue)
rte_pci_register(&mlx5_vdpa_driver);
}