From patchwork Mon Nov 23 14:12:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 11925347 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0C5AC2D0E4 for ; Mon, 23 Nov 2020 14:13:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E3902075A for ; Mon, 23 Nov 2020 14:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388547AbgKWONd (ORCPT ); Mon, 23 Nov 2020 09:13:33 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:42982 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731325AbgKWONd (ORCPT ); Mon, 23 Nov 2020 09:13:33 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from tariqt@nvidia.com) with SMTP; 23 Nov 2020 16:13:27 +0200 Received: from dev-l-vrt-206-005.mtl.labs.mlnx (dev-l-vrt-206-005.mtl.labs.mlnx [10.234.206.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0ANEDRjA032315; Mon, 23 Nov 2020 16:13:27 +0200 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Eric Dumazet , Herbert Xu Cc: netdev@vger.kernel.org, Moshe Shemesh , Tariq Toukan , Maxim Mikityanskiy , Saeed Mahameed , Tariq Toukan Subject: [PATCH net] netdevice.h: Fix unintentional disable of ALL_FOR_ALL features on upper device Date: Mon, 23 Nov 2020 16:12:56 +0200 Message-Id: <20201123141256.14208-1-tariqt@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Calling netdev_increment_features() on upper/master device from netdev_add_tso_features() implies unintentional clearance of ALL_FOR_ALL features supported by all slaves. Fix it by passing ALL_FOR_ALL in addition to ALL_TSO. Fixes: b0ce3508b25e ("bonding: allow TSO being set on bonding master") Signed-off-by: Tariq Toukan --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Hi, I know that netdev_increment_features() does not set any feature that's unmasked in the mask argument. I wonder why it can clear them though, was it meant to be like this? If not, then the proper fix should be in netdev_increment_features(), not in netdev_add_tso_features(). diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 18dec08439f9..a9d5e4bb829b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4748,7 +4748,7 @@ netdev_features_t netdev_increment_features(netdev_features_t all, static inline netdev_features_t netdev_add_tso_features(netdev_features_t features, netdev_features_t mask) { - return netdev_increment_features(features, NETIF_F_ALL_TSO, mask); + return netdev_increment_features(features, NETIF_F_ALL_TSO | NETIF_F_ALL_FOR_ALL, mask); } int __netdev_update_features(struct net_device *dev);