Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755145AbbKCPkE (ORCPT ); Tue, 3 Nov 2015 10:40:04 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38430 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbbKCPj1 (ORCPT ); Tue, 3 Nov 2015 10:39:27 -0500 Subject: Re: [PATCH net-next] net/core: fix for_each_netdev_feature To: Jarod Wilson , linux-kernel@vger.kernel.org References: <1446519359-21400-1-git-send-email-jarod@redhat.com> <1446563759-17713-1-git-send-email-jarod@redhat.com> Cc: "David S. Miller" , Eric Dumazet , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , Jiri Pirko , Nikolay Aleksandrov , Michal Kubecek , Alexander Duyck , Geert Uytterhoeven , netdev@vger.kernel.org From: Nikolay Aleksandrov Message-ID: <5638D3D2.5080703@cumulusnetworks.com> Date: Tue, 3 Nov 2015 16:33:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1446563759-17713-1-git-send-email-jarod@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2392 Lines: 53 On 11/03/2015 04:15 PM, Jarod Wilson wrote: > As pointed out by Nikolay and further explained by Geert, the initial > for_each_netdev_feature macro was broken, as feature would get set outside > of the block of code it was intended to run in, thus only ever working for > the first feature bit in the mask. While less pretty this way, this is > tested and confirmed functional with multiple feature bits set in > NETIF_F_UPPER_DISABLES. > > [root@dell-per730-01 ~]# ethtool -K bond0 lro off > ... > [ 242.761394] bond0: Disabling feature 0x0000000000008000 on lower dev p5p2. > [ 243.552178] bnx2x 0000:06:00.1 p5p2: using MSI-X IRQs: sp 74 fp[0] 76 ... fp[7] 83 > [ 244.353978] bond0: Disabling feature 0x0000000000008000 on lower dev p5p1. > [ 245.147420] bnx2x 0000:06:00.0 p5p1: using MSI-X IRQs: sp 62 fp[0] 64 ... fp[7] 71 > > [root@dell-per730-01 ~]# ethtool -K bond0 gro off > ... > [ 251.925645] bond0: Disabling feature 0x0000000000004000 on lower dev p5p2. > [ 252.713693] bnx2x 0000:06:00.1 p5p2: using MSI-X IRQs: sp 74 fp[0] 76 ... fp[7] 83 > [ 253.499085] bond0: Disabling feature 0x0000000000004000 on lower dev p5p1. > [ 254.290922] bnx2x 0000:06:00.0 p5p1: using MSI-X IRQs: sp 62 fp[0] 64 ... fp[7] 71 > > Fixes: fd867d51f ("net/core: generic support for disabling netdev features down stack") > CC: "David S. Miller" > CC: Eric Dumazet > CC: Jay Vosburgh > CC: Veaceslav Falico > CC: Andy Gospodarek > CC: Jiri Pirko > CC: Nikolay Aleksandrov > CC: Michal Kubecek > CC: Alexander Duyck > CC: Geert Uytterhoeven > CC: netdev@vger.kernel.org > Signed-off-by: Jarod Wilson > --- > include/linux/netdev_features.h | 6 ++---- > net/core/dev.c | 8 ++++++-- > 2 files changed, 8 insertions(+), 6 deletions(-) > Looks good to me especially without the hidden side-effects, Acked-by: Nikolay Aleksandrov Thanks, Nik -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/