Skip to contentSkip to conversation

net: mlx5e: fix fs_tcp.c build when IPV6 is not enabled

PATCH Applied Randy Dunlap 3 participants 3 messages Nov 22, 2020 – Nov 23, 2020

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

PATCH 1/1 net: mlx5e: fix fs_tcp.c build when IPV6 is not enabled

Fix build when CONFIG_IPV6 is not enabled by making a function be built conditionally.

Fixes these build errors and warnings:

../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c: In function 'accel_fs_tcp_set_ipv6_flow':
../include/net/sock.h:380:34: error: 'struct sock_common' has no member named 'skc_v6_daddr'; did you mean 'skc_daddr'?
380 | #define sk_v6_daddr __sk_common.skc_v6_daddr

      |                                  ^~~~~~~~~~~~
../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:55:14: note: in expansion of macro 'sk_v6_daddr'
   55 |         &sk->sk_v6_daddr, 16);
      |              ^~~~~~~~~~~

At top level:
../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:47:13: warning: 'accel_fs_tcp_set_ipv6_flow' defined but not used [-Wunused-function]
47 | static void accel_fs_tcp_set_ipv6_flow(struct mlx5_flow_spec *spec, struct sock *sk)

Fixes 5229a96e59ec ("net/mlx5e: Accel, Expose flow steering API for rules add/del")
Cc Saeed Mahameed <[email protected]>
Cc Boris Pismenny <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c +2 -0
@@ -44,6 +44,7 @@ static void accel_fs_tcp_set_ipv4_flow(s
 			 outer_headers.dst_ipv4_dst_ipv6.ipv4_layout.ipv4);
 }
 
+#if IS_ENABLED(CONFIG_IPV6)
 static void accel_fs_tcp_set_ipv6_flow(struct mlx5_flow_spec *spec, struct sock *sk)
 {
 	MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, outer_headers.ip_protocol);
@@ -63,6 +64,7 @@ static void accel_fs_tcp_set_ipv6_flow(s
 			    outer_headers.dst_ipv4_dst_ipv6.ipv6_layout.ipv6),
 	       0xff, 16);
 }
+#endif
 
 void mlx5e_accel_fs_del_sk(struct mlx5_flow_handle *rule)
 {
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Randy Dunlap

Fix build when CONFIG_IPV6 is not enabled by making a function be built conditionally.

Fixes these build errors and warnings:

../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c: In function 'accel_fs_tcp_set_ipv6_flow':
../include/net/sock.h:380:34: error: 'struct sock_common' has no member named 'skc_v6_daddr'; did you mean 'skc_daddr'?
380 | #define sk_v6_daddr __sk_common.skc_v6_daddr

       |                                  ^~~~~~~~~~~~
../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:55:14: note: in expansion of macro 'sk_v6_daddr'
    55 |         &sk->sk_v6_daddr, 16);
       |              ^~~~~~~~~~~

At top level:
../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:47:13: warning: 'accel_fs_tcp_set_ipv6_flow' defined but not used [-Wunused-function]
47 | static void accel_fs_tcp_set_ipv6_flow(struct mlx5_flow_spec *spec, struct sock *sk)

Fixes 5229a96e59ec ("net/mlx5e: Accel, Expose flow steering API for rules add/del")
Cc Saeed Mahameed <[email protected]>
Cc Boris Pismenny <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Quoted 1 line

---

Thanks for your patch.

#2 lore raw
Quoted 35 lines · Tariq Toukan
Quoted 24 lines · Randy Dunlap

Fix build when CONFIG_IPV6 is not enabled by making a function be built conditionally.

Fixes these build errors and warnings:

../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c: In function 'accel_fs_tcp_set_ipv6_flow':
../include/net/sock.h:380:34: error: 'struct sock_common' has no member named 'skc_v6_daddr'; did you mean 'skc_daddr'?
380 | #define sk_v6_daddr __sk_common.skc_v6_daddr

       |                                  ^~~~~~~~~~~~
../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:55:14:
note: in expansion of macro 'sk_v6_daddr'
    55 |         &sk->sk_v6_daddr, 16);
       |              ^~~~~~~~~~~

At top level:
../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:47:13:
warning: 'accel_fs_tcp_set_ipv6_flow' defined but not used [- Wunused-function]
47 | static void accel_fs_tcp_set_ipv6_flow(struct
mlx5_flow_spec *spec, struct sock *sk)

Fixes 5229a96e59ec ("net/mlx5e: Accel, Expose flow steering API

for rules add/del")

Quoted 8 lines
Cc Saeed Mahameed <[email protected]>
Cc Boris Pismenny <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>

---

Quoted 3 lines

Applied to net-mlx5,
Thanks!