Skip to contentSkip to conversation

xfrm: kconfig: Fix XFRM_OFFLOAD dependency on XFRM

PATCH In review Ilia Lin 3 participants 8 messages Jul 24, 2023 – Jul 25, 2023

Subsystems (3)
lore
Share & tools
lore

Ilia Lin

author
#0 lore raw

PATCH 1/1 xfrm: kconfig: Fix XFRM_OFFLOAD dependency on XFRM

If XFRM_OFFLOAD is configured, but XFRM is not, it will cause
compilation error on include xfrm.h:
C 05:56:39 In file included from /src/linux/kernel_platform/msm-kernel/net/core/sock.c:127:
C 05:56:39 /src/linux/kernel_platform/msm-kernel/include/net/xfrm.h:1932:30: error: no member named 'xfrm' in 'struct dst_entry'
C 05:56:39 struct xfrm_state *x = dst->xfrm;
C 05:56:39 ~~~ ^

Making the XFRM_OFFLOAD select the XFRM.

Fixes 48e01e001da31 ("ixgbe/ixgbevf: fix XFRM_ALGO dependency")
---
 net/xfrm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/xfrm/Kconfig +1 -0
index 3adf31a83a79a..3fc2c1bcb5bbe 100644
@@ -10,6 +10,7 @@ config XFRM
 
 config XFRM_OFFLOAD
 	bool
+	select XFRM
 
 config XFRM_ALGO
 	tristate

--
2.25.1

#1 lore raw
Quoted 1 line · Ilia Lin

If XFRM_OFFLOAD is configured, but XFRM is not

How did you do it?

Quoted 21 lines

, it will cause
compilation error on include xfrm.h:
C 05:56:39 In file included from /src/linux/kernel_platform/msm-kernel/net/core/sock.c:127:
C 05:56:39 /src/linux/kernel_platform/msm-kernel/include/net/xfrm.h:1932:30: error: no member named 'xfrm' in 'struct dst_entry'
C 05:56:39 struct xfrm_state *x = dst->xfrm;
C 05:56:39 ~~~ ^

Making the XFRM_OFFLOAD select the XFRM.

Fixes 48e01e001da31 ("ixgbe/ixgbevf: fix XFRM_ALGO dependency")
---
 net/xfrm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/xfrm/Kconfig +0 -0
index 3adf31a83a79a..3fc2c1bcb5bbe 100644

net/xfrm/Kconfig config XFRM · line 13

Quoted 4 lines
net/xfrm/Kconfig +1 -0
@@ -10,6 +10,7 @@ config XFRM
 
 config XFRM_OFFLOAD
 	bool
+	select XFRM

struct dst_entry depends on CONFIG_XFRM and not on CONFIG_XFRM_OFFLOAD, so it is unclear to me why do you need to add new "select XFRM" line.

   26 struct dst_entry {
   27         struct net_device       *dev;
   28         struct  dst_ops         *ops;
   29         unsigned long           _metrics;
   30         unsigned long           expires;
   31 #ifdef CONFIG_XFRM
   32         struct xfrm_state       *xfrm;
   33 #else
   34         void                    *__pad1;
   35 #endif
   36         int

Thanks

author
#2 lore raw

Hi Leon,

This is exactly like I described:
* xfrm.h is included from the net/core/sock.c unconditionally.
* If CONFIG_XFRM_OFFLOAD is set, then the xfrm_dst_offload_ok() is being compiled.
* If CONFIG_XFRM is not set, the struct dst_entry doesn't have the xfrm member.
* xfrm_dst_offload_ok() tries to access the dst->xfrm and that fails to compile.

Thanks,
Ilia Lin

Quoted 48 lines · Leon Romanovsky
Quoted 1 line · Ilia Lin

If XFRM_OFFLOAD is configured, but XFRM is not

How did you do it?

Quoted 21 lines

, it will cause
compilation error on include xfrm.h:
C 05:56:39 In file included from /src/linux/kernel_platform/msm-kernel/net/core/sock.c:127:
C 05:56:39 /src/linux/kernel_platform/msm-kernel/include/net/xfrm.h:1932:30: error: no member named 'xfrm' in 'struct dst_entry'
C 05:56:39 struct xfrm_state *x = dst->xfrm;
C 05:56:39 ~~~ ^

Making the XFRM_OFFLOAD select the XFRM.

Fixes 48e01e001da31 ("ixgbe/ixgbevf: fix XFRM_ALGO dependency")
---
 net/xfrm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/xfrm/Kconfig +0 -0
index 3adf31a83a79a..3fc2c1bcb5bbe 100644

net/xfrm/Kconfig config XFRM · line 13

Quoted 4 lines
net/xfrm/Kconfig +1 -0
@@ -10,6 +10,7 @@ config XFRM
 
 config XFRM_OFFLOAD
      bool
+     select XFRM

struct dst_entry depends on CONFIG_XFRM and not on CONFIG_XFRM_OFFLOAD, so it is unclear to me why do you need to add new "select XFRM" line.

   26 struct dst_entry {
   27         struct net_device       *dev;
   28         struct  dst_ops         *ops;
   29         unsigned long           _metrics;
   30         unsigned long           expires;
   31 #ifdef CONFIG_XFRM
   32         struct xfrm_state       *xfrm;
   33 #else
   34         void                    *__pad1;
   35 #endif
   36         int

Thanks

#3 lore raw
Quoted 1 line · Ilia Lin

Hi Leon,

You was already asked do not top-post.
https://lore.kernel.org/netdev/20230718105446.GD8808@unreal/
Please stop it.

Quoted 7 lines

This is exactly like I described:
* xfrm.h is included from the net/core/sock.c unconditionally.
* If CONFIG_XFRM_OFFLOAD is set, then the xfrm_dst_offload_ok() is being compiled.
* If CONFIG_XFRM is not set, the struct dst_entry doesn't have the xfrm member.
* xfrm_dst_offload_ok() tries to access the dst->xfrm and that fails to compile.

I asked two questions. First one was "How did you set XFRM_OFFLOAD without XFRM?".

Thanks

Quoted 54 lines

Thanks,
Ilia Lin

Quoted 48 lines · Leon Romanovsky
Quoted 1 line · Ilia Lin

If XFRM_OFFLOAD is configured, but XFRM is not

How did you do it?

Quoted 21 lines

, it will cause
compilation error on include xfrm.h:
C 05:56:39 In file included from /src/linux/kernel_platform/msm-kernel/net/core/sock.c:127:
C 05:56:39 /src/linux/kernel_platform/msm-kernel/include/net/xfrm.h:1932:30: error: no member named 'xfrm' in 'struct dst_entry'
C 05:56:39 struct xfrm_state *x = dst->xfrm;
C 05:56:39 ~~~ ^

Making the XFRM_OFFLOAD select the XFRM.

Fixes 48e01e001da31 ("ixgbe/ixgbevf: fix XFRM_ALGO dependency")
---
 net/xfrm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/xfrm/Kconfig +0 -0
index 3adf31a83a79a..3fc2c1bcb5bbe 100644

net/xfrm/Kconfig config XFRM · line 13

Quoted 4 lines
net/xfrm/Kconfig +1 -0
@@ -10,6 +10,7 @@ config XFRM
 
 config XFRM_OFFLOAD
      bool
+     select XFRM

struct dst_entry depends on CONFIG_XFRM and not on CONFIG_XFRM_OFFLOAD, so it is unclear to me why do you need to add new "select XFRM" line.

   26 struct dst_entry {
   27         struct net_device       *dev;
   28         struct  dst_ops         *ops;
   29         unsigned long           _metrics;
   30         unsigned long           expires;
   31 #ifdef CONFIG_XFRM
   32         struct xfrm_state       *xfrm;
   33 #else
   34         void                    *__pad1;
   35 #endif
   36         int

Thanks

#4 lore raw
Quoted 16 lines · Leon Romanovsky
Quoted 1 line · Ilia Lin

Hi Leon,

You was already asked do not top-post.
https://lore.kernel.org/netdev/20230718105446.GD8808@unreal/
Please stop it.

Quoted 7 lines

This is exactly like I described:
* xfrm.h is included from the net/core/sock.c unconditionally.
* If CONFIG_XFRM_OFFLOAD is set, then the xfrm_dst_offload_ok() is being compiled.
* If CONFIG_XFRM is not set, the struct dst_entry doesn't have the xfrm member.
* xfrm_dst_offload_ok() tries to access the dst->xfrm and that fails to compile.

Quoted 5 lines

I asked two questions. First one was "How did you set XFRM_OFFLOAD without XFRM?".

Thanks

In driver Kconfig: "select XFRM_OFFLOAD"

Quoted 55 lines
Quoted 55 lines

Thanks,
Ilia Lin

Quoted 48 lines · Leon Romanovsky
Quoted 1 line · Ilia Lin

If XFRM_OFFLOAD is configured, but XFRM is not

How did you do it?

Quoted 21 lines

, it will cause
compilation error on include xfrm.h:
C 05:56:39 In file included from /src/linux/kernel_platform/msm-kernel/net/core/sock.c:127:
C 05:56:39 /src/linux/kernel_platform/msm-kernel/include/net/xfrm.h:1932:30: error: no member named 'xfrm' in 'struct dst_entry'
C 05:56:39 struct xfrm_state *x = dst->xfrm;
C 05:56:39 ~~~ ^

Making the XFRM_OFFLOAD select the XFRM.

Fixes 48e01e001da31 ("ixgbe/ixgbevf: fix XFRM_ALGO dependency")
---
 net/xfrm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/xfrm/Kconfig +0 -0
index 3adf31a83a79a..3fc2c1bcb5bbe 100644

net/xfrm/Kconfig config XFRM · line 13

Quoted 4 lines
net/xfrm/Kconfig +1 -0
@@ -10,6 +10,7 @@ config XFRM
 
 config XFRM_OFFLOAD
      bool
+     select XFRM

struct dst_entry depends on CONFIG_XFRM and not on CONFIG_XFRM_OFFLOAD, so it is unclear to me why do you need to add new "select XFRM" line.

   26 struct dst_entry {
   27         struct net_device       *dev;
   28         struct  dst_ops         *ops;
   29         unsigned long           _metrics;
   30         unsigned long           expires;
   31 #ifdef CONFIG_XFRM
   32         struct xfrm_state       *xfrm;
   33 #else
   34         void                    *__pad1;
   35 #endif
   36         int

Thanks

#5 lore raw
Quoted 17 lines · Ilia Lin
Quoted 16 lines · Leon Romanovsky
Quoted 1 line · Ilia Lin

Hi Leon,

You was already asked do not top-post.
https://lore.kernel.org/netdev/20230718105446.GD8808@unreal/
Please stop it.

Quoted 7 lines

This is exactly like I described:
* xfrm.h is included from the net/core/sock.c unconditionally.
* If CONFIG_XFRM_OFFLOAD is set, then the xfrm_dst_offload_ok() is being compiled.
* If CONFIG_XFRM is not set, the struct dst_entry doesn't have the xfrm member.
* xfrm_dst_offload_ok() tries to access the dst->xfrm and that fails to compile.

Quoted 6 lines
Quoted 5 lines

I asked two questions. First one was "How did you set XFRM_OFFLOAD without XFRM?".

Thanks

In driver Kconfig: "select XFRM_OFFLOAD"

In driver Kconfig, one should use "depends on XFRM_OFFLOAD" and not "select XFRM_OFFLOAD". Drivers shouldn't enable XFRM_OFFLOAD directly and all upstream users are safe here.

Thanks

author
#6 lore raw
Quoted 22 lines · Leon Romanovsky
Quoted 20 lines · Ilia Lin
Quoted 19 lines · Leon Romanovsky
Quoted 1 line · Ilia Lin

Hi Leon,

You was already asked do not top-post.
https://lore.kernel.org/netdev/20230718105446.GD8808@unreal/
Please stop it.

Quoted 7 lines

This is exactly like I described:
* xfrm.h is included from the net/core/sock.c unconditionally.
* If CONFIG_XFRM_OFFLOAD is set, then the xfrm_dst_offload_ok() is being compiled.
* If CONFIG_XFRM is not set, the struct dst_entry doesn't have the xfrm member.
* xfrm_dst_offload_ok() tries to access the dst->xfrm and that fails to compile.

I asked two questions. First one was "How did you set XFRM_OFFLOAD without XFRM?".

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

Thanks

In driver Kconfig: "select XFRM_OFFLOAD"

In driver Kconfig, one should use "depends on XFRM_OFFLOAD" and not "select XFRM_OFFLOAD". Drivers shouldn't enable XFRM_OFFLOAD directly and all upstream users are safe here.

Thank you for that information, but the XFRM_OFFLOAD doesn't depend on XFRM either.

Quoted 2 lines

Thanks

#7 lore raw
Quoted 25 lines · Ilia Lin
Quoted 24 lines · Leon Romanovsky
Quoted 22 lines · Ilia Lin
Quoted 21 lines · Leon Romanovsky
Quoted 1 line · Ilia Lin

Hi Leon,

You was already asked do not top-post.
https://lore.kernel.org/netdev/20230718105446.GD8808@unreal/
Please stop it.

Quoted 7 lines

This is exactly like I described:
* xfrm.h is included from the net/core/sock.c unconditionally.
* If CONFIG_XFRM_OFFLOAD is set, then the xfrm_dst_offload_ok() is being compiled.
* If CONFIG_XFRM is not set, the struct dst_entry doesn't have the xfrm member.
* xfrm_dst_offload_ok() tries to access the dst->xfrm and that fails to compile.

I asked two questions. First one was "How did you set XFRM_OFFLOAD without XFRM?".

Thanks

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

In driver Kconfig: "select XFRM_OFFLOAD"

In driver Kconfig, one should use "depends on XFRM_OFFLOAD" and not "select XFRM_OFFLOAD". Drivers shouldn't enable XFRM_OFFLOAD directly and all upstream users are safe here.

Thank you for that information, but the XFRM_OFFLOAD doesn't depend on XFRM either.

Indirectly, XFRM_OFFLOAD depends on XFRM.

INET_ESP_OFFLOAD -> INET_ESP/XFRM_OFFLOAD -> XFRM_ESP -> XFRM_ALGO -> XFRM.

Thanks

Quoted 3 lines
Quoted 3 lines

Thanks