From patchwork Tue Dec 10 14:12:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 13901468 X-Patchwork-Delegate: kuba@kernel.org Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 913801AAA1F; Tue, 10 Dec 2024 14:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.133.104.62 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839980; cv=none; b=iYQXXvlBGn3Cyzoo5fIMDzn2aTuMwM/TsN7bXecRIMvRMi3BKWssLMWS2ubVHN5DqltYhYNlpB5y4+7/8I+2AyCK6AtwFHMUJlFLWpcqC64mwuw0i49IQxAqCwb7JmnKfk+B2HgG15ivTPLF00iaCKjp9Py2Uw3D1LmmcqQffw8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839980; c=relaxed/simple; bh=SM2IrEFYDHRCO0M5Uj3aTtBdScOXylhhut0GfOBIwsY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SFESZ6L92nShSGQVH81cxzmienIfta6L6sJRaIxaerGXMn9J8mFEV2kczWaJzmedmiaEHAtrgd0+5B4xackAimAr+AtMHGZK9N+XESEOsHYb87Mp8OFip4BtWA7PPphj5C/pt4/+7fFpBwqukm+W4s9FFmCFfhgHhfC60EKiFLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net; spf=pass smtp.mailfrom=iogearbox.net; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b=ZQTz5EYi; arc=none smtp.client-ip=213.133.104.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b="ZQTz5EYi" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=iogearbox.net; s=default2302; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=mgCMs5KHNqA2IaprbLh7578kvE0JKS2ne9H+fT97Y8w=; b=ZQTz5EYi0q4COyLPi2vyeGGdvR YKvDGfgBEAtvA1ZQlWiu/MRc5VGsGk2W0HcYKuaanp2pM8+4MxVhIqX/iReyuEs9r9DzOk3UmeDxi IJsy75RKmO8hcboOV7mGN5oGfrnqCiEQkwmXaTvwhxG3VD/BQncKx3IhW2UfOoLtTgL9ZL0U+FlFP 4Eau8Wp3i8CGLRkxjAxr2i5sgDRsC6Y3fHl4ZeSUVJ7Ymp15M5CDSCOdFTnI1lYy5TnVpcgjrYHGS YKx07mTdFteZp5SKmvPQZf8hsOF31jv501YFPOde12qEzDGkSkE+8XP6ojZwWaU/ncSYz3exzlQQv 72S9dvaw==; Received: from 35.248.197.178.dynamic.cust.swisscom.net ([178.197.248.35] helo=localhost) by www62.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tL0yk-000Jg5-5b; Tue, 10 Dec 2024 15:12:46 +0100 From: Daniel Borkmann To: netdev@vger.kernel.org Cc: bpf@vger.kernel.org, mkubecek@suse.cz, Nikolay Aleksandrov , Ido Schimmel , Jiri Pirko Subject: [PATCH net 1/5] net, team, bonding: Add netdev_base_features helper Date: Tue, 10 Dec 2024 15:12:41 +0100 Message-ID: <20241210141245.327886-1-daniel@iogearbox.net> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 1.0.7/27483/Tue Dec 10 10:38:50 2024) X-Patchwork-Delegate: kuba@kernel.org Both bonding and team driver have logic to derive the base feature flags before iterating over their slave devices to refine the set via netdev_increment_features(). Add a small helper netdev_base_features() so this can be reused instead of having it open-coded multiple times. Signed-off-by: Daniel Borkmann Cc: Nikolay Aleksandrov Cc: Ido Schimmel Cc: Jiri Pirko Reviewed-by: Hangbin Liu Reviewed-by: Nikolay Aleksandrov --- drivers/net/bonding/bond_main.c | 4 +--- drivers/net/team/team_core.c | 3 +-- include/linux/netdev_features.h | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 49dd4fe195e5..42c835c60cd8 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1520,9 +1520,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev, struct slave *slave; mask = features; - - features &= ~NETIF_F_ONE_FOR_ALL; - features |= NETIF_F_ALL_FOR_ALL; + features = netdev_base_features(features); bond_for_each_slave(bond, slave, iter) { features = netdev_increment_features(features, diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c index a1b27b69f010..1df062c67640 100644 --- a/drivers/net/team/team_core.c +++ b/drivers/net/team/team_core.c @@ -2011,8 +2011,7 @@ static netdev_features_t team_fix_features(struct net_device *dev, netdev_features_t mask; mask = features; - features &= ~NETIF_F_ONE_FOR_ALL; - features |= NETIF_F_ALL_FOR_ALL; + features = netdev_base_features(features); rcu_read_lock(); list_for_each_entry_rcu(port, &team->port_list, list) { diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 66e7d26b70a4..11be70a7929f 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -253,4 +253,11 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) NETIF_F_GSO_UDP_TUNNEL | \ NETIF_F_GSO_UDP_TUNNEL_CSUM) +static inline netdev_features_t netdev_base_features(netdev_features_t features) +{ + features &= ~NETIF_F_ONE_FOR_ALL; + features |= NETIF_F_ALL_FOR_ALL; + return features; +} + #endif /* _LINUX_NETDEV_FEATURES_H */ From patchwork Tue Dec 10 14:12:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 13901471 X-Patchwork-Delegate: kuba@kernel.org Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 912DA1AAA15; Tue, 10 Dec 2024 14:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.133.104.62 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839981; cv=none; b=aQ9cpBVWpEU6W4hljVB4CeTpcs0CuxxVcLyDOpx9/GfTlVa1OJ0fxyK09tbbQ6tRKaudA+n7tnXzGy6MH4POftuGXyAab+trgsiGEkHT4rT4MbdIpTdzdk/Wb2pVemPrW16PFZ+4x15e7csoky8nQqhw79O04Ht5nu0TC4sNdlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839981; c=relaxed/simple; bh=/jRFu/L7c7AGe1yS6dfrf3NctqzbyX3J8DU7XIfSWq0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MTVGKfBfIWEg+T2XQ2yoa6xeaauSn/qYjV37Uc6ii1od//12/i61owsFx8wNGj3SBOA8ctV7cy3ddiDpeWYh/NWze9hlrDnDMQnFR9VV8wnoZETp5fbhNcuuRMrcYUtsQK2Zv0wiIfUBBxlq90ZyGg6iiLFaQsX/ECJ/WGi99Ns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net; spf=pass smtp.mailfrom=iogearbox.net; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b=CoRotnf2; arc=none smtp.client-ip=213.133.104.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b="CoRotnf2" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=iogearbox.net; s=default2302; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=qVM3mlRYhOps9AQNgzS6NlJvaj25o3zlADgsHEc1zBI=; b=CoRotnf2uKs0xSE1//LI25otrL h/uxMbCM9MKGgDMWxA2W/oXBIyUnFS/FcuXALLAVHtyZM2ipA7Z2FmJi3Bp/bHWrll2Fkhrv/jl/V pEbzn9NoTm/BWZLXpjpHEoumAOCZydvL/1WOyxn9hrtYdiOYZ0iKFzfJTsfpwcZCjgtsDNrDLZoyu /SYL9UHuXlM+4fpGtB3kf9AHg0C1ISWck0XZK4FqAZ592a17SFSIcc030rPbYKcKFmusGt9PephCl x1cJ13xcuJt2aNEt/qHD3DagHk2LxijMvRdTQZIAwhaYIjbACArla1XSV2dwQxH6sdW0p+23tNf/+ 5z9qO9Kg==; Received: from 35.248.197.178.dynamic.cust.swisscom.net ([178.197.248.35] helo=localhost) by www62.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tL0yk-000JgG-OI; Tue, 10 Dec 2024 15:12:46 +0100 From: Daniel Borkmann To: netdev@vger.kernel.org Cc: bpf@vger.kernel.org, mkubecek@suse.cz, Nikolay Aleksandrov , Ido Schimmel , Jiri Pirko Subject: [PATCH net 2/5] bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features Date: Tue, 10 Dec 2024 15:12:42 +0100 Message-ID: <20241210141245.327886-2-daniel@iogearbox.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210141245.327886-1-daniel@iogearbox.net> References: <20241210141245.327886-1-daniel@iogearbox.net> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 1.0.7/27483/Tue Dec 10 10:38:50 2024) X-Patchwork-Delegate: kuba@kernel.org If a bonding device has slave devices, then the current logic to derive the feature set for the master bond device is limited in that flags which are fully supported by the underlying slave devices cannot be propagated up to vlan devices which sit on top of bond devices. Instead, these get blindly masked out via current NETIF_F_ALL_FOR_ALL logic. vlan_features and mpls_features should reuse netdev_base_features() in order derive the set in the same way as ndo_fix_features before iterating through the slave devices to refine the feature set. Fixes: a9b3ace44c7d ("bonding: fix vlan_features computing") Fixes: 2e770b507ccd ("net: bonding: Inherit MPLS features from slave devices") Signed-off-by: Daniel Borkmann Cc: Nikolay Aleksandrov Cc: Ido Schimmel Cc: Jiri Pirko Reviewed-by: Nikolay Aleksandrov Reviewed-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 42c835c60cd8..320dd71392ef 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1563,8 +1563,9 @@ static void bond_compute_features(struct bonding *bond) if (!bond_has_slaves(bond)) goto done; - vlan_features &= NETIF_F_ALL_FOR_ALL; - mpls_features &= NETIF_F_ALL_FOR_ALL; + + vlan_features = netdev_base_features(vlan_features); + mpls_features = netdev_base_features(mpls_features); bond_for_each_slave(bond, slave, iter) { vlan_features = netdev_increment_features(vlan_features, From patchwork Tue Dec 10 14:12:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 13901469 X-Patchwork-Delegate: kuba@kernel.org Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 913291AAA16; Tue, 10 Dec 2024 14:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.133.104.62 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839980; cv=none; b=PEjkVgy91hEMn2LR6Pq79TelmyEnlDeDOPWVEqlZQDkJOJBFFyyGOmKmzCt/ezVdBw8RjBkaDLaYgOiT7TDK+ehnOFB2v/fIRaz0g/vQawDxNjbZYXGJK2fCvqdZ3wDi8Ag7qaNoaO/8zCc3cr9Usfb3P5u7IHkaNb7ikbanv3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839980; c=relaxed/simple; bh=Gqy1cO8kzYjNqYASuqlTqRoNVTgBvuWhGXTo7oU4TSI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ig7wVT7g1ctUg7iQh7UpXfoXlrnILvaP/FiUWmBQOva1ErTtIHs9grhn61F0/W8GwWUlUYoDKjvOHQEfD9Hp3aM58fIWBjOgxMN6mKeDzetwblow06zorYk4i/vMHa24uIZbqmZkFV3iNPB2A0nnqj+mOlSdTY+KvgjTP4cZE7Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net; spf=pass smtp.mailfrom=iogearbox.net; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b=ZapmCc7A; arc=none smtp.client-ip=213.133.104.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b="ZapmCc7A" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=iogearbox.net; s=default2302; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=MMgtaFpnKy53Gq3CYekdZmnl9n6mn/hR4Zipw2JM5yc=; b=ZapmCc7AMibXhx97+LYgD9Bb01 POfog218cQoFK/k9+PU+jnSG48ygjuBHvAAHsAPopflBuesmf8gpaUi9EHneaApVmUGOq0gvlIGJJ X7qwLDwM0Y8jKjaQTuJWLiT6vlOgZ81/T+E3qJnvWSW3HisHk9g6rbmqAPFmZrOH5sl94gF5BudFt vwtkeKLug5qYtKcyC/idyslqE9QJ8ucpbkpoyouKc0psq4a/bL5Ew7DV81UV9yYMoAlyTQjr/I4S3 d5BB2KisS4d53c1+aPFViLAwhI/4nnZ9AYPqlbUh1L348VfbKnGHgaxemueFWeVw2/X7Httgdxi4W esU96ssg==; Received: from 35.248.197.178.dynamic.cust.swisscom.net ([178.197.248.35] helo=localhost) by www62.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tL0yl-000JgP-Cy; Tue, 10 Dec 2024 15:12:47 +0100 From: Daniel Borkmann To: netdev@vger.kernel.org Cc: bpf@vger.kernel.org, mkubecek@suse.cz, Nikolay Aleksandrov , Ido Schimmel , Jiri Pirko Subject: [PATCH net 3/5] bonding: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL Date: Tue, 10 Dec 2024 15:12:43 +0100 Message-ID: <20241210141245.327886-3-daniel@iogearbox.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210141245.327886-1-daniel@iogearbox.net> References: <20241210141245.327886-1-daniel@iogearbox.net> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 1.0.7/27483/Tue Dec 10 10:38:50 2024) X-Patchwork-Delegate: kuba@kernel.org Drivers like mlx5 expose NIC's vlan_features such as NETIF_F_GSO_UDP_TUNNEL & NETIF_F_GSO_UDP_TUNNEL_CSUM which are later not propagated when the underlying devices are bonded and a vlan device created on top of the bond. Right now, the more cumbersome workaround for this is to create the vlan on top of the mlx5 and then enslave the vlan devices to a bond. To fix this, add NETIF_F_GSO_ENCAP_ALL to BOND_VLAN_FEATURES such that bond_compute_features() can probe and propagate the vlan_features from the slave devices up to the vlan device. Given the following bond: # ethtool -i enp2s0f{0,1}np{0,1} driver: mlx5_core [...] # ethtool -k enp2s0f0np0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off # ethtool -k enp2s0f1np1 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off # ethtool -k bond0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: off Before: # ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: off [requested on] tx-udp_tnl-csum-segmentation: off [requested on] tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: off After: # ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: off Various users have run into this reporting performance issues when configuring Cilium in vxlan tunneling mode and having the combination of bond & vlan for the core devices connecting the Kubernetes cluster to the outside world. Fixes: a9b3ace44c7d ("bonding: fix vlan_features computing") Signed-off-by: Daniel Borkmann Cc: Nikolay Aleksandrov Cc: Ido Schimmel Cc: Jiri Pirko Reviewed-by: Nikolay Aleksandrov Reviewed-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 320dd71392ef..7b78c2bada81 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1534,6 +1534,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev, #define BOND_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ + NETIF_F_GSO_ENCAP_ALL | \ NETIF_F_HIGHDMA | NETIF_F_LRO) #define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ From patchwork Tue Dec 10 14:12:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 13901470 X-Patchwork-Delegate: kuba@kernel.org Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBFC11AAA2A; Tue, 10 Dec 2024 14:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.133.104.62 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839980; cv=none; b=kKNZZL2b2bryZzw4cFH36H/1rmtz939A5A5yFQOitDJm5QLXZnksYJ1DWcrF2NpBlMAfDi6oI9iLGMrDtqRfiiaaqbAwbCHyqSz5SnTrtIr0GqPuYV9tZCLeUnsGvtLA72psoki6FPDv0o7xLPADKhJE7tUprbT/g9hmWlnzOQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839980; c=relaxed/simple; bh=09qaNpq4AJuz9hfCoEjZOuxko+pXD+YneMHD9E479dA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XsrpcFpFhdhXBtxZuCC90jJrrKOiigboX3S/TMAHET+L7sNXmrPuT1JzlrxQ3X5mcqtYyk/lX6jR+BV/98OIciFJAs3dcMWXr0JAnCM3qCFYGxtq86k44cXUfGBSVMKAfEGX82vc7B1sspFHRjHdMjJv2J1tlarCQ8HZ7m5bW+A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net; spf=pass smtp.mailfrom=iogearbox.net; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b=MhWnoUqI; arc=none smtp.client-ip=213.133.104.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b="MhWnoUqI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=iogearbox.net; s=default2302; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Z6pqZZgfaOadgTc8G5zTaPHQbs4UwLMI64dEKXV+Eyo=; b=MhWnoUqId+xj2Mnt9FvpRsD9BM 9D3e2pCojMQmY2McntNc3taTo29H6KEljPyogEiSZsPdz6mNbuW/kiJKoMbItrGhGU9jyC6gVor5l rUECBPumh+wqXJcX8pP8IOt52f1vtbBVSAg+Qmbubtm6fM+OmEP48RBQq6xG52J/Qf5H/klv+wDJJ XbV1xvQ8H0OHTVT+G6XS0JVu8S87X2NllADV6LahZXVRdxguuhOPeyfvj5KZ3ApZErhY063jHSYvM 879UwNf09PzjP0ic5mfOhqsx35EoVZ/ziX3ci7s4cT1jXsB4ohuZ7MKwfQb+v8Hbe7ElWrUGkIGf2 cFwkMOXQ==; Received: from 35.248.197.178.dynamic.cust.swisscom.net ([178.197.248.35] helo=localhost) by www62.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tL0ym-000JgX-16; Tue, 10 Dec 2024 15:12:48 +0100 From: Daniel Borkmann To: netdev@vger.kernel.org Cc: bpf@vger.kernel.org, mkubecek@suse.cz, Nikolay Aleksandrov , Ido Schimmel , Jiri Pirko Subject: [PATCH net 4/5] team: Fix initial vlan_feature set in __team_compute_features Date: Tue, 10 Dec 2024 15:12:44 +0100 Message-ID: <20241210141245.327886-4-daniel@iogearbox.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210141245.327886-1-daniel@iogearbox.net> References: <20241210141245.327886-1-daniel@iogearbox.net> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 1.0.7/27483/Tue Dec 10 10:38:50 2024) X-Patchwork-Delegate: kuba@kernel.org Similarly as with bonding, fix the calculation of vlan_features to reuse netdev_base_features() in order derive the set in the same way as ndo_fix_features before iterating through the slave devices to refine the feature set. Fixes: 3625920b62c3 ("teaming: fix vlan_features computing") Signed-off-by: Daniel Borkmann Cc: Nikolay Aleksandrov Cc: Ido Schimmel Cc: Jiri Pirko Reviewed-by: Nikolay Aleksandrov Reviewed-by: Hangbin Liu --- drivers/net/team/team_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c index 1df062c67640..306416fc1db0 100644 --- a/drivers/net/team/team_core.c +++ b/drivers/net/team/team_core.c @@ -991,13 +991,14 @@ static void team_port_disable(struct team *team, static void __team_compute_features(struct team *team) { struct team_port *port; - netdev_features_t vlan_features = TEAM_VLAN_FEATURES & - NETIF_F_ALL_FOR_ALL; + netdev_features_t vlan_features = TEAM_VLAN_FEATURES; netdev_features_t enc_features = TEAM_ENC_FEATURES; unsigned short max_hard_header_len = ETH_HLEN; unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM; + vlan_features = netdev_base_features(vlan_features); + rcu_read_lock(); list_for_each_entry_rcu(port, &team->port_list, list) { vlan_features = netdev_increment_features(vlan_features, From patchwork Tue Dec 10 14:12:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 13901472 X-Patchwork-Delegate: kuba@kernel.org Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBF681AAA28; Tue, 10 Dec 2024 14:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.133.104.62 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839982; cv=none; b=KKNBu4kpEkagZvaq6a0xdz8NZSx1K51kFdyKBBZ4jzAqRXmiJ7eQX6VDiF7zMRht6y+R1iEaBeWWkJGkpmMGWfBIuPjnMuPbkEugUSBDjueuiIMt8G4MAkEHEcgPOlAKBRdGDAk7HKSt6LSxiDALZGb9u5IUesTz11c5iISP/NA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733839982; c=relaxed/simple; bh=1EL0iOX9z299d9g1AXg7Po7x/SmaYN3U5tpAeRyXgcA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KCusogbz0+YV726TVySxulfNuwyPlFijP59qDDQNPE3AeGrQxZYfF4eSdv1xhKan91aiZa7QNDPYwVI+5f6yRSn22f+4Eo6BX6hY3XyFy5annHLYBAdejjlG1ZqOcW/yvM+PTzryJSukvN80U1sv1wcW7h3SQeCtXwBBoONuZ8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net; spf=pass smtp.mailfrom=iogearbox.net; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b=GmlNZvty; arc=none smtp.client-ip=213.133.104.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iogearbox.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iogearbox.net header.i=@iogearbox.net header.b="GmlNZvty" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=iogearbox.net; s=default2302; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=w7R2RpmAicgOmiJ/9kqO9DMW80VXog3hrYYgYAvbmzs=; b=GmlNZvtySufPUfIHw6S+moU3L6 vgDir2yglOSCnN3DUM6n6Ro5DrAKzRqY9KUnQrTaw2Oef0egr2WPtP6Bu7SP0OuFVBX6fcONkxNnJ mGRkidLAkSMREjmfUT/IyzTsjztTcVKo1HHegw8UQ3crGEW8NQN38L/6eHom/C6QRk3x5rE0H9DiQ ywR1IlxN7v9+Xj0T2c5I6OpSUCDqJSGRo6tVUGMYRRyyGqt4S1DGxC3S5n2b2ZO6xCXHj6pCYNEYc BZXCvTERgfu3v+ajZJjFkf1qm11dZsxbFXXmMJjGFrG1DHEfrQis6EdhyhknUv0PmFtiyDYo89KKQ E2ytnr3Q==; Received: from 35.248.197.178.dynamic.cust.swisscom.net ([178.197.248.35] helo=localhost) by www62.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tL0ym-000Jgg-KD; Tue, 10 Dec 2024 15:12:48 +0100 From: Daniel Borkmann To: netdev@vger.kernel.org Cc: bpf@vger.kernel.org, mkubecek@suse.cz, Nikolay Aleksandrov , Ido Schimmel , Jiri Pirko Subject: [PATCH net 5/5] team: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL Date: Tue, 10 Dec 2024 15:12:45 +0100 Message-ID: <20241210141245.327886-5-daniel@iogearbox.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210141245.327886-1-daniel@iogearbox.net> References: <20241210141245.327886-1-daniel@iogearbox.net> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 1.0.7/27483/Tue Dec 10 10:38:50 2024) X-Patchwork-Delegate: kuba@kernel.org Similar to bonding driver, add NETIF_F_GSO_ENCAP_ALL to TEAM_VLAN_FEATURES in order to support slave devices which propagate NETIF_F_GSO_UDP_TUNNEL & NETIF_F_GSO_UDP_TUNNEL_CSUM as vlan_features. Fixes: 3625920b62c3 ("teaming: fix vlan_features computing") Signed-off-by: Daniel Borkmann Cc: Nikolay Aleksandrov Cc: Ido Schimmel Cc: Jiri Pirko Reviewed-by: Nikolay Aleksandrov Reviewed-by: Hangbin Liu --- drivers/net/team/team_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c index 306416fc1db0..69ea2c3c76bf 100644 --- a/drivers/net/team/team_core.c +++ b/drivers/net/team/team_core.c @@ -983,7 +983,8 @@ static void team_port_disable(struct team *team, #define TEAM_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_HIGHDMA | NETIF_F_LRO) + NETIF_F_HIGHDMA | NETIF_F_LRO | \ + NETIF_F_GSO_ENCAP_ALL) #define TEAM_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE)