ixgbe: guard fwlog code by CONFIG_DEBUG_FS
Subsystems (3)
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
@@ -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
@@ -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
Quoted 8 lines · Michal Swiatkowski
Building the ixgbe without
CONFIG_DEBUG_FSleads to a build error. Fix that by guarding fwlog code.Fixes 641585bc978e ("ixgbe: fwlog support for e610")Reported-by Guenter Roeck <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>---
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@@ -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
-0static const struct ixgbe_mac_operations mac_ops_e610 = { .init_hw = ixgbe_init_hw_generic,drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h +8
-0@@ -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_ */
Quoted 6 lines · Jacob Keller
Quoted 3 lines · Michal Swiatkowski
Building the ixgbe without
CONFIG_DEBUG_FSleads to a build error. Fix that by guarding fwlog code.
Quoted 8 lines
Quoted 5 lines
Fixes 641585bc978e ("ixgbe: fwlog support for e610")Reported-by Guenter Roeck <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>---
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@@ -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
-0libie_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_FSeither...
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
-0static const struct ixgbe_mac_operations mac_ops_e610 = { .init_hw = ixgbe_init_hw_generic,drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h +8
-0@@ -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_ */
Quoted 50 lines · Michal Swiatkowski
Quoted 6 lines · Jacob Keller
Quoted 3 lines · Michal Swiatkowski
Building the ixgbe without
CONFIG_DEBUG_FSleads to a build error. Fix that by guarding fwlog code.Quoted 8 lines
Quoted 5 lines
Fixes 641585bc978e ("ixgbe: fwlog support for e610")Reported-by Guenter Roeck <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>---
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@@ -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
-0libie_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_FSeither...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_FSfor fwlog code.
Quoted 5 lines
Looks like
LIBIE_FWLOGshould selectDEBUG_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
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_FSleads to a build error. Fix that by guarding fwlog code.Quoted 8 lines
Quoted 5 lines
Fixes 641585bc978e ("ixgbe: fwlog support for e610")Reported-by Guenter Roeck <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>---
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@@ -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
-0libie_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_FSeither...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_FSfor fwlog code.Quoted 5 lines
Looks like
LIBIE_FWLOGshould selectDEBUG_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_FWLOGwhich then selectsDEBUG_FSwhich then means we implicitly requireDEBUG_FSregardless.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 disableDEBUG_FSas 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
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_FSleads to a build error. Fix that by guarding fwlog code.Quoted 8 lines
Quoted 5 lines
Fixes 641585bc978e ("ixgbe: fwlog support for e610")Reported-by Guenter Roeck <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>---
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@@ -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_FSeither...
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_FSfor fwlog code.Looks like
LIBIE_FWLOGshould selectDEBUG_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_FWLOGwhich then selectsDEBUG_FSwhich then means we implicitly requireDEBUG_FSregardless.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 disableDEBUG_FSas 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
Kconfigentries selecting it could then be changed to
selectLIBIE_FWLOGifDEBUG_FS
Sounds good, thanks.
Quoted 2 lines
Guenter