Skip to content

Commit bf14c33

Browse files
committed
bonding: add ESP offload features when slaves support
jira LE-2974 Rebuild_History Non-Buildable kernel-5.14.0-503.40.1.el9_5 commit-author Jianbo Liu <jianbol@nvidia.com> commit 4861333 Add NETIF_F_GSO_ESP bit to bond's gso_partial_features if all slaves support it, such that ESP segmentation is handled by hardware if possible. Signed-off-by: Jianbo Liu <jianbol@nvidia.com> Reviewed-by: Boris Pismenny <borisp@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20241105192721.584822-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 4861333) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 7f13752 commit bf14c33

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,7 @@ static void bond_compute_features(struct bonding *bond)
14371437
{
14381438
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
14391439
IFF_XMIT_DST_RELEASE_PERM;
1440+
netdev_features_t gso_partial_features = NETIF_F_GSO_ESP;
14401441
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
14411442
netdev_features_t enc_features = BOND_ENC_FEATURES;
14421443
#ifdef CONFIG_XFRM_OFFLOAD
@@ -1469,6 +1470,9 @@ static void bond_compute_features(struct bonding *bond)
14691470
BOND_XFRM_FEATURES);
14701471
#endif /* CONFIG_XFRM_OFFLOAD */
14711472

1473+
if (slave->dev->hw_enc_features & NETIF_F_GSO_PARTIAL)
1474+
gso_partial_features &= slave->dev->gso_partial_features;
1475+
14721476
mpls_features = netdev_increment_features(mpls_features,
14731477
slave->dev->mpls_features,
14741478
BOND_MPLS_FEATURES);
@@ -1482,6 +1486,11 @@ static void bond_compute_features(struct bonding *bond)
14821486
}
14831487
bond_dev->hard_header_len = max_hard_header_len;
14841488

1489+
if (gso_partial_features & NETIF_F_GSO_ESP)
1490+
bond_dev->gso_partial_features |= NETIF_F_GSO_ESP;
1491+
else
1492+
bond_dev->gso_partial_features &= ~NETIF_F_GSO_ESP;
1493+
14851494
done:
14861495
bond_dev->vlan_features = vlan_features;
14871496
bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |

0 commit comments

Comments
 (0)