-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [linux 6.18-y] [Wangxun]deepin: net: txgbe: fix CONFIG_DCB=N compile error #1405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
wangxun inclusion category: bugfix fix set CONFIG_DCB=N, related txgbe dcb module compile error. Signed-off-by: Duanqiang Wen <[email protected]>
Reviewer's GuideMakes the txgbe driver build and runtime behavior correctly conditional on CONFIG_DCB, FCoE, sysfs, and debugfs so that the driver compiles and runs correctly when DCB is disabled, while relocating DCB-specific helpers into the DCB module and tightening the Makefile object selection. Class diagram for DCB and FCoE related txgbe components after fixesclassDiagram
class txgbe_adapter {
}
class txgbe_main_c {
+void txgbe_configure(txgbe_adapter adapter)
+void txgbe_setup_tc(net_device dev, u8 tc)
+void txgbe_update_default_up(txgbe_adapter adapter)
+void txgbe_configure_dcb(txgbe_adapter adapter)
}
class txgbe_lib_c {
+void txgbe_cache_ring_register(txgbe_adapter adapter)
+bool txgbe_cache_ring_dcb_vmdq(txgbe_adapter adapter)
+bool txgbe_cache_ring_dcb(txgbe_adapter adapter)
+bool txgbe_set_dcb_vmdq_queues(txgbe_adapter adapter)
+bool txgbe_set_dcb_queues(txgbe_adapter adapter)
+void txgbe_set_num_queues(txgbe_adapter adapter)
}
class txgbe_dcb_c {
+s32 txgbe_dcb_config_pfc(txgbe_hw hw, u8 pfc_en, u8 map)
+s32 txgbe_dcb_hw_config(txgbe_hw hw, u16 refill, u16 max, u8 bwg_id, u8 tsa, u8 map)
+s32 txgbe_dcb_hw_ets(txgbe_hw hw, ieee_ets ets, int max_frame)
}
class txgbe_dcb_h {
+s32 txgbe_dcb_config_pfc(txgbe_hw hw, u8 pfc_en, u8 map)
+s32 txgbe_dcb_hw_config(txgbe_hw hw, u16 refill, u16 max, u8 bwg_id, u8 tsa, u8 map)
+s32 txgbe_dcb_hw_ets(txgbe_hw hw, ieee_ets ets, int max_frame)
}
class txgbe_fcoe_c {
+int txgbe_fcoe_enable(net_device netdev)
+int txgbe_fcoe_disable(net_device netdev)
+int txgbe_fcoe_ddp_tx(txgbe_adapter adapter)
+u8 txgbe_fcoe_getapp(net_device netdev)
+u8 txgbe_fcoe_get_tc(txgbe_adapter adapter)
+int txgbe_fcoe_get_wwn(net_device netdev, u64 wwn, int type)
}
class txgbe_h {
+extern dcbnl_rtnl_ops dcbnl_ops
+int txgbe_copy_dcb_cfg(txgbe_adapter adapter, int tc_max)
+u8 txgbe_dcb_txq_to_tc(txgbe_adapter adapter, u8 index)
+void txgbe_sysfs_exit(txgbe_adapter adapter)
+int txgbe_sysfs_init(txgbe_adapter adapter)
}
txgbe_main_c --> txgbe_adapter
txgbe_lib_c --> txgbe_adapter
txgbe_dcb_c --> txgbe_adapter
txgbe_fcoe_c --> txgbe_adapter
txgbe_dcb_c ..> txgbe_dcb_h : implements
txgbe_main_c ..> txgbe_h : uses
txgbe_lib_c ..> txgbe_h : uses
txgbe_fcoe_c ..> txgbe_h : uses
note for txgbe_main_c "txgbe_configure_dcb, txgbe_update_default_up and DCB parts of txgbe_setup_tc are compiled only when CONFIG_DCB is enabled"
note for txgbe_lib_c "DCB queue and ring helpers are compiled only when CONFIG_DCB is enabled; otherwise txgbe_cache_ring_register and txgbe_set_num_queues fall back to non DCB paths"
note for txgbe_dcb_c "txgbe_dcb_hw_ets was moved here from txgbe_main.c and is always built only when CONFIG_DCB selects this object"
note for txgbe_fcoe_c "txgbe_fcoe_get_tc returns a DCB based traffic class when CONFIG_DCB is enabled, or 0 when DCB is disabled"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @melooop. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: opsiff The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes compilation errors that occur when CONFIG_DCB is disabled in the txgbe network driver. The changes properly guard DCB-specific code with CONFIG_DCB conditionals and relocate the txgbe_dcb_hw_ets function from the main module to the DCB module where it belongs.
Key changes:
- Move
txgbe_dcb_hw_etsfunction from txgbe_main.c to txgbe_dcb.c and update header declarations - Add CONFIG_DCB guards around DCB-dependent code in main, lib, and FCoE modules
- Update Makefile to conditionally compile DCB, FCoE, sysfs, and debugfs modules based on their respective config options
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | Removed txgbe_dcb_hw_ets function and wrapped DCB-specific functions with CONFIG_DCB guards |
| drivers/net/ethernet/wangxun/txgbe/txgbe_lib.c | Added CONFIG_DCB guards around DCB queue configuration functions |
| drivers/net/ethernet/wangxun/txgbe/txgbe_fcoe.c | Added CONFIG_DCB guard for netdev_get_prio_tc_map call in txgbe_fcoe_get_tc |
| drivers/net/ethernet/wangxun/txgbe/txgbe_dcb.h | Added function declaration for txgbe_dcb_hw_ets and linux/dcbnl.h include |
| drivers/net/ethernet/wangxun/txgbe/txgbe_dcb.c | Added txgbe_dcb_hw_ets function implementation (moved from main.c) |
| drivers/net/ethernet/wangxun/txgbe/txgbe.h | Removed duplicate function declaration, fixed CONFIG_FCOE guard (was incorrectly CONFIG_DCB), and added guard for dcbnl_ops |
| drivers/net/ethernet/wangxun/txgbe/Makefile | Changed to conditional compilation for DCB, FCoE, sysfs, and debugfs modules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #endif /* CONFIG_DCB */ | ||
| int txgbe_copy_dcb_cfg(struct txgbe_adapter *adapter, int tc_max); | ||
|
|
||
| u8 txgbe_dcb_txq_to_tc(struct txgbe_adapter *adapter, u8 index); |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions txgbe_copy_dcb_cfg and txgbe_dcb_txq_to_tc at lines 1047 and 1049 are DCB-related but are not protected by CONFIG_DCB guards. These declarations should be wrapped with #if IS_ENABLED(CONFIG_DCB) to prevent compilation errors when CONFIG_DCB is disabled, as their implementations are likely in DCB-specific source files.
| #endif /* CONFIG_DCB */ | |
| int txgbe_copy_dcb_cfg(struct txgbe_adapter *adapter, int tc_max); | |
| u8 txgbe_dcb_txq_to_tc(struct txgbe_adapter *adapter, u8 index); | |
| int txgbe_copy_dcb_cfg(struct txgbe_adapter *adapter, int tc_max); | |
| u8 txgbe_dcb_txq_to_tc(struct txgbe_adapter *adapter, u8 index); | |
| #endif /* CONFIG_DCB */ |
| $(MAKE) -C $(KERNELDIR) M=$(PWD) clean | ||
| rm -rf *.${MANSECTION}.gz *.ko | ||
| txgbe-$(CONFIG_DCB) += txgbe_dcb_nl.o txgbe_dcb.o | ||
| txgbe-$(CONFIG_FCOE:m=y) += txgbe_fcoe.o |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax for conditional object compilation in Makefiles should use the CONFIG variable directly without the :m=y suffix. The correct syntax for CONFIG_FCOE should be:
txgbe-$(CONFIG_FCOE) += txgbe_fcoe.o
The :m=y suffix is not standard kbuild syntax and may cause build issues.
| txgbe-$(CONFIG_FCOE:m=y) += txgbe_fcoe.o | |
| txgbe-$(CONFIG_FCOE) += txgbe_fcoe.o |
| txgbe-$(CONFIG_SYSFS) += txgbe_sysfs.o | ||
| txgbe-$(CONFIG_DEBUG_FS) += txgbe_debugfs.o |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The txgbe_sysfs.o object is already included in the main txgbe-objs list at line 21, and now it's being conditionally added again at line 31. This will cause duplicate object files in the build when CONFIG_SYSFS is enabled. Remove either the unconditional inclusion at line 21 or the conditional inclusion at line 31.
| txgbe-$(CONFIG_SYSFS) += txgbe_sysfs.o | |
| txgbe-$(CONFIG_DEBUG_FS) += txgbe_debugfs.o | |
| txgbe-$(CONFIG_DEBUG_FS) += txgbe_debugfs.o |
| txgbe-$(CONFIG_DCB) += txgbe_dcb_nl.o txgbe_dcb.o | ||
| txgbe-$(CONFIG_FCOE:m=y) += txgbe_fcoe.o | ||
| txgbe-$(CONFIG_SYSFS) += txgbe_sysfs.o | ||
| txgbe-$(CONFIG_DEBUG_FS) += txgbe_debugfs.o |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The txgbe_debugfs.o object is already included in the main txgbe-objs list at line 14, and now it's being conditionally added again at line 32. This will cause duplicate object files in the build when CONFIG_DEBUG_FS is enabled. Remove either the unconditional inclusion at line 14 or the conditional inclusion at line 32.
wangxun inclusion
category: bugfix
fix set CONFIG_DCB=N, related txgbe dcb module compile error.
Summary by Sourcery
Fix txgbe driver build and runtime behavior when optional features like DCB and FCoE are disabled by tightening configuration guards and modularizing feature-specific code.
Bug Fixes:
Enhancements: