From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Eran Ben Elisha <eranbe@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 08/16] net/mlx5: Move all devlink related functions calls to devlink.c
Date: Wed, 18 Jul 2018 18:00:59 -0700 [thread overview]
Message-ID: <20180719010107.22363-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20180719010107.22363-1-saeedm@mellanox.com>
From: Eran Ben Elisha <eranbe@mellanox.com>
Centrelize all devlink related callbacks in one file.
In the downstream patch, some more functionality will be added, this
patch is preparing the driver infrastructure for it.
Currently, move devlink un/register functions calls into this file.
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
.../net/ethernet/mellanox/mlx5/core/Makefile | 2 +-
.../net/ethernet/mellanox/mlx5/core/devlink.c | 43 +++++++++++++++++++
.../net/ethernet/mellanox/mlx5/core/devlink.h | 40 +++++++++++++++++
.../net/ethernet/mellanox/mlx5/core/main.c | 5 ++-
4 files changed, 87 insertions(+), 3 deletions(-)
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/devlink.c
create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/devlink.h
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
index 55d5a5c2e9d8..83abd9130ffb 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
@@ -6,7 +6,7 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
health.o mcg.o cq.o srq.o alloc.o qp.o port.o mr.o pd.o \
mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
fs_counters.o rl.o lag.o dev.o wq.o lib/gid.o lib/clock.o \
- diag/fs_tracepoint.o diag/fw_tracer.o
+ diag/fs_tracepoint.o diag/fw_tracer.o devlink.o
mlx5_core-$(CONFIG_MLX5_ACCEL) += accel/ipsec.o accel/tls.o
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
new file mode 100644
index 000000000000..8851b3ec0ae2
--- /dev/null
+++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2018, Mellanox Technologies. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <devlink.h>
+
+int mlx5_devlink_register(struct devlink *devlink, struct device *dev)
+{
+ return devlink_register(devlink, dev);
+}
+
+void mlx5_devlink_unregister(struct devlink *devlink)
+{
+ devlink_unregister(devlink);
+}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.h b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
new file mode 100644
index 000000000000..eeb4fabba6ec
--- /dev/null
+++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Mellanox Technologies. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#ifndef __MLX5_DEVLINK_H__
+#define __MLX5_DEVLINK_H__
+
+#include <net/devlink.h>
+
+int mlx5_devlink_register(struct devlink *devlink, struct device *dev);
+void mlx5_devlink_unregister(struct devlink *devlink);
+
+#endif /* __MLX5_DEVLINK_H__ */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 6ddbb70e95de..7f581f3189ea 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -56,6 +56,7 @@
#include "fs_core.h"
#include "lib/mpfs.h"
#include "eswitch.h"
+#include "devlink.h"
#include "lib/mlx5.h"
#include "fpga/core.h"
#include "fpga/ipsec.h"
@@ -1440,7 +1441,7 @@ static int init_one(struct pci_dev *pdev,
request_module_nowait(MLX5_IB_MOD);
- err = devlink_register(devlink, &pdev->dev);
+ err = mlx5_devlink_register(devlink, &pdev->dev);
if (err)
goto clean_load;
@@ -1470,7 +1471,7 @@ static void remove_one(struct pci_dev *pdev)
struct devlink *devlink = priv_to_devlink(dev);
struct mlx5_priv *priv = &dev->priv;
- devlink_unregister(devlink);
+ mlx5_devlink_unregister(devlink);
mlx5_unregister_device(dev);
if (mlx5_unload_one(dev, priv, true)) {
--
2.17.0
next prev parent reply other threads:[~2018-07-19 1:42 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 1:00 [pull request][net-next 00/16] Mellanox, mlx5e updates 2018-07-18 Saeed Mahameed
2018-07-19 1:00 ` [net-next 01/16] net/mlx5: FW tracer, implement tracer logic Saeed Mahameed
2018-07-19 1:00 ` [net-next 02/16] net/mlx5: FW tracer, create trace buffer and copy strings database Saeed Mahameed
2018-07-19 1:00 ` [net-next 03/16] net/mlx5: FW tracer, register log buffer memory key Saeed Mahameed
2018-07-19 1:00 ` [net-next 04/16] net/mlx5: FW tracer, events handling Saeed Mahameed
2018-07-19 1:00 ` [net-next 05/16] net/mlx5: FW tracer, parse traces and kernel tracing support Saeed Mahameed
2018-07-19 1:00 ` [net-next 06/16] net/mlx5: FW tracer, Enable tracing Saeed Mahameed
2018-07-19 1:00 ` [net-next 07/16] net/mlx5: FW tracer, Add debug prints Saeed Mahameed
2018-07-19 1:00 ` Saeed Mahameed [this message]
2018-07-19 1:01 ` [net-next 09/16] net/mlx5: Add MPEGC register configuration functionality Saeed Mahameed
2018-07-19 1:01 ` [net-next 10/16] net/mlx5: Support PCIe buffer congestion handling via Devlink Saeed Mahameed
2018-07-19 1:49 ` Jakub Kicinski
2018-07-24 10:31 ` Eran Ben Elisha
2018-07-24 19:51 ` Jakub Kicinski
2018-07-25 12:31 ` Eran Ben Elisha
2018-07-25 15:23 ` Alexander Duyck
2018-07-26 0:43 ` Jakub Kicinski
2018-07-26 7:14 ` Jiri Pirko
2018-07-26 14:00 ` Alexander Duyck
2018-07-28 16:06 ` Bjorn Helgaas
2018-07-29 9:23 ` Moshe Shemesh
2018-07-29 22:00 ` Alexander Duyck
2018-07-30 14:07 ` Bjorn Helgaas
2018-07-30 15:02 ` Alexander Duyck
2018-07-30 22:00 ` Jakub Kicinski
2018-07-31 2:33 ` Bjorn Helgaas
2018-07-31 3:19 ` Alexander Duyck
2018-07-31 11:06 ` Bjorn Helgaas
2018-08-01 18:28 ` Moshe Shemesh
2018-07-19 8:24 ` Jiri Pirko
2018-07-19 8:49 ` Eran Ben Elisha
2018-07-19 1:01 ` [net-next 11/16] net/mlx5e: Set ECN for received packets using CQE indication Saeed Mahameed
2018-07-19 1:01 ` [net-next 12/16] net/mlx5e: Remove redundant WARN when we cannot find neigh entry Saeed Mahameed
2018-07-19 1:01 ` [net-next 13/16] net/mlx5e: Support offloading tc double vlan headers match Saeed Mahameed
2018-07-19 1:01 ` [net-next 14/16] net/mlx5e: Refactor tc vlan push/pop actions offloading Saeed Mahameed
2018-07-19 1:01 ` [net-next 15/16] net/mlx5e: Support offloading double vlan push/pop tc actions Saeed Mahameed
2018-07-19 1:01 ` [net-next 16/16] net/mlx5e: Use PARTIAL_GSO for UDP segmentation Saeed Mahameed
2018-07-23 21:35 ` [pull request][net-next 00/16] Mellanox, mlx5e updates 2018-07-18 Saeed Mahameed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180719010107.22363-9-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=eranbe@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.