Skip to contentSkip to conversation

net/mlx5e: Move mlx5e_priv_flags into en_ethtool.c

PATCH In review Kamal Heib 2 participants 6 messages Jul 15, 2018 – Jul 27, 2018

Subsystems (4)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 net/mlx5e: Move mlx5e_priv_flags into en_ethtool.c

Move the definition of mlx5e_priv_flags into en_ethtool.c because it's only used there.

Fixes 4e59e2888139 ("net/mlx5e: Introduce net device priv flags infrastructure")
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h         | 7 -------
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -7
index eb9eb7aa953a..84e6a5b42286 100644
@@ -208,13 +208,6 @@ struct mlx5e_umr_wqe {
 
 extern const char mlx5e_self_tests[][ETH_GSTRING_LEN];
 
-static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
-	"rx_cqe_moder",
-	"tx_cqe_moder",
-	"rx_cqe_compress",
-	"rx_striding_rq",
-};
-
 enum mlx5e_priv_flag {
 	MLX5E_PFLAG_RX_CQE_BASED_MODER = (1 << 0),
 	MLX5E_PFLAG_TX_CQE_BASED_MODER = (1 << 1),
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +7 -0
index fffe514ba855..2a1c35d82c2e 100644
@@ -33,6 +33,13 @@
 #include "en.h"
 #include "en/port.h"
 
+static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
+	"rx_cqe_moder",
+	"tx_cqe_moder",
+	"rx_cqe_compress",
+	"rx_striding_rq",
+};
+
 void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
 			       struct ethtool_drvinfo *drvinfo)
 {
Signature · 1 line
2.14.4
#1 lore raw
Quoted 6 lines · Kamal Heib

Move the definition of mlx5e_priv_flags into en_ethtool.c because it's only used there.

Fixes 4e59e2888139 ("net/mlx5e: Introduce net device priv flags infrastructure")

---

LGTM, but why to net ?
this patch should go to net-next.

Quoted 43 lines
 drivers/net/ethernet/mellanox/mlx5/core/en.h         | 7 -------
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -7
index eb9eb7aa953a..84e6a5b42286 100644
@@ -208,13 +208,6 @@ struct mlx5e_umr_wqe {
 
 extern const char mlx5e_self_tests[][ETH_GSTRING_LEN];
 
-static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
-       "rx_cqe_moder",
-       "tx_cqe_moder",
-       "rx_cqe_compress",
-       "rx_striding_rq",
-};
-
 enum mlx5e_priv_flag {
        MLX5E_PFLAG_RX_CQE_BASED_MODER = (1 << 0),
        MLX5E_PFLAG_TX_CQE_BASED_MODER = (1 << 1),
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +7 -1
index fffe514ba855..2a1c35d82c2e 100644
@@ -33,6 +33,13 @@
 #include "en.h"
 #include "en/port.h"
 
+static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
+       "rx_cqe_moder",
+       "tx_cqe_moder",
+       "rx_cqe_compress",
+       "rx_striding_rq",
+};
+
 void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
                               struct ethtool_drvinfo *drvinfo)
 {
--

2.14.4

author
#2 lore raw
Quoted 4 lines · Saeed Mahameed
Quoted 3 lines · Kamal Heib

Move the definition of mlx5e_priv_flags into en_ethtool.c because it's only used there.

Quoted 8 lines
Quoted 3 lines
Fixes 4e59e2888139 ("net/mlx5e: Introduce net device priv flags infrastructure")

---

LGTM, but why to net ?
this patch should go to net-next.

It was sent to net because it fixes an existing commit, but I'm fine with net-next too.

Thanks,
Kamal

Quoted 43 lines
Quoted 43 lines
 drivers/net/ethernet/mellanox/mlx5/core/en.h         | 7 -------
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -7
index eb9eb7aa953a..84e6a5b42286 100644
@@ -208,13 +208,6 @@ struct mlx5e_umr_wqe {
 
 extern const char mlx5e_self_tests[][ETH_GSTRING_LEN];
 
-static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
-       "rx_cqe_moder",
-       "tx_cqe_moder",
-       "rx_cqe_compress",
-       "rx_striding_rq",
-};
-
 enum mlx5e_priv_flag {
        MLX5E_PFLAG_RX_CQE_BASED_MODER = (1 << 0),
        MLX5E_PFLAG_TX_CQE_BASED_MODER = (1 << 1),
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +7 -1
index fffe514ba855..2a1c35d82c2e 100644
@@ -33,6 +33,13 @@
 #include "en.h"
 #include "en/port.h"
 
+static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
+       "rx_cqe_moder",
+       "tx_cqe_moder",
+       "rx_cqe_compress",
+       "rx_striding_rq",
+};
+
 void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
                               struct ethtool_drvinfo *drvinfo)
 {
--

2.14.4

#3 lore raw
In reply to Kamal Heib
Quoted 15 lines · Kamal Heib

Move the definition of mlx5e_priv_flags into en_ethtool.c because it's only used there.

Fixes 4e59e2888139 ("net/mlx5e: Introduce net device priv flags infrastructure")
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h         | 7 -------
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -0
index eb9eb7aa953a..84e6a5b42286 100644

drivers/net/ethernet/mellanox/mlx5/core/en.h struct mlx5e_umr_wqe { · line 217

Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -7
@@ -208,13 +208,6 @@ struct mlx5e_umr_wqe {
 
 extern const char mlx5e_self_tests[][ETH_GSTRING_LEN];
 
-static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
-       "rx_cqe_moder",
-       "tx_cqe_moder",
-       "rx_cqe_compress",
-       "rx_striding_rq",
-};
-

Hi Kamal, on a second thought, i would like to drop this change and keep mlx5e_priv_flags close/local to the below mlx5e_priv_flag.

Please let me know.

Quoted 24 lines
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -0
 enum mlx5e_priv_flag {
        MLX5E_PFLAG_RX_CQE_BASED_MODER = (1 << 0),
        MLX5E_PFLAG_TX_CQE_BASED_MODER = (1 << 1),
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +7 -1
index fffe514ba855..2a1c35d82c2e 100644
@@ -33,6 +33,13 @@
 #include "en.h"
 #include "en/port.h"
 
+static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
+       "rx_cqe_moder",
+       "tx_cqe_moder",
+       "rx_cqe_compress",
+       "rx_striding_rq",
+};
+
 void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
                               struct ethtool_drvinfo *drvinfo)
 {
--

2.14.4

author
#4 lore raw
Quoted 30 lines · Saeed Mahameed
Quoted 15 lines · Kamal Heib

Move the definition of mlx5e_priv_flags into en_ethtool.c because it's only used there.

Fixes 4e59e2888139 ("net/mlx5e: Introduce net device priv flags infrastructure")
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h         | 7 -------
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -0
index eb9eb7aa953a..84e6a5b42286 100644

drivers/net/ethernet/mellanox/mlx5/core/en.h struct mlx5e_umr_wqe { · line 217

Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -7
@@ -208,13 +208,6 @@ struct mlx5e_umr_wqe {
 
 extern const char mlx5e_self_tests[][ETH_GSTRING_LEN];
 
-static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
-       "rx_cqe_moder",
-       "tx_cqe_moder",
-       "rx_cqe_compress",
-       "rx_striding_rq",
-};
-

Hi Kamal, on a second thought, i would like to drop this change and keep mlx5e_priv_flags close/local to the below mlx5e_priv_flag.

Quoted 2 lines

Please let me know.

Hi,

Basically this change came to avoid the following warning when compiling the mlx5 driver with "W=1" flag and this error will appear for each file that include the "en.h".

So, I suggest not drop this change.

In file included from drivers/net/ethernet/mellanox/mlx5/core//en_main.c:40:0:
drivers/net/ethernet/mellanox/mlx5/core//en.h:206:19: warning: ‘mlx5e_priv_flags’ defined but not used [-Wunused-const-variable=]
static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {

Thanks,
Kamal

Quoted 24 lines
Quoted 24 lines
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -0
 enum mlx5e_priv_flag {
        MLX5E_PFLAG_RX_CQE_BASED_MODER = (1 << 0),
        MLX5E_PFLAG_TX_CQE_BASED_MODER = (1 << 1),
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +7 -1
index fffe514ba855..2a1c35d82c2e 100644
@@ -33,6 +33,13 @@
 #include "en.h"
 #include "en/port.h"
 
+static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
+       "rx_cqe_moder",
+       "tx_cqe_moder",
+       "rx_cqe_compress",
+       "rx_striding_rq",
+};
+
 void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
                               struct ethtool_drvinfo *drvinfo)
 {
--

2.14.4

#5 lore raw
Quoted 40 lines · Kamal Heib
Quoted 30 lines · Saeed Mahameed
Quoted 15 lines · Kamal Heib

Move the definition of mlx5e_priv_flags into en_ethtool.c because it's only used there.

Fixes 4e59e2888139 ("net/mlx5e: Introduce net device priv flags infrastructure")
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h         | 7 -------
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -0
index eb9eb7aa953a..84e6a5b42286 100644

drivers/net/ethernet/mellanox/mlx5/core/en.h struct mlx5e_umr_wqe { · line 217

Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en.h +0 -7
@@ -208,13 +208,6 @@ struct mlx5e_umr_wqe {
 
 extern const char mlx5e_self_tests[][ETH_GSTRING_LEN];
 
-static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {
-       "rx_cqe_moder",
-       "tx_cqe_moder",
-       "rx_cqe_compress",
-       "rx_striding_rq",
-};
-

Hi Kamal, on a second thought, i would like to drop this change and keep mlx5e_priv_flags close/local to the below mlx5e_priv_flag.

Quoted 2 lines

Please let me know.

Hi,

Basically this change came to avoid the following warning when compiling the mlx5 driver with "W=1" flag and this error will appear for each file that include the "en.h".

Quoted 6 lines

So, I suggest not drop this change.

In file included from drivers/net/ethernet/mellanox/mlx5/core//en_main.c:40:0:
drivers/net/ethernet/mellanox/mlx5/core//en.h:206:19: warning: ‘mlx5e_priv_flags’ defined but not used [-Wunused-const-variable=]
static const char mlx5e_priv_flags[][ETH_GSTRING_LEN] = {

Ok Kamal,
Patch applied to net-next-mlx5.

Thank you !