git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a41f4d
)
common/mlx5: register class drivers through common layer
author
Parav Pandit
<parav@mellanox.com>
Mon, 27 Jul 2020 17:47:14 +0000
(20:47 +0300)
committer
Thomas Monjalon
<thomas@monjalon.net>
Tue, 28 Jul 2020 17:01:30 +0000
(19:01 +0200)
Migrate mlx5 net, vdpa and regex PMD to start using mlx5 common class
driver.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/Makefile
patch
|
blob
|
history
drivers/net/mlx5/linux/mlx5_os.c
patch
|
blob
|
history
drivers/net/mlx5/mlx5.c
patch
|
blob
|
history
drivers/net/mlx5/mlx5.h
patch
|
blob
|
history
drivers/regex/mlx5/meson.build
patch
|
blob
|
history
drivers/regex/mlx5/mlx5_regex.c
patch
|
blob
|
history
drivers/vdpa/mlx5/Makefile
patch
|
blob
|
history
drivers/vdpa/mlx5/meson.build
patch
|
blob
|
history
drivers/vdpa/mlx5/mlx5_vdpa.c
patch
|
blob
|
history
diff --git
a/drivers/net/mlx5/Makefile
b/drivers/net/mlx5/Makefile
index
253faf9
..
568c772
100644
(file)
--- a/
drivers/net/mlx5/Makefile
+++ b/
drivers/net/mlx5/Makefile
@@
-55,7
+55,6
@@
LDLIBS += -lrte_common_mlx5
LDLIBS += -lm
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
LDLIBS += -lm
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
-LDLIBS += -lrte_bus_pci
# A few warnings cannot be avoided in external headers.
CFLAGS += -Wno-error=cast-qual
# A few warnings cannot be avoided in external headers.
CFLAGS += -Wno-error=cast-qual
diff --git
a/drivers/net/mlx5/linux/mlx5_os.c
b/drivers/net/mlx5/linux/mlx5_os.c
index
c4e6c6f
..
fd2e631
100644
(file)
--- a/
drivers/net/mlx5/linux/mlx5_os.c
+++ b/
drivers/net/mlx5/linux/mlx5_os.c
@@
-1535,7
+1535,6
@@
mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
strerror(rte_errno));
return -rte_errno;
}
strerror(rte_errno));
return -rte_errno;
}
- MLX5_ASSERT(pci_drv == &mlx5_driver);
errno = 0;
ibv_list = mlx5_glue->get_device_list(&ret);
if (!ibv_list) {
errno = 0;
ibv_list = mlx5_glue->get_device_list(&ret);
if (!ibv_list) {
diff --git
a/drivers/net/mlx5/mlx5.c
b/drivers/net/mlx5/mlx5.c
index
2defe4a
..
2560ae1
100644
(file)
--- a/
drivers/net/mlx5/mlx5.c
+++ b/
drivers/net/mlx5/mlx5.c
@@
-30,6
+30,7
@@
#include <mlx5_common.h>
#include <mlx5_common_os.h>
#include <mlx5_common_mp.h>
#include <mlx5_common.h>
#include <mlx5_common_os.h>
#include <mlx5_common_mp.h>
+#include <mlx5_common_pci.h>
#include <mlx5_malloc.h>
#include "mlx5_defs.h"
#include <mlx5_malloc.h>
#include "mlx5_defs.h"
@@
-1965,16
+1966,19
@@
static const struct rte_pci_id mlx5_pci_id_map[] = {
}
};
}
};
-struct rte_pci_driver mlx5_driver = {
- .driver = {
- .name = MLX5_DRIVER_NAME
+static struct mlx5_pci_driver mlx5_driver = {
+ .driver_class = MLX5_CLASS_NET,
+ .pci_driver = {
+ .driver = {
+ .name = MLX5_DRIVER_NAME,
+ },
+ .id_table = mlx5_pci_id_map,
+ .probe = mlx5_os_pci_probe,
+ .remove = mlx5_pci_remove,
+ .dma_map = mlx5_dma_map,
+ .dma_unmap = mlx5_dma_unmap,
+ .drv_flags = PCI_DRV_FLAGS,
},
},
- .id_table = mlx5_pci_id_map,
- .probe = mlx5_os_pci_probe,
- .remove = mlx5_pci_remove,
- .dma_map = mlx5_dma_map,
- .dma_unmap = mlx5_dma_unmap,
- .drv_flags = PCI_DRV_FLAGS,
};
/* Initialize driver log type. */
};
/* Initialize driver log type. */
@@
-1991,7
+1995,7
@@
RTE_INIT(rte_mlx5_pmd_init)
mlx5_set_cksum_table();
mlx5_set_swp_types_table();
if (mlx5_glue)
mlx5_set_cksum_table();
mlx5_set_swp_types_table();
if (mlx5_glue)
-
rte_pci
_register(&mlx5_driver);
+
mlx5_pci_driver
_register(&mlx5_driver);
}
RTE_PMD_EXPORT_NAME(net_mlx5, __COUNTER__);
}
RTE_PMD_EXPORT_NAME(net_mlx5, __COUNTER__);
diff --git
a/drivers/net/mlx5/mlx5.h
b/drivers/net/mlx5/mlx5.h
index
ee8e8bf
..
a73ac14
100644
(file)
--- a/
drivers/net/mlx5/mlx5.h
+++ b/
drivers/net/mlx5/mlx5.h
@@
-119,7
+119,6
@@
struct mlx5_local_data {
};
extern struct mlx5_shared_data *mlx5_shared_data;
};
extern struct mlx5_shared_data *mlx5_shared_data;
-extern struct rte_pci_driver mlx5_driver;
/* Dev ops structs */
extern const struct eth_dev_ops mlx5_os_dev_ops;
/* Dev ops structs */
extern const struct eth_dev_ops mlx5_os_dev_ops;
diff --git
a/drivers/regex/mlx5/meson.build
b/drivers/regex/mlx5/meson.build
index
7f800f2
..
d7cb2c5
100644
(file)
--- a/
drivers/regex/mlx5/meson.build
+++ b/
drivers/regex/mlx5/meson.build
@@
-8,7
+8,7
@@
if not is_linux
endif
fmt_name = 'mlx5_regex'
endif
fmt_name = 'mlx5_regex'
-deps += ['common_mlx5', '
bus_pci', '
eal', 'regexdev']
+deps += ['common_mlx5', 'eal', 'regexdev']
sources = files(
'mlx5_regex.c',
'mlx5_rxp.c',
sources = files(
'mlx5_regex.c',
'mlx5_rxp.c',
diff --git
a/drivers/regex/mlx5/mlx5_regex.c
b/drivers/regex/mlx5/mlx5_regex.c
index
4e03670
..
ae9f001
100644
(file)
--- a/
drivers/regex/mlx5/mlx5_regex.c
+++ b/
drivers/regex/mlx5/mlx5_regex.c
@@
-5,12
+5,12
@@
#include <rte_malloc.h>
#include <rte_log.h>
#include <rte_errno.h>
#include <rte_malloc.h>
#include <rte_log.h>
#include <rte_errno.h>
-#include <rte_bus_pci.h>
#include <rte_pci.h>
#include <rte_regexdev.h>
#include <rte_regexdev_core.h>
#include <rte_regexdev_driver.h>
#include <rte_pci.h>
#include <rte_regexdev.h>
#include <rte_regexdev_core.h>
#include <rte_regexdev_driver.h>
+#include <mlx5_common_pci.h>
#include <mlx5_glue.h>
#include <mlx5_devx_cmds.h>
#include <mlx5_prm.h>
#include <mlx5_glue.h>
#include <mlx5_devx_cmds.h>
#include <mlx5_prm.h>
@@
-246,21
+246,24
@@
static const struct rte_pci_id mlx5_regex_pci_id_map[] = {
}
};
}
};
-static struct rte_pci_driver mlx5_regex_driver = {
- .driver = {
- .name = "mlx5_regex",
+static struct mlx5_pci_driver mlx5_regex_driver = {
+ .driver_class = MLX5_CLASS_REGEX,
+ .pci_driver = {
+ .driver = {
+ .name = "mlx5_regex",
+ },
+ .id_table = mlx5_regex_pci_id_map,
+ .probe = mlx5_regex_pci_probe,
+ .remove = mlx5_regex_pci_remove,
+ .drv_flags = 0,
},
},
- .id_table = mlx5_regex_pci_id_map,
- .probe = mlx5_regex_pci_probe,
- .remove = mlx5_regex_pci_remove,
- .drv_flags = 0,
};
RTE_INIT(rte_mlx5_regex_init)
{
mlx5_common_init();
if (mlx5_glue)
};
RTE_INIT(rte_mlx5_regex_init)
{
mlx5_common_init();
if (mlx5_glue)
-
rte_pci
_register(&mlx5_regex_driver);
+
mlx5_pci_driver
_register(&mlx5_regex_driver);
}
RTE_LOG_REGISTER(mlx5_regex_logtype, pmd.regex.mlx5, NOTICE)
}
RTE_LOG_REGISTER(mlx5_regex_logtype, pmd.regex.mlx5, NOTICE)
diff --git
a/drivers/vdpa/mlx5/Makefile
b/drivers/vdpa/mlx5/Makefile
index
8a1c2ea
..
d46699f
100644
(file)
--- a/
drivers/vdpa/mlx5/Makefile
+++ b/
drivers/vdpa/mlx5/Makefile
@@
-30,7
+30,7
@@
CFLAGS += -D_XOPEN_SOURCE=600
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -Wno-strict-prototypes
LDLIBS += -lrte_common_mlx5
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -Wno-strict-prototypes
LDLIBS += -lrte_common_mlx5
-LDLIBS += -lrte_eal -lrte_vhost -lrte_kvargs -lrte_pci -lrte_
bus_pci -lrte_
sched
+LDLIBS += -lrte_eal -lrte_vhost -lrte_kvargs -lrte_pci -lrte_sched
LDLIBS += -pthread
# A few warnings cannot be avoided in external headers.
LDLIBS += -pthread
# A few warnings cannot be avoided in external headers.
diff --git
a/drivers/vdpa/mlx5/meson.build
b/drivers/vdpa/mlx5/meson.build
index
2963aad
..
254a8ec
100644
(file)
--- a/
drivers/vdpa/mlx5/meson.build
+++ b/
drivers/vdpa/mlx5/meson.build
@@
-8,7
+8,7
@@
if not is_linux
endif
fmt_name = 'mlx5_vdpa'
endif
fmt_name = 'mlx5_vdpa'
-deps += ['hash', 'common_mlx5', 'vhost', 'pci', '
bus_pci', '
eal', 'sched']
+deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched']
sources = files(
'mlx5_vdpa.c',
'mlx5_vdpa_mem.c',
sources = files(
'mlx5_vdpa.c',
'mlx5_vdpa_mem.c',
diff --git
a/drivers/vdpa/mlx5/mlx5_vdpa.c
b/drivers/vdpa/mlx5/mlx5_vdpa.c
index
85dbcf9
..
ffe2f00
100644
(file)
--- a/
drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/
drivers/vdpa/mlx5/mlx5_vdpa.c
@@
-11,12
+11,12
@@
#include <rte_malloc.h>
#include <rte_log.h>
#include <rte_errno.h>
#include <rte_malloc.h>
#include <rte_log.h>
#include <rte_errno.h>
-#include <rte_bus_pci.h>
#include <rte_pci.h>
#include <rte_string_fns.h>
#include <mlx5_glue.h>
#include <mlx5_common.h>
#include <rte_pci.h>
#include <rte_string_fns.h>
#include <mlx5_glue.h>
#include <mlx5_common.h>
+#include <mlx5_common_pci.h>
#include <mlx5_devx_cmds.h>
#include <mlx5_prm.h>
#include <mlx5_nl.h>
#include <mlx5_devx_cmds.h>
#include <mlx5_prm.h>
#include <mlx5_nl.h>
@@
-657,7
+657,7
@@
mlx5_vdpa_config_get(struct rte_devargs *devargs, struct mlx5_vdpa_priv *priv)
}
/**
}
/**
- * DPDK callback to register a PCI device.
+ * DPDK callback to register a
mlx5
PCI device.
*
* This function spawns vdpa device out of a given PCI device.
*
*
* This function spawns vdpa device out of a given PCI device.
*
@@
-829,14
+829,17
@@
static const struct rte_pci_id mlx5_vdpa_pci_id_map[] = {
}
};
}
};
-static struct rte_pci_driver mlx5_vdpa_driver = {
- .driver = {
- .name = "mlx5_vdpa",
+static struct mlx5_pci_driver mlx5_vdpa_driver = {
+ .driver_class = MLX5_CLASS_VDPA,
+ .pci_driver = {
+ .driver = {
+ .name = "mlx5_vdpa",
+ },
+ .id_table = mlx5_vdpa_pci_id_map,
+ .probe = mlx5_vdpa_pci_probe,
+ .remove = mlx5_vdpa_pci_remove,
+ .drv_flags = 0,
},
},
- .id_table = mlx5_vdpa_pci_id_map,
- .probe = mlx5_vdpa_pci_probe,
- .remove = mlx5_vdpa_pci_remove,
- .drv_flags = 0,
};
RTE_LOG_REGISTER(mlx5_vdpa_logtype, pmd.vdpa.mlx5, NOTICE)
};
RTE_LOG_REGISTER(mlx5_vdpa_logtype, pmd.vdpa.mlx5, NOTICE)
@@
-848,7
+851,7
@@
RTE_INIT(rte_mlx5_vdpa_init)
{
mlx5_common_init();
if (mlx5_glue)
{
mlx5_common_init();
if (mlx5_glue)
-
rte_pci
_register(&mlx5_vdpa_driver);
+
mlx5_pci_driver
_register(&mlx5_vdpa_driver);
}
RTE_PMD_EXPORT_NAME(net_mlx5_vdpa, __COUNTER__);
}
RTE_PMD_EXPORT_NAME(net_mlx5_vdpa, __COUNTER__);