Skip to contentSkip to conversation

ixgbe: guard fwlog code by CONFIG_DEBUG_FS

PATCH In review Michal Swiatkowski 3 participants 6 messages Oct 14, 2025 – Oct 15, 2025

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

PATCH 1/1 ixgbe: guard fwlog code by CONFIG_DEBUG_FS

Building the ixgbe without CONFIG_DEBUG_FS leads to a build error. Fix that by guarding fwlog code.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 8 ++++++++
 2 files changed, 10 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +2 -0
index c2f8189a0738..c5d76222df18 100644
@@ -3921,6 +3921,7 @@ static int ixgbe_read_pba_string_e610(struct ixgbe_hw *hw, u8 *pba_num,
 	return err;
 }
 
+#ifdef CONFIG_DEBUG_FS
 static int __fwlog_send_cmd(void *priv, struct libie_aq_desc *desc, void *buf,
 			    u16 size)
 {
@@ -3952,6 +3953,7 @@ void ixgbe_fwlog_deinit(struct ixgbe_hw *hw)
 
 	libie_fwlog_deinit(&hw->fwlog);
 }
+#endif /* CONFIG_DEBUG_FS */
 
 static const struct ixgbe_mac_operations mac_ops_e610 = {
 	.init_hw			= ixgbe_init_hw_generic,
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h +8 -0
index 11916b979d28..5317798b3263 100644
@@ -96,7 +96,15 @@ int ixgbe_aci_update_nvm(struct ixgbe_hw *hw, u16 module_typeid,
 			 bool last_command, u8 command_flags);
 int ixgbe_nvm_write_activate(struct ixgbe_hw *hw, u16 cmd_flags,
 			     u8 *response_flags);
+#ifdef CONFIG_DEBUG_FS
 int ixgbe_fwlog_init(struct ixgbe_hw *hw);
 void ixgbe_fwlog_deinit(struct ixgbe_hw *hw);
+#else
+static inline int ixgbe_fwlog_init(struct ixgbe_hw *hw)
+{
+	return -EOPNOTSUPP;
+}
+static inline void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) {}
+#endif /* CONFIG_DEBUG_FS */
 
 #endif /* _IXGBE_E610_H_ */
Signature · 1 line
2.49.0
#1 lore raw
Quoted 8 lines · Michal Swiatkowski

Building the ixgbe without CONFIG_DEBUG_FS leads to a build error. Fix that by guarding fwlog code.

---

Hm. It probably is best to make this optional and not require debugfs via kconfig.

Quoted 17 lines
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 8 ++++++++
 2 files changed, 10 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
index c2f8189a0738..c5d76222df18 100644
@@ -3921,6 +3921,7 @@ static int ixgbe_read_pba_string_e610(struct ixgbe_hw *hw, u8 *pba_num,
 	return err;
 }
 
+#ifdef CONFIG_DEBUG_FS
 static int __fwlog_send_cmd(void *priv, struct libie_aq_desc *desc, void *buf,
 			    u16 size)
 {

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) · line 3957

Quoted 5 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
@@ -3952,6 +3953,7 @@ void ixgbe_fwlog_deinit(struct ixgbe_hw *hw)
 
 	libie_fwlog_deinit(&hw->fwlog);
 }
+#endif /* CONFIG_DEBUG_FS */
 

What does the fwlog module from libie do? Seems likely that it won't compile without CONFIG_DEBUG_FS either...

Quoted 22 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +0 -0
 static const struct ixgbe_mac_operations mac_ops_e610 = {
 	.init_hw			= ixgbe_init_hw_generic,
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h +8 -0
index 11916b979d28..5317798b3263 100644
@@ -96,7 +96,15 @@ int ixgbe_aci_update_nvm(struct ixgbe_hw *hw, u16 module_typeid,
 			 bool last_command, u8 command_flags);
 int ixgbe_nvm_write_activate(struct ixgbe_hw *hw, u16 cmd_flags,
 			     u8 *response_flags);
+#ifdef CONFIG_DEBUG_FS
 int ixgbe_fwlog_init(struct ixgbe_hw *hw);
 void ixgbe_fwlog_deinit(struct ixgbe_hw *hw);
+#else
+static inline int ixgbe_fwlog_init(struct ixgbe_hw *hw)
+{
+	return -EOPNOTSUPP;
+}
+static inline void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) {}
+#endif /* CONFIG_DEBUG_FS */
 
 #endif /* _IXGBE_E610_H_ */
#2 lore raw
Quoted 6 lines · Jacob Keller
Quoted 3 lines · Michal Swiatkowski

Building the ixgbe without CONFIG_DEBUG_FS leads to a build error. Fix that by guarding fwlog code.

Quoted 8 lines
Quoted 5 lines

---

Hm. It probably is best to make this optional and not require debugfs via kconfig.

Make sense

Quoted 19 lines
Quoted 19 lines
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 8 ++++++++
 2 files changed, 10 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
index c2f8189a0738..c5d76222df18 100644
@@ -3921,6 +3921,7 @@ static int ixgbe_read_pba_string_e610(struct ixgbe_hw *hw, u8 *pba_num,
 	return err;
 }
 
+#ifdef CONFIG_DEBUG_FS
 static int __fwlog_send_cmd(void *priv, struct libie_aq_desc *desc, void *buf,
 			    u16 size)
 {
@@ -3952,6 +3953,7 @@ void ixgbe_fwlog_deinit(struct ixgbe_hw *hw)
 
Quoted 7 lines

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) · line 3957

Quoted 4 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
 	libie_fwlog_deinit(&hw->fwlog);
 }
+#endif /* CONFIG_DEBUG_FS */
 

What does the fwlog module from libie do? Seems likely that it won't compile without CONFIG_DEBUG_FS either...

Right, it shouldn't, because there is a dependency on fs/debugfs. It is building on my env, but maybe I don't have it fully cleaned. I wonder, because in ice there wasn't a check (or select) for CONFIG_DEBUG_FS for fwlog code.

Looks like LIBIE_FWLOG should select DEBUG_FS, right? I will send v2 with that, if it is fine.

Thanks

Quoted 24 lines
Quoted 23 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +0 -0
 static const struct ixgbe_mac_operations mac_ops_e610 = {
 	.init_hw			= ixgbe_init_hw_generic,
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h +8 -0
index 11916b979d28..5317798b3263 100644
@@ -96,7 +96,15 @@ int ixgbe_aci_update_nvm(struct ixgbe_hw *hw, u16 module_typeid,
 			 bool last_command, u8 command_flags);
 int ixgbe_nvm_write_activate(struct ixgbe_hw *hw, u16 cmd_flags,
 			     u8 *response_flags);
+#ifdef CONFIG_DEBUG_FS
 int ixgbe_fwlog_init(struct ixgbe_hw *hw);
 void ixgbe_fwlog_deinit(struct ixgbe_hw *hw);
+#else
+static inline int ixgbe_fwlog_init(struct ixgbe_hw *hw)
+{
+	return -EOPNOTSUPP;
+}
+static inline void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) {}
+#endif /* CONFIG_DEBUG_FS */
 
 #endif /* _IXGBE_E610_H_ */
#3 lore raw
Quoted 50 lines · Michal Swiatkowski
Quoted 6 lines · Jacob Keller
Quoted 3 lines · Michal Swiatkowski

Building the ixgbe without CONFIG_DEBUG_FS leads to a build error. Fix that by guarding fwlog code.

Quoted 8 lines
Quoted 5 lines

---

Hm. It probably is best to make this optional and not require debugfs via kconfig.

Make sense

Quoted 19 lines
Quoted 19 lines
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 8 ++++++++
 2 files changed, 10 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
index c2f8189a0738..c5d76222df18 100644
@@ -3921,6 +3921,7 @@ static int ixgbe_read_pba_string_e610(struct ixgbe_hw *hw, u8 *pba_num,
 	return err;
 }
 
+#ifdef CONFIG_DEBUG_FS
 static int __fwlog_send_cmd(void *priv, struct libie_aq_desc *desc, void *buf,
 			    u16 size)
 {
@@ -3952,6 +3953,7 @@ void ixgbe_fwlog_deinit(struct ixgbe_hw *hw)
 
Quoted 7 lines

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) · line 3957

Quoted 4 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
 	libie_fwlog_deinit(&hw->fwlog);
 }
+#endif /* CONFIG_DEBUG_FS */
 

What does the fwlog module from libie do? Seems likely that it won't compile without CONFIG_DEBUG_FS either...

Right, it shouldn't, because there is a dependency on fs/debugfs. It is building on my env, but maybe I don't have it fully cleaned. I wonder, because in ice there wasn't a check (or select) for CONFIG_DEBUG_FS for fwlog code.

Quoted 5 lines

Looks like LIBIE_FWLOG should select DEBUG_FS, right? I will send v2 with that, if it is fine.

Thanks

My only worry is that could lead to ice selecting LIBIE_FWLOG which then selects DEBUG_FS which then means we implicitly require DEBUG_FS regardless.

I don't quite remember the semantics of select and whether that would let you build a kernel without DEBUG_FS.. I think some systems would like to be able to disable DEBUG_FS as a way of limiting scope of available interfaces exposed by the kernel.

Thanks,
Jake

#4 lore raw
Quoted 58 lines · Jacob Keller
Quoted 50 lines · Michal Swiatkowski
Quoted 6 lines · Jacob Keller
Quoted 3 lines · Michal Swiatkowski

Building the ixgbe without CONFIG_DEBUG_FS leads to a build error. Fix that by guarding fwlog code.

Quoted 8 lines
Quoted 5 lines

---

Hm. It probably is best to make this optional and not require debugfs via kconfig.

Make sense

Quoted 19 lines
Quoted 19 lines
  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 ++
  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 8 ++++++++
  2 files changed, 10 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
index c2f8189a0738..c5d76222df18 100644
@@ -3921,6 +3921,7 @@ static int ixgbe_read_pba_string_e610(struct ixgbe_hw *hw, u8 *pba_num,
  	return err;
  }
 
+#ifdef CONFIG_DEBUG_FS
  static int __fwlog_send_cmd(void *priv, struct libie_aq_desc *desc, void *buf,
  			    u16 size)
  {
@@ -3952,6 +3953,7 @@ void ixgbe_fwlog_deinit(struct ixgbe_hw *hw)
 
Quoted 7 lines

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) · line 3957

Quoted 4 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
  	libie_fwlog_deinit(&hw->fwlog);
  }
+#endif /* CONFIG_DEBUG_FS */
 

What does the fwlog module from libie do? Seems likely that it won't compile without CONFIG_DEBUG_FS either...

Right, it shouldn't, because there is a dependency on fs/debugfs. It is building on my env, but maybe I don't have it fully cleaned. I wonder, because in ice there wasn't a check (or select) for CONFIG_DEBUG_FS for fwlog code.

Quoted 5 lines

Looks like LIBIE_FWLOG should select DEBUG_FS, right? I will send v2 with that, if it is fine.

Thanks

Quoted 8 lines

My only worry is that could lead to ice selecting LIBIE_FWLOG which then selects DEBUG_FS which then means we implicitly require DEBUG_FS regardless.

I don't quite remember the semantics of select and whether that would let you build a kernel without DEBUG_FS.. I think some systems would like to be able to disable DEBUG_FS as a way of limiting scope of available interfaces exposed by the kernel.

If fwlog depends on debugfs, why not spell out that dependency and provide dummy functions if it isn't enabled ? The Kconfig entries selecting it could then be changed to
select LIBIE_FWLOG if DEBUG_FS

Guenter

#5 lore raw
Quoted 46 lines · Guenter Roeck
Quoted 45 lines · Jacob Keller
Quoted 42 lines · Michal Swiatkowski
Quoted 6 lines · Jacob Keller
Quoted 3 lines · Michal Swiatkowski

Building the ixgbe without CONFIG_DEBUG_FS leads to a build error. Fix that by guarding fwlog code.

Quoted 8 lines
Quoted 5 lines

---

Hm. It probably is best to make this optional and not require debugfs via kconfig.

Make sense

Quoted 23 lines
Quoted 17 lines
  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 ++
  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 8 ++++++++
  2 files changed, 10 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
index c2f8189a0738..c5d76222df18 100644
@@ -3921,6 +3921,7 @@ static int ixgbe_read_pba_string_e610(struct ixgbe_hw *hw, u8 *pba_num,
  	return err;
  }
+#ifdef CONFIG_DEBUG_FS
  static int __fwlog_send_cmd(void *priv, struct libie_aq_desc *desc, void *buf,
  			    u16 size)
  {

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c void ixgbe_fwlog_deinit(struct ixgbe_hw *hw) · line 3955

Quoted 3 lines
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +1 -0
@@ -3952,6 +3953,7 @@ void ixgbe_fwlog_deinit(struct ixgbe_hw *hw)
  	libie_fwlog_deinit(&hw->fwlog);
  }
+#endif /* CONFIG_DEBUG_FS */

What does the fwlog module from libie do? Seems likely that it won't compile without CONFIG_DEBUG_FS either...

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Right, it shouldn't, because there is a dependency on fs/debugfs. It is building on my env, but maybe I don't have it fully cleaned.

BTW, it is building because DEBUG_FS also have dummy functions if not selected.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

I wonder, because in ice there wasn't a check (or select) for CONFIG_DEBUG_FS for fwlog code.

Looks like LIBIE_FWLOG should select DEBUG_FS, right? I will send v2 with that, if it is fine.

Thanks

Quoted 8 lines
Quoted 8 lines

My only worry is that could lead to ice selecting LIBIE_FWLOG which then selects DEBUG_FS which then means we implicitly require DEBUG_FS regardless.

I don't quite remember the semantics of select and whether that would let you build a kernel without DEBUG_FS.. I think some systems would like to be able to disable DEBUG_FS as a way of limiting scope of available interfaces exposed by the kernel.

Yeah, the idea with dummy functions is better, thanks for your input.

Quoted 6 lines

If fwlog depends on debugfs, why not spell out that dependency and provide dummy functions if it isn't enabled ? The Kconfig entries selecting it could then be changed to
select LIBIE_FWLOG if DEBUG_FS

Sounds good, thanks.

Quoted 2 lines

Guenter