]> git.ipfire.org Git - thirdparty/linux.git/commit
team: use common function to compute the features
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 17 Oct 2025 03:41:54 +0000 (03:41 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 22 Oct 2025 01:08:23 +0000 (18:08 -0700)
commit745cd46c2a47144dd656185b9be0a1e5e9b02d2d
tree4910ad55a4d830093d6f4ef5ce7c766067e64d61
parentd4fde269a970666a30dd3abd0413273a06dd972d
team: use common function to compute the features

Use the new helper netdev_compute_master_upper_features() to compute the
team device features. This helper performs both the feature computation
and the netdev_change_features() call.

Note that such change replace the lower layer traversing currently done
using team->port_list with netdev_for_each_lower_dev(). Such change is
safe as `port_list` contains exactly the same elements as
`team->dev->adj_list.lower` and the helper is always invoked under the
RTNL lock.

With this change, the explicit netdev_change_features() in team_add_slave()
can be safely removed, as team_port_add() already takes care of the
notification via netdev_compute_master_upper_features(), and same thing for
team_del_slave()

This also fixes missing computations for MPLS, XFRM, and TSO/GSO partial
features.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20251017034155.61990-4-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/team/team_core.c