Skip to contentSkip to conversation

net/e1000: fix crash when built with GCC 13

PATCH Applied Ciara Loftus 3 participants 4 messages Oct 10, 2025 – Oct 30, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/e1000: fix crash when built with GCC 13

The e1000 PMD crashes during initialisation in a Ubuntu 24.04 VM when compiled with gcc-13 with -O3 optimisations. This patch introduces a compiler barrier after the register read that was causing the issue.

Bugzilla ID: 1691

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_mac.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_mac.c +1 -0
index 2fa97d12a9..41aae86ffe 100644
@@ -1842,6 +1842,7 @@ s32 e1000_id_led_init_generic(struct e1000_hw *hw)
 		return ret_val;
 
 	mac->ledctl_default = E1000_READ_REG(hw, E1000_LEDCTL);
+	rte_compiler_barrier();
 	mac->ledctl_mode1 = mac->ledctl_default;
 	mac->ledctl_mode2 = mac->ledctl_default;
 
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ciara Loftus

The e1000 PMD crashes during initialisation in a Ubuntu 24.04 VM when compiled with gcc-13 with -O3 optimisations. This patch introduces a compiler barrier after the register read that was causing the issue.

Bugzilla ID: 1691

Fixes af75078fece3 ("first public release")

The patch fixes the crash at startup.

Thanks

Thierry

Quoted 16 lines
---
  drivers/net/intel/e1000/base/e1000_mac.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_mac.c +1 -0
index 2fa97d12a9..41aae86ffe 100644
@@ -1842,6 +1842,7 @@ s32 e1000_id_led_init_generic(struct e1000_hw *hw)
  		return ret_val;
 
  	mac->ledctl_default = E1000_READ_REG(hw, E1000_LEDCTL);
+	rte_compiler_barrier();
  	mac->ledctl_mode1 = mac->ledctl_default;
  	mac->ledctl_mode2 = mac->ledctl_default;
 
Signature · 1 line
Thierry Herbelot
#2 lore raw
Quoted 23 lines · Thierry Herbelot
Quoted 9 lines · Ciara Loftus

The e1000 PMD crashes during initialisation in a Ubuntu 24.04 VM when compiled with gcc-13 with -O3 optimisations. This patch introduces a compiler barrier after the register read that was causing the issue.

Bugzilla ID: 1691

Fixes af75078fece3 ("first public release")

The patch fixes the crash at startup.

Thanks

Thierry

Quoted 4 lines
---
  drivers/net/intel/e1000/base/e1000_mac.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 11 lines

drivers/net/intel/e1000/base/e1000_mac.c s32 e1000_id_led_init_generic(struct e1000_hw *hw) · line 1846

Quoted 10 lines
drivers/net/intel/e1000/base/e1000_mac.c +1 -0
index 2fa97d12a9..41aae86ffe 100644
@@ -1842,6 +1842,7 @@ s32 e1000_id_led_init_generic(struct e1000_hw *hw)
  		return ret_val;
  	mac->ledctl_default = E1000_READ_REG(hw, E1000_LEDCTL);
+	rte_compiler_barrier();
  	mac->ledctl_mode1 = mac->ledctl_default;
  	mac->ledctl_mode2 = mac->ledctl_default;

Since adding a compiler barrier is still a workaround (all-be-it a fairly unintrusive one), I'm going to hold off this patch until rc2 or rc3 in the hopes we get more details as to the exact root cause and why gcc-13 is producing code that crashes.

/Bruce

#3 lore raw
Quoted 35 lines · Bruce Richardson
Quoted 23 lines · Thierry Herbelot
Quoted 9 lines · Ciara Loftus

The e1000 PMD crashes during initialisation in a Ubuntu 24.04 VM when compiled with gcc-13 with -O3 optimisations. This patch introduces a compiler barrier after the register read that was causing the issue.

Bugzilla ID: 1691

Fixes af75078fece3 ("first public release")

The patch fixes the crash at startup.

Thanks

Thierry

Quoted 4 lines
---
  drivers/net/intel/e1000/base/e1000_mac.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 11 lines

drivers/net/intel/e1000/base/e1000_mac.c s32 e1000_id_led_init_generic(struct e1000_hw *hw) · line 1846

Quoted 10 lines
drivers/net/intel/e1000/base/e1000_mac.c +1 -0
index 2fa97d12a9..41aae86ffe 100644
@@ -1842,6 +1842,7 @@ s32 e1000_id_led_init_generic(struct e1000_hw *hw)
  		return ret_val;
  	mac->ledctl_default = E1000_READ_REG(hw, E1000_LEDCTL);
+	rte_compiler_barrier();
  	mac->ledctl_mode1 = mac->ledctl_default;
  	mac->ledctl_mode2 = mac->ledctl_default;
Quoted 5 lines

Since adding a compiler barrier is still a workaround (all-be-it a fairly unintrusive one), I'm going to hold off this patch until rc2 or rc3 in the hopes we get more details as to the exact root cause and why gcc-13 is producing code that crashes.

Given no further progress on this, taking this patch into RC2 so at least we don't experience the issue.

Applied to next-net-intel.

Thanks,
/Bruce