linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/mlx4e: Remove redundant definition of IB_MTU_XXX
@ 2025-06-16  8:24 Leon Romanovsky
  2025-06-16 16:36 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2025-06-16  8:24 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski
  Cc: Mark Zhang, linux-rdma, netdev, Paolo Abeni, Patrisious Haddad,
	Tariq Toukan, Jason Gunthorpe

From: Mark Zhang <markzhang@nvidia.com>

Remove them to avoid "redeclaration of enumerator" build error, as they
are already defined in ib_verbs.h. This is needed for the following
patch, which need to include the ib_verbs.h.

Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB ports")
Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index febeadfdd5a5..03d2fc7d9b09 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -49,6 +49,8 @@
 #include <linux/mlx4/device.h>
 #include <linux/mlx4/doorbell.h>
 
+#include <rdma/ib_verbs.h>
+
 #include "mlx4.h"
 #include "fw.h"
 #include "icm.h"
@@ -1246,14 +1248,6 @@ static ssize_t set_port_type(struct device *dev,
 	return err ? err : count;
 }
 
-enum ibta_mtu {
-	IB_MTU_256  = 1,
-	IB_MTU_512  = 2,
-	IB_MTU_1024 = 3,
-	IB_MTU_2048 = 4,
-	IB_MTU_4096 = 5
-};
-
 static inline int int_to_ibta_mtu(int mtu)
 {
 	switch (mtu) {
@@ -1266,7 +1260,7 @@ static inline int int_to_ibta_mtu(int mtu)
 	}
 }
 
-static inline int ibta_mtu_to_int(enum ibta_mtu mtu)
+static inline int ibta_mtu_to_int(enum ib_mtu mtu)
 {
 	switch (mtu) {
 	case IB_MTU_256:  return  256;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlx4e: Remove redundant definition of IB_MTU_XXX
  2025-06-16  8:24 [PATCH net] net/mlx4e: Remove redundant definition of IB_MTU_XXX Leon Romanovsky
@ 2025-06-16 16:36 ` Simon Horman
  2025-06-16 18:33   ` Leon Romanovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2025-06-16 16:36 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Mark Zhang, linux-rdma, netdev, Paolo Abeni, Patrisious Haddad,
	Tariq Toukan, Jason Gunthorpe

On Mon, Jun 16, 2025 at 11:24:23AM +0300, Leon Romanovsky wrote:
> From: Mark Zhang <markzhang@nvidia.com>
> 
> Remove them to avoid "redeclaration of enumerator" build error, as they
> are already defined in ib_verbs.h. This is needed for the following
> patch, which need to include the ib_verbs.h.
> 
> Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB ports")
> Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
> Signed-off-by: Mark Zhang <markzhang@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

Hi Mark, Leon, all,

If I understand things correctly, without this patch the driver
compiles and functions correctly. But if it is modified to
include rdma/ib_verbs.h, which is required for some other forthcoming
change, then the other parts of this patch are needed to avoid a build
failure.

If so, this doesn't match my understanding of a bug fix.
Rather, it seems like a change (for net-next; no fixess tag?) which could
be included in the patch-set that needs rdma/ib_verbs.h included
in this file.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlx4e: Remove redundant definition of IB_MTU_XXX
  2025-06-16 16:36 ` Simon Horman
@ 2025-06-16 18:33   ` Leon Romanovsky
  2025-06-16 20:04     ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2025-06-16 18:33 UTC (permalink / raw)
  To: Simon Horman
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Mark Zhang, linux-rdma, netdev, Paolo Abeni, Patrisious Haddad,
	Tariq Toukan, Jason Gunthorpe

On Mon, Jun 16, 2025 at 05:36:02PM +0100, Simon Horman wrote:
> On Mon, Jun 16, 2025 at 11:24:23AM +0300, Leon Romanovsky wrote:
> > From: Mark Zhang <markzhang@nvidia.com>
> > 
> > Remove them to avoid "redeclaration of enumerator" build error, as they
> > are already defined in ib_verbs.h. This is needed for the following
> > patch, which need to include the ib_verbs.h.
> > 
> > Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB ports")
> > Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
> > Signed-off-by: Mark Zhang <markzhang@nvidia.com>
> > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> 
> Hi Mark, Leon, all,
> 
> If I understand things correctly, without this patch the driver
> compiles and functions correctly. But if it is modified to
> include rdma/ib_verbs.h, which is required for some other forthcoming
> change, then the other parts of this patch are needed to avoid a build
> failure.

Yes, the inclusion of rdma/ib_verbs.h was needed for series, which at
the end doesn't need it. I can drop Fixes line if it is important.

There is no following patches for this. It is standalone change.

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlx4e: Remove redundant definition of IB_MTU_XXX
  2025-06-16 18:33   ` Leon Romanovsky
@ 2025-06-16 20:04     ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-06-16 20:04 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Mark Zhang, linux-rdma, netdev, Paolo Abeni, Patrisious Haddad,
	Tariq Toukan, Jason Gunthorpe

On Mon, Jun 16, 2025 at 09:33:05PM +0300, Leon Romanovsky wrote:
> On Mon, Jun 16, 2025 at 05:36:02PM +0100, Simon Horman wrote:
> > On Mon, Jun 16, 2025 at 11:24:23AM +0300, Leon Romanovsky wrote:
> > > From: Mark Zhang <markzhang@nvidia.com>
> > > 
> > > Remove them to avoid "redeclaration of enumerator" build error, as they
> > > are already defined in ib_verbs.h. This is needed for the following
> > > patch, which need to include the ib_verbs.h.
> > > 
> > > Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB ports")
> > > Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
> > > Signed-off-by: Mark Zhang <markzhang@nvidia.com>
> > > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> > 
> > Hi Mark, Leon, all,
> > 
> > If I understand things correctly, without this patch the driver
> > compiles and functions correctly. But if it is modified to
> > include rdma/ib_verbs.h, which is required for some other forthcoming
> > change, then the other parts of this patch are needed to avoid a build
> > failure.
> 
> Yes, the inclusion of rdma/ib_verbs.h was needed for series, which at
> the end doesn't need it. I can drop Fixes line if it is important.
> 
> There is no following patches for this. It is standalone change.

Sure, that is fine by me.
But please drop the Fixes tag and resubmit for net-next.

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-16 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-16  8:24 [PATCH net] net/mlx4e: Remove redundant definition of IB_MTU_XXX Leon Romanovsky
2025-06-16 16:36 ` Simon Horman
2025-06-16 18:33   ` Leon Romanovsky
2025-06-16 20:04     ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).