netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition
@ 2021-02-25 12:54 Arnd Bergmann
  2021-03-01  9:57 ` Vlad Buslov
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2021-02-25 12:54 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, David S. Miller, Jakub Kicinski,
	Dmytro Linkin, Vlad Buslov, Roi Dayan
  Cc: Arnd Bergmann, Eli Britstein, Eli Cohen, netdev, linux-rdma,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
index 67de2bf36861..89d5ca91566e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
@@ -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,
-- 
2.29.2


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

* Re: [PATCH] net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition
  2021-02-25 12:54 [PATCH] net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition Arnd Bergmann
@ 2021-03-01  9:57 ` Vlad Buslov
  2021-03-02  6:30   ` Saeed Mahameed
  0 siblings, 1 reply; 3+ messages in thread
From: Vlad Buslov @ 2021-03-01  9:57 UTC (permalink / raw)
  To: Arnd Bergmann, Saeed Mahameed
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, Dmytro Linkin,
	Roi Dayan, Arnd Bergmann, Eli Britstein, Eli Cohen, netdev,
	linux-rdma, linux-kernel

On Thu 25 Feb 2021 at 14:54, Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
> index 67de2bf36861..89d5ca91566e 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
> @@ -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,

Thanks Arnd!

Reviewed-by: Vlad Buslov <vladbu@nvidia.com>

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

* Re: [PATCH] net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition
  2021-03-01  9:57 ` Vlad Buslov
@ 2021-03-02  6:30   ` Saeed Mahameed
  0 siblings, 0 replies; 3+ messages in thread
From: Saeed Mahameed @ 2021-03-02  6:30 UTC (permalink / raw)
  To: Vlad Buslov, Arnd Bergmann
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, Dmytro Linkin,
	Roi Dayan, Arnd Bergmann, Eli Britstein, Eli Cohen, netdev,
	linux-rdma, linux-kernel

On Mon, 2021-03-01 at 11:57 +0200, Vlad Buslov wrote:
> On Thu 25 Feb 2021 at 14:54, Arnd Bergmann <arnd@kernel.org> wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > 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")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 10 ++++++---
> > -
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
> > b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
> > index 67de2bf36861..89d5ca91566e 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
> > @@ -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,
> 
> Thanks Arnd!
> 
> Reviewed-by: Vlad Buslov <vladbu@nvidia.com>

Applied to net-mlx5, 

Thanks.



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

end of thread, other threads:[~2021-03-02  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 12:54 [PATCH] net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition Arnd Bergmann
2021-03-01  9:57 ` Vlad Buslov
2021-03-02  6:30   ` Saeed Mahameed

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).