Skip to content

netif: fix empty bond offload features #1023

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

Merged
merged 1 commit into from
Apr 29, 2025
Merged

Conversation

lxchx
Copy link
Contributor

@lxchx lxchx commented Mar 11, 2025

In DPDK, the bonding device's offload_capa is derived from the intersection of its slaves'. If no slaves are added, offload_capa defaults to 0. To utilize the offload features of slaves, slaves must beadded before configuring the bonding device.

This patch adjusts the sequence of add_bond_slaves and rte_eth_dev_configure calls, enabling the bonding device to correctly leverage slave offload capabilities and enhancing forwarding efficiency.

In DPDK, the bonding device's offload_capa is derived from
the intersection of its slaves'. If no slaves are added, offload_capa
defaults to 0. To utilize the offload features of slaves, slaves must
beadded before configuring the bonding device.

This patch adjusts the sequence of add_bond_slaves and
rte_eth_dev_configure calls, enabling the bonding device to correctly
leverage slave offload capabilities and enhancing forwarding efficiency.
@lxchx lxchx changed the base branch from master to devel March 18, 2025 09:08
@ywc689 ywc689 added the pr/to-review-codes review codes line by line and check if problem exists. label Mar 23, 2025
@ywc689 ywc689 requested a review from Copilot April 28, 2025 01:32
Copy link

@Copilot Copilot AI left a 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 the issue where bonding devices with no slaves lead to offload features being disabled by reordering the call to add slaves before configuring the device. Key changes include:

  • Insertion of a call to setup_dev_of_flags in add_bond_slaves.
  • Moving the add_bond_slaves call in netif_port_start to precede device configuration.
  • Removal of the duplicate add_bond_slaves call later in netif_port_start.
Comments suppressed due to low confidence (2)

src/netif.c:3943

  • Since setup_dev_of_flags is now called immediately after updating dev_info, consider verifying that the dev_info update was successful to ensure the offload flags are applied to valid device information.
setup_dev_of_flags(port);

src/netif.c:3980

  • The reordering of the add_bond_slaves call in netif_port_start effectively avoids duplicate invocations; please double-check that all bonding-specific configurations now only occur before the device configuration to prevent any unintended side-effects.
if (port->type == PORT_TYPE_BOND_MASTER) {

@ywc689 ywc689 added pr/codes-reviewed-ok code review passed and no problem found pr/accepted the pr passed all review stages and await to be merged and removed pr/to-review-codes review codes line by line and check if problem exists. labels Apr 29, 2025
@ywc689 ywc689 merged commit 3752be8 into iqiyi:devel Apr 29, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/accepted the pr passed all review stages and await to be merged pr/codes-reviewed-ok code review passed and no problem found
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants