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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no 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 D68EAC5DF63 for ; Wed, 6 Nov 2019 21:58:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1F5D2173E for ; Wed, 6 Nov 2019 21:58:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MJo5Cdjp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbfKFV6h (ORCPT ); Wed, 6 Nov 2019 16:58:37 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36645 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbfKFV6h (ORCPT ); Wed, 6 Nov 2019 16:58:37 -0500 Received: by mail-lj1-f194.google.com with SMTP id k15so15816726lja.3; Wed, 06 Nov 2019 13:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qQDxOhCp7zemAOlkm6SneBgb53l55OqmRCOBdMxvSog=; b=MJo5CdjpdKcuVZqr4ofywByQhyIoO4iOG/aqySxbiVQzzxiP6v7lJJZ0kDm5b/vxvD Ac1AID8VO4WpEdW6mIcLAbU4qADoezrcNFWhhRciVhJrSvuxsW8CUV6D9t8r1ucdsVho vTbOWmR0AoGZ8xq0MAQ0N0zV5nuDC4A1nofzr+HHkuX65p1mXfvPDAoyu1duukP2rDMT f47DojQuewcVJ1UNRKu+XFT0qFl2tgzdSXnuD5Kq/b5OdzsoROw/hvpfuuLbTlIdt9UX NRaghsBB1BT/SJqvU/4zGRFs/kS6TwNyWIr5LZwnbIjda44j+/+pf9YDt+urRYnw8hiS cEgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qQDxOhCp7zemAOlkm6SneBgb53l55OqmRCOBdMxvSog=; b=ZGNxgC4jrM27gmKywWN8RGSeRPtE292y0cIRNvQhcfUDuaxU+mx5wnjjFXxPT1VnaW UfA5hDYe46DD4gxi6FmP9sA2FOE8Z4HOx6w7ENgaHkTHMI8I58ZKfKbGwkAR91771KyU Nl2Y21yA/OdliPyfEA4cHUFnM5i35fZFPgUP8jAFWHbKG2P6JfIZdIIOV7UOC1vFC6Ix 1X+iG2YcTVD7P9VIpfuNUhwkNv3793+mxrRWuejZQ6dd1UdjyK1xUnOO8/jeCMfyG0r5 gy7fo8Vbhi3MAHgiuCm8qoFHoSf2yQdXpNqyxrDj6Y12AdO7ae9yPijllve+kcM9gY0D IcPQ== X-Gm-Message-State: APjAAAWeMhVbehnxEkOsC7K55AhIIJs5Ncchcuxy3/q0ySnXd0+mN7JI OUdLFsLhad4NGyZFfXCGU2HjeuD8EMLF8yUQlPI= X-Google-Smtp-Source: APXvYqxPL55CLYLKIvIrL7WZBSDZdtgEYY2U5g9u8XiaklJT+EzFzFIdg5dIpxVPBrCeJvx7ruIPhNk0k8BnYiegMvU= X-Received: by 2002:a2e:7d17:: with SMTP id y23mr3629395ljc.228.1573077513659; Wed, 06 Nov 2019 13:58:33 -0800 (PST) MIME-Version: 1.0 References: <20191106201500.2582438-1-andriin@fb.com> In-Reply-To: From: Alexei Starovoitov Date: Wed, 6 Nov 2019 13:58:22 -0800 Message-ID: Subject: Re: [PATCH bpf-next] libbpf: simplify BPF_CORE_READ_BITFIELD_PROBED usage To: Yonghong Song Cc: Andrii Nakryiko , "bpf@vger.kernel.org" , "netdev@vger.kernel.org" , Alexei Starovoitov , "daniel@iogearbox.net" , "andrii.nakryiko@gmail.com" , Kernel Team Content-Type: text/plain; charset="UTF-8" Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Wed, Nov 6, 2019 at 1:21 PM Yonghong Song wrote: > > > > On 11/6/19 12:15 PM, Andrii Nakryiko wrote: > > Streamline BPF_CORE_READ_BITFIELD_PROBED interface to follow > > BPF_CORE_READ_BITFIELD (direct) and BPF_CORE_READ, in general, i.e., just > > return read result or 0, if underlying bpf_probe_read() failed. > > > > In practice, real applications rarely check bpf_probe_read() result, because > > it has to always work or otherwise it's a bug. So propagating internal > > bpf_probe_read() error from this macro hurts usability without providing real > > benefits in practice. This patch fixes the issue and simplifies usage, > > noticeable even in selftest itself. > > Agreed. This will be consistent with direct read where > returning value will be 0 if any fault happens. > > In really rare cases, if user want to distinguish good value 0 from > bpf_probe_read() returning error, all building macros are in the header > file, user can have a custom solution. But let us have API work > for common use case with good usability. > > > > > Cc: Yonghong Song > > Signed-off-by: Andrii Nakryiko > > Acked-by: Yonghong Song Applied. Thanks Yonghong, please trim your replies.