From mboxrd@z Thu Jan 1 00:00:00 1970 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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 D6F6CC10F00 for ; Sat, 16 Feb 2019 04:24:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A22A021929 for ; Sat, 16 Feb 2019 04:24:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394469AbfBPEYz (ORCPT ); Fri, 15 Feb 2019 23:24:55 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:49450 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726052AbfBPEYz (ORCPT ); Fri, 15 Feb 2019 23:24:55 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 7420F14F19FAE; Fri, 15 Feb 2019 20:24:54 -0800 (PST) Date: Fri, 15 Feb 2019 20:24:53 -0800 (PST) Message-Id: <20190215.202453.382883236911745765.davem@davemloft.net> To: hauke.mehrtens@intel.com Cc: netdev@vger.kernel.org, jarod@redhat.com, hauke@hauke-m.de, stable@vger.kernel.org Subject: Re: [PATCH] net: Fix for_each_netdev_feature on Big endian From: David Miller In-Reply-To: <20190215165854.25842-1-hauke.mehrtens@intel.com> References: <20190215165854.25842-1-hauke.mehrtens@intel.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 15 Feb 2019 20:24:54 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Hauke Mehrtens Date: Fri, 15 Feb 2019 17:58:54 +0100 > The features attribute is of type u64 and stored in the native endianes on > the system. The for_each_set_bit() macro takes a pointer to a 32 bit array > and goes over the bits in this area. On little Endian systems this also > works with an u64 as the most significant bit is on the highest address, > but on big endian the words are swapped. When we expect bit 15 here we get > bit 47 (15 + 32). > > This patch converts it more or less to its own for_each_set_bit() > implementation which works on 64 bit integers directly. This is then > completely in host endianness and should work like expected. > > Fixes: fd867d51f ("net/core: generic support for disabling netdev features down stack") > Cc: stable@vger.kernel.org > Signed-off-by: Hauke Mehrtens Applied and queued up for -stable. Please do not CC: stable for networking fixes, I handle -stable submissions myself manually and this is documented in the netdev FAQ.