git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/enic: fix freeing memory for descriptor ring
[dpdk.git]
/
drivers
/
net
/
mlx5
/
mlx5.c
diff --git
a/drivers/net/mlx5/mlx5.c
b/drivers/net/mlx5/mlx5.c
index
9113121
..
758df6e
100644
(file)
--- a/
drivers/net/mlx5/mlx5.c
+++ b/
drivers/net/mlx5/mlx5.c
@@
-43,16
+43,16
@@
/* Verbs header. */
/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
#ifdef PEDANTIC
/* Verbs header. */
/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
+#pragma GCC diagnostic ignored "-
W
pedantic"
#endif
#include <infiniband/verbs.h>
#ifdef PEDANTIC
#endif
#include <infiniband/verbs.h>
#ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
+#pragma GCC diagnostic error "-
W
pedantic"
#endif
/* DPDK headers don't like -pedantic. */
#ifdef PEDANTIC
#endif
/* DPDK headers don't like -pedantic. */
#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
+#pragma GCC diagnostic ignored "-
W
pedantic"
#endif
#include <rte_malloc.h>
#include <rte_ethdev.h>
#endif
#include <rte_malloc.h>
#include <rte_ethdev.h>
@@
-60,7
+60,7
@@
#include <rte_common.h>
#include <rte_kvargs.h>
#ifdef PEDANTIC
#include <rte_common.h>
#include <rte_kvargs.h>
#ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
+#pragma GCC diagnostic error "-
W
pedantic"
#endif
#include "mlx5.h"
#endif
#include "mlx5.h"
@@
-511,7
+511,7
@@
mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
priv->mtu = ETHER_MTU;
priv->mps = mps; /* Enable MPW by default if supported. */
priv->cqe_comp = 1; /* Enable compression by default. */
priv->mtu = ETHER_MTU;
priv->mps = mps; /* Enable MPW by default if supported. */
priv->cqe_comp = 1; /* Enable compression by default. */
- err = mlx5_args(priv, pci_dev->devargs);
+ err = mlx5_args(priv, pci_dev->dev
ice.dev
args);
if (err) {
ERROR("failed to process device arguments: %s",
strerror(err));
if (err) {
ERROR("failed to process device arguments: %s",
strerror(err));
@@
-617,7
+617,7
@@
mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
snprintf(name, sizeof(name), "%s port %u",
ibv_get_device_name(ibv_dev), port);
snprintf(name, sizeof(name), "%s port %u",
ibv_get_device_name(ibv_dev), port);
- eth_dev = rte_eth_dev_allocate(name
, RTE_ETH_DEV_PCI
);
+ eth_dev = rte_eth_dev_allocate(name);
}
if (eth_dev == NULL) {
ERROR("can not allocate rte ethdev");
}
if (eth_dev == NULL) {
ERROR("can not allocate rte ethdev");
@@
-728,7
+728,9
@@
static const struct rte_pci_id mlx5_pci_id_map[] = {
static struct eth_driver mlx5_driver = {
.pci_drv = {
static struct eth_driver mlx5_driver = {
.pci_drv = {
- .name = MLX5_DRIVER_NAME,
+ .driver = {
+ .name = MLX5_DRIVER_NAME
+ },
.id_table = mlx5_pci_id_map,
.probe = mlx5_pci_probe,
.drv_flags = RTE_PCI_DRV_INTR_LSC,
.id_table = mlx5_pci_id_map,
.probe = mlx5_pci_probe,
.drv_flags = RTE_PCI_DRV_INTR_LSC,
@@
-739,11
+741,10
@@
static struct eth_driver mlx5_driver = {
/**
* Driver initialization routine.
*/
/**
* Driver initialization routine.
*/
-static int
-rte_mlx5_pmd_init(const char *name, const char *args)
+RTE_INIT(rte_mlx5_pmd_init);
+static void
+rte_mlx5_pmd_init(void)
{
{
- (void)name;
- (void)args;
/*
* RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use
* huge pages. Calling ibv_fork_init() during init allows
/*
* RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use
* huge pages. Calling ibv_fork_init() during init allows
@@
-753,13
+754,7
@@
rte_mlx5_pmd_init(const char *name, const char *args)
setenv("RDMAV_HUGEPAGES_SAFE", "1", 1);
ibv_fork_init();
rte_eal_pci_register(&mlx5_driver.pci_drv);
setenv("RDMAV_HUGEPAGES_SAFE", "1", 1);
ibv_fork_init();
rte_eal_pci_register(&mlx5_driver.pci_drv);
- return 0;
}
}
-static struct rte_driver rte_mlx5_driver = {
- .type = PMD_PDEV,
- .init = rte_mlx5_pmd_init,
-};
-
-PMD_REGISTER_DRIVER(rte_mlx5_driver, net_mlx5);
+DRIVER_EXPORT_NAME(net_mlx5, __COUNTER__);
DRIVER_REGISTER_PCI_TABLE(net_mlx5, mlx5_pci_id_map);
DRIVER_REGISTER_PCI_TABLE(net_mlx5, mlx5_pci_id_map);