Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
	Leon Romanovsky <leonro@mellanox.com>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	Bodong Wang <bodong@mellanox.com>,
	Or Gerlitz <ogerlitz@mellanox.com>
Subject: [PATCH mlx5-next 10/15] net/mlx5: Relocate vport macros to the vport header file
Date: Tue, 12 Feb 2019 22:55:41 -0800	[thread overview]
Message-ID: <20190213065546.3013-11-saeedm@mellanox.com> (raw)
In-Reply-To: <20190213065546.3013-1-saeedm@mellanox.com>

From: Bodong Wang <bodong@mellanox.com>

These are two macros in the driver general header which deal with the
number of total vports and if a vport is vport manager. Such macros
are vport entities, better to place them at the vport header file.

This patch doesn't change any functionality.

Signed-off-by: Bodong Wang <bodong@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eq.c      | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 1 +
 include/linux/mlx5/driver.h                       | 6 ------
 include/linux/mlx5/vport.h                        | 7 +++++++
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
index 5c02f9291799..bb6e5b5d9681 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
@@ -34,6 +34,7 @@
 #include <linux/notifier.h>
 #include <linux/module.h>
 #include <linux/mlx5/driver.h>
+#include <linux/mlx5/vport.h>
 #include <linux/mlx5/eq.h>
 #include <linux/mlx5/cmd.h>
 #ifdef CONFIG_RFS_ACCEL
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 79f122b45def..b6a7bc8f667c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -32,6 +32,7 @@
 
 #include <linux/mutex.h>
 #include <linux/mlx5/driver.h>
+#include <linux/mlx5/vport.h>
 #include <linux/mlx5/eswitch.h>
 
 #include "mlx5_core.h"
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 46e0aa52a58a..c5454f985e1d 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1097,12 +1097,6 @@ static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev)
 		return pci_sriov_get_totalvfs(dev->pdev);
 }
 
-#define MLX5_TOTAL_VPORTS(mdev) (1 + mlx5_core_max_vfs(mdev))
-#define MLX5_VPORT_MANAGER(mdev) \
-	(MLX5_CAP_GEN(mdev, vport_group_manager) && \
-	 (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \
-	 mlx5_core_is_pf(mdev))
-
 static inline int mlx5_get_gid_table_len(u16 param)
 {
 	if (param > 4) {
diff --git a/include/linux/mlx5/vport.h b/include/linux/mlx5/vport.h
index 2e2928eacd97..28f47e868fbc 100644
--- a/include/linux/mlx5/vport.h
+++ b/include/linux/mlx5/vport.h
@@ -36,6 +36,13 @@
 #include <linux/mlx5/driver.h>
 #include <linux/mlx5/device.h>
 
+#define MLX5_TOTAL_VPORTS(mdev)	(1 + mlx5_core_max_vfs(mdev))
+
+#define MLX5_VPORT_MANAGER(mdev)					\
+	(MLX5_CAP_GEN(mdev, vport_group_manager) &&			\
+	 (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) &&	\
+	 mlx5_core_is_pf(mdev))
+
 enum {
 	MLX5_CAP_INLINE_MODE_L2,
 	MLX5_CAP_INLINE_MODE_VPORT_CONTEXT,
-- 
2.20.1


  parent reply	other threads:[~2019-02-13  6:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13  6:55 [PATCH mlx5-next 00/15] mlx5-next updates (ECPF & 50Gbps per lane) Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 01/15] net/mlx5: Use void pointer as the type in address_of macro Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 02/15] net/mlx5: Use consistent vport num argument type Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 03/15] IB/mlx5: Use unified register/load function for uplink and VF vports Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 04/15] net/mlx5: Introduce Mellanox SmartNIC and modify page management logic Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 05/15] net/mlx5: Update enable HCA dependency Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 06/15] net/mlx5: Add query host params command Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 07/15] net/mlx5: Add host params change event Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 08/15] net/mlx5: Provide an alternative VF upper bound for ECPF Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 09/15] net/mlx5: E-Switch, Normalize the name of uplink vport number Saeed Mahameed
2019-02-13  6:55 ` Saeed Mahameed [this message]
2019-02-13  6:55 ` [PATCH mlx5-next 11/15] net/mlx5: E-Switch, Avoid magic numbers when initializing offloads mode Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 12/15] net/mlx5: Refactor queries to speed fields in Port Type and Speed register Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 13/15] net/mlx5: Add new fields to " Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 14/15] net/mlx5: Add support to ext_* fields introduced in " Saeed Mahameed
2019-02-13  6:55 ` [PATCH mlx5-next 15/15] IB/mlx5: Add support for 50Gbps per lane link modes Saeed Mahameed
2019-02-15 18:17 ` [PATCH mlx5-next 00/15] mlx5-next updates (ECPF & 50Gbps per lane) 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=20190213065546.3013-11-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=bodong@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox