Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1202823imm; Wed, 11 Jul 2018 20:02:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcAeu9jIsUFZcGu2QTK+ZuJxB2LJou+r3lP1w+SLV/d8RxxvnZ8nvEUbLcJ1G7lQgXhBijb X-Received: by 2002:a17:902:8604:: with SMTP id f4-v6mr471914plo.4.1531364573894; Wed, 11 Jul 2018 20:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364573; cv=none; d=google.com; s=arc-20160816; b=ifLG43KBexJDi4rvyUUE8Fe9rivZgTYrzFkl37Y3GkmGSYfK0hcd8WzwOBw1yJ5q+n nbQusVW7KozvuleJQ9NuBEDxMSxV99P1Svy2HY5sDLBADCE0PVH79rxhOTqIaU/aIJIu GlyRm0Tp9yjnnUw+Pq9lXYFuSeidNg0nEVdkdsfdWPAKZvUlage2Yyq1fo8kSRXSDQ63 hpo9t4jKnUZuGCEaDuQ2oeB3rmCka5xi8OqGzMvTygYhIO0anDOc6ymz03MYDfSU+LiI NizlnNWzIZDW5/HXctK2HJyHCti3Je6xGWpS+I6F4CG57OEE4RsxL83fIW5Y0VpvRqT6 G4Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=PQmmIXeikiLeWXLNbid3b6LCP3b/f+bWVcgTtnacxbI=; b=G9rMahA4S0AsNXs60aYOYwOCI/5vvdmxdvN8m+YOmhzAVdn2Ryf6/dH8HfLdqN+A9e wVL5JsGxWRsuNPuVIqLrKxILATqWi1XDU3BQgTLwf3IUjIMuQW1E1vsizwb6BMW6OpI6 tXggeR1uVpAbcmsQV9yCJThE7RXpPfZRBxmqhaRlzYgsRnUY1iC+4Ug2muuFdYeqKgMF BOsHp6LAFRpMRwo0FCgO8UJFEPU6EI1i8bZ2kpZFfm9RjnX7229VtWK6vw1lDcVh1IFU UI+fJLGHeuup8dOWdcXnVHUP/PD2VH6ZKAYeH4GY8bRgARF6o55yLlilPN75DeEihfFM LQjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13-v6si20160964plp.51.2018.07.11.20.02.38; Wed, 11 Jul 2018 20:02:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389561AbeGKWTM (ORCPT + 99 others); Wed, 11 Jul 2018 18:19:12 -0400 Received: from www62.your-server.de ([213.133.104.62]:47456 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732561AbeGKWTM (ORCPT ); Wed, 11 Jul 2018 18:19:12 -0400 Received: from [78.46.172.2] (helo=sslproxy05.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1fdNLk-00062P-5u; Thu, 12 Jul 2018 00:12:40 +0200 Received: from [62.203.87.61] (helo=linux.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1fdNLk-000Xv3-1l; Thu, 12 Jul 2018 00:12:40 +0200 Subject: Re: [PATCH bpf v2 1/1] bpf: btf: Fix bitfield extraction for big endian To: Martin KaFai Lau , Okash Khawaja Cc: Alexei Starovoitov , Yonghong Song , Jakub Kicinski , "David S. Miller" , netdev@vger.kernel.org, kernel-team@fb.com, linux-kernel@vger.kernel.org References: <20180710213306.646146378@fb.com> <20180710214522.339195416@fb.com> <20180710234528.2kj2kv7gjmigvvgp@kafai-mbp.dhcp.thefacebook.com> From: Daniel Borkmann Message-ID: Date: Thu, 12 Jul 2018 00:12:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180710234528.2kj2kv7gjmigvvgp@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.0/24744/Wed Jul 11 22:56:24 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2018 01:46 AM, Martin KaFai Lau wrote: > On Tue, Jul 10, 2018 at 02:33:07PM -0700, Okash Khawaja wrote: >> When extracting bitfield from a number, btf_int_bits_seq_show() builds >> a mask and accesses least significant byte of the number in a way >> specific to little-endian. This patch fixes that by checking endianness >> of the machine and then shifting left and right the unneeded bits. >> >> Thanks to Martin Lau for the help in navigating potential pitfalls when >> dealing with endianess and for the final solution. >> >> Fixes: b00b8daec828 ("bpf: btf: Add pretty print capability for data with BTF type info") >> Signed-off-by: Okash Khawaja > Acked-by: Martin KaFai Lau Applied to bpf, thanks Okash!