Skip to contentSkip to conversation

eth: fbnic: don't build the driver when skb has more than 25 frags

PATCH Superseded Jakub Kicinski 2 participants 4 messages Jul 17, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 eth: fbnic: don't build the driver when skb has more than 25 frags

Similarly to commit 0e03c643dc93 ("eth: fbnic: fix s390 build."), the driver won't build if skb_shared_info has more than 25 frags.

Fixes 0cb4c0a13723 ("eth: fbnic: Implement Rx queue alloc/start/stop/free")

---
CC: [email protected]
CC: [email protected]

---
 drivers/net/ethernet/meta/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/meta/Kconfig +1 -0
index a9f078212c78..b599c71a2d27 100644
@@ -21,6 +21,7 @@ config FBNIC
 	tristate "Meta Platforms Host Network Interface"
 	depends on X86_64 || COMPILE_TEST
 	depends on S390=n
+	depends on MAX_SKB_FRAGS < 26
 	depends on PCI_MSI
 	select PHYLINK
 	help
Signature · 1 line
2.45.2
maintainer
#1 lore raw
Quoted 17 lines · Jakub Kicinski

Similarly to commit 0e03c643dc93 ("eth: fbnic: fix s390 build."), the driver won't build if skb_shared_info has more than 25 frags.

Fixes 0cb4c0a13723 ("eth: fbnic: Implement Rx queue alloc/start/stop/free")

---
CC: [email protected]
CC: [email protected]

---
  drivers/net/ethernet/meta/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/net/ethernet/meta/Kconfig +0 -0
index a9f078212c78..b599c71a2d27 100644

drivers/net/ethernet/meta/Kconfig config FBNIC · line 24

Quoted 4 lines
drivers/net/ethernet/meta/Kconfig +1 -0
@@ -21,6 +21,7 @@ config FBNIC
  	tristate "Meta Platforms Host Network Interface"
  	depends on X86_64 || COMPILE_TEST
  	depends on S390=n
+	depends on MAX_SKB_FRAGS < 26

I think that with aarch MAX_SKB_FRAGS should be max 21. Aarch cacheline size is 128, right? The frag independent part of skb_shared_info takes 48 bytes, and sizeof(skb_frag_t) == 16:

(512 - 128 - 48)/16 = 21

Cheers,

Paolo

author maintainer
#2 lore raw
Quoted 5 lines · On Wed, 17 Jul 2024 15:44:09 +0200 Paolo Abeni wrote:

I think that with aarch MAX_SKB_FRAGS should be max 21. Aarch cacheline size is 128, right? The frag independent part of skb_shared_info takes 48 bytes, and sizeof(skb_frag_t) == 16:

(512 - 128 - 48)/16 = 21

Hm, my grep foo must be low, I don't see aarch64 with 128B cache lines. But I do see powerpc, so we can stick to 21 to be safe.

maintainer
#3 lore raw
Quoted 9 lines · Jakub Kicinski
Quoted 5 lines · On Wed, 17 Jul 2024 15:44:09 +0200 Paolo Abeni wrote:

I think that with aarch MAX_SKB_FRAGS should be max 21. Aarch cacheline size is 128, right? The frag independent part of skb_shared_info takes 48 bytes, and sizeof(skb_frag_t) == 16:

(512 - 128 - 48)/16 = 21

Hm, my grep foo must be low, I don't see aarch64 with 128B cache lines. But I do see powerpc, so we can stick to 21 to be safe.

Yup, it looks like I was wrong with aarch64, but there are indeed other 64bits arches with 128 bytes cache line size.

Given this impact builds, I think we are better off with a fast repost (before the 24h grace period).

Thanks,

Paolo