Skip to contentSkip to conversation

net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition

PATCH Applied Arnd Bergmann 3 participants 3 messages Feb 25, 2021 – Mar 2, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition

From: Arnd Bergmann <[email protected]>

The alternative implementation of this function in a header file is declared as a global symbol, and gets added to every .c file that includes it, which leads to a link error:

arm-linux-gnueabi-ld: drivers/net/ethernet/mellanox/mlx5/core/en_rx.o: in function `mlx5e_tc_tun_update_header_ipv6':
en_rx.c:(.text+0x0): multiple definition of `mlx5e_tc_tun_update_header_ipv6'; drivers/net/ethernet/mellanox/mlx5/core/en_main.o:en_main.c:(.text+0x0): first defined here

Mark it 'static inline' like the other functions here.

Fixes c7b9038d8af6 ("net/mlx5e: TC preparation refactoring for routing update event")
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +6 -4
index 67de2bf36861..89d5ca91566e 100644
@@ -76,10 +76,12 @@ int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
 static inline int
 mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
 				struct net_device *mirred_dev,
-				struct mlx5e_encap_entry *e) { return -EOPNOTSUPP; }
-int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
-				    struct net_device *mirred_dev,
-				    struct mlx5e_encap_entry *e)
+				struct mlx5e_encap_entry *e)
+{ return -EOPNOTSUPP; }
+static inline int
+mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
+				struct net_device *mirred_dev,
+				struct mlx5e_encap_entry *e)
 { return -EOPNOTSUPP; }
 #endif
 int mlx5e_tc_tun_route_lookup(struct mlx5e_priv *priv,
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The alternative implementation of this function in a header file is declared as a global symbol, and gets added to every .c file that includes it, which leads to a link error:

arm-linux-gnueabi-ld: drivers/net/ethernet/mellanox/mlx5/core/en_rx.o: in function `mlx5e_tc_tun_update_header_ipv6':
en_rx.c:(.text+0x0): multiple definition of `mlx5e_tc_tun_update_header_ipv6'; drivers/net/ethernet/mellanox/mlx5/core/en_main.o:en_main.c:(.text+0x0): first defined here

Mark it 'static inline' like the other functions here.

Fixes c7b9038d8af6 ("net/mlx5e: TC preparation refactoring for routing update event")
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +0 -3
index 67de2bf36861..89d5ca91566e 100644
@@ -76,10 +76,12 @@ int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
 static inline int
 mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
 				struct net_device *mirred_dev,
-				struct mlx5e_encap_entry *e) { return -EOPNOTSUPP; }
-int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
-				    struct net_device *mirred_dev,

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv, · line 87

Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +6 -1
-				    struct mlx5e_encap_entry *e)
+				struct mlx5e_encap_entry *e)
+{ return -EOPNOTSUPP; }
+static inline int
+mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
+				struct net_device *mirred_dev,
+				struct mlx5e_encap_entry *e)
 { return -EOPNOTSUPP; }
 #endif
 int mlx5e_tc_tun_route_lookup(struct mlx5e_priv *priv,

Thanks Arnd!

#2 lore raw
Quoted 52 lines · Vlad Buslov
Quoted 45 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The alternative implementation of this function in a header file is declared as a global symbol, and gets added to every .c file that includes it, which leads to a link error:

arm-linux-gnueabi-ld:
drivers/net/ethernet/mellanox/mlx5/core/en_rx.o: in function `mlx5e_tc_tun_update_header_ipv6':
en_rx.c:(.text+0x0): multiple definition of `mlx5e_tc_tun_update_header_ipv6'; drivers/net/ethernet/mellanox/mlx5/core/en_main.o:en_main.c:(.text+ 0x0): first defined here

Mark it 'static inline' like the other functions here.

Fixes c7b9038d8af6 ("net/mlx5e: TC preparation refactoring for

routing update event")

---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 10 ++++++--- -

 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +0 -0
index 67de2bf36861..89d5ca91566e 100644
@@ -76,10 +76,12 @@ int mlx5e_tc_tun_update_header_ipv6(struct
 mlx5e_priv *priv,

 static inline int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv, struct net_device *mirred_dev, -                               struct mlx5e_encap_entry *e) { return -EOPNOTSUPP; }

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +6 -3
-int mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
-                                   struct net_device *mirred_dev,
-                                   struct mlx5e_encap_entry *e)
+                               struct mlx5e_encap_entry *e)
+{ return -EOPNOTSUPP; }
+static inline int
+mlx5e_tc_tun_update_header_ipv6(struct mlx5e_priv *priv,
+                               struct net_device *mirred_dev,
+                               struct mlx5e_encap_entry *e)
Quoted 3 lines

 { return -EOPNOTSUPP; }
 #endif
 int mlx5e_tc_tun_route_lookup(struct mlx5e_priv *priv,

Thanks Arnd!

Quoted 1 line

Applied to net-mlx5,

Thanks.