Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp177681pxf; Tue, 30 Mar 2021 23:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5HrSC+8yOnWt9xybOJ3XRGK5d/0Te4RW9X4ip1gQp6VqwYUpDziRL5fTQULRGOgMtrU5u X-Received: by 2002:a05:6402:1613:: with SMTP id f19mr1913855edv.222.1617173864992; Tue, 30 Mar 2021 23:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617173864; cv=none; d=google.com; s=arc-20160816; b=eWGVv9pe50TJNM9YR6i+MJeJ26EhqSnnzH7SUYOlZAjyIcinGdLwasqpNvpCKZtjWm KtkakA+FpFDdqUntysmY4sKOH0k4B78QY5j27aSrcQ5n94oE8LEgZsHwVXmkITsI5APu WexMlSD8aUW7ZVYzCgrQ1/cZJDUp4fbOJq68vfQQj5QuzNlRO/w8cOYp2C27BrC//mjI 3JP7vhz3aOzAHLKlHqa4wNHab5YQHhTKFeKY/xcOmBXtoyDOEQFpvDedjrqsGB4QMAJv 4OXR9L4bZ6VLcNiEZrBqpaGtDRuuBRPZlULXm7L4asAFIKrdyzttbIRPcDXYzV3h51iG UasA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qZ3SKuaY+ZUKX6y7erBmTFWnYGpQCsQub2RCDZGga5U=; b=pNaCQ7DEBMV0p70eRwjXbFyrlj9FbWthTv/4FnT0wkQ7aHuXH/OIZ2GEVndAeJPjsT rN5LwGdRyRtDHFKB0Sqmzk5VmbLefJfNTR21fN+JLdkod2w8qqJ18C2rWknk5xhqc2xg olPwo+RQxb6bGdDhFc8Vnt9CYHsWqHr9e0u1zE0JSDCqa825g2I5Xc/CbIijo7gWESkH YhcuDxoZ7fIxt2nEVPhzL+jdjjNMrWFfX6Ae6YnjMJll4fRy7inRLeGiBQcAkv2sA6+j unGf7KQYt8VR0rQ+o2oFhH2KPyk7KGIqyzs6CLHF8GVoV8PVhn5X67vjP0jjChYslGyN hcmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=geyO7kmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si1104612edd.528.2021.03.30.23.57.21; Tue, 30 Mar 2021 23:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=geyO7kmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233895AbhCaGyT (ORCPT + 99 others); Wed, 31 Mar 2021 02:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233905AbhCaGyH (ORCPT ); Wed, 31 Mar 2021 02:54:07 -0400 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8938C061574; Tue, 30 Mar 2021 23:54:06 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id w8so20105516ybt.3; Tue, 30 Mar 2021 23:54:06 -0700 (PDT) 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=qZ3SKuaY+ZUKX6y7erBmTFWnYGpQCsQub2RCDZGga5U=; b=geyO7kmocph0iXRsk2wYAghlsnGnYkewakhWdv9RM3Ci7iHpN8Zw6pOwI/R1hw9FSC A2n7E1Bxl7Y1lB+xkahWq97WJ65rOQFE9CRtMFL9Cjara8/0Ua8ZTlaXW9XHNfzJp0Fz zVx8gCUxgo5LNUqgbCuBQVbyQZX0qhWTdzwGWnkvogS6LdWc+qYWhNB99qlgkFv/TjqK KlstQtQWIqeNxpXBbIQGKMzY+vQkpMBX/a6yd1JHGQ04Wk1BqmflD6jW22BdjL/GGHQZ HG1lt8xmcMDQ4cbj8VWUfP7mihACHQEbyrhqcSshq010XudPKtqfYBEfvAAK3TEfXu6r L1hw== 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=qZ3SKuaY+ZUKX6y7erBmTFWnYGpQCsQub2RCDZGga5U=; b=Ov3V/4Uwh38iletyGf/uiChw5m3BHbXJBSMT37fScsVvlT8hlfzj2zuYiGWhXDbNLs UMrmWzVyKD6NeTmYgkF9UEIGWTOW5NaxOUeGRqejcp7FEBBt33dazMgwA0tuAK39KD2e GIHTG1szXyEW6ZKQ0itBIOF2aUmCbI3TUwGjAy8j9YpGnQBjjSjHZ2U6XI18aVxhUe4R 2x2oNTtQWJN3pxgwBMSzak7AlNZrARITGrd+sQoKdVE4tYJ4dDL9M7s7rjCshISOa12/ wXVzhISyho0tVHaGyXbQIvIwZ9GyanKiUFsoDN9SQIsRulCBWGvRB2oAeTxtFUR7XGUi BXzw== X-Gm-Message-State: AOAM532SKJr/rwODvt9zeuqjlIhvkDthF2d/fhj/aA3deXtyG3vAQgxZ hM+82zffFg2+eEBTsZwkEs3GvMAxte6RsMuVr7gkZSxT X-Received: by 2002:a25:6d83:: with SMTP id i125mr2629842ybc.27.1617173646186; Tue, 30 Mar 2021 23:54:06 -0700 (PDT) MIME-Version: 1.0 References: <20210328161055.257504-1-pctammela@mojatatu.com> In-Reply-To: <20210328161055.257504-1-pctammela@mojatatu.com> From: Andrii Nakryiko Date: Tue, 30 Mar 2021 23:53:55 -0700 Message-ID: Subject: Re: [PATCH bpf-next] bpf: add 'BPF_RB_MAY_WAKEUP' flag To: Pedro Tammela Cc: Pedro Tammela , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Joe Stringer , Quentin Monnet , Yang Li , Networking , bpf , open list , "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 28, 2021 at 9:11 AM Pedro Tammela wrote: > > The current way to provide a no-op flag to 'bpf_ringbuf_submit()', > 'bpf_ringbuf_discard()' and 'bpf_ringbuf_output()' is to provide a '0' > value. > > A '0' value might notify the consumer if it already caught up in processing, > so let's provide a more descriptive notation for this value. > > Signed-off-by: Pedro Tammela > --- flags == 0 means "no extra modifiers of behavior". That's default adaptive notification. If you want to adjust default behavior, only then you specify non-zero flags. I don't think anyone will bother typing BPF_RB_MAY_WAKEUP for this, nor I think it's really needed. The documentation update is nice (if no flags are specified notification will be sent if needed), but the new "pseudo-flag" seems like an overkill to me. > include/uapi/linux/bpf.h | 8 ++++++++ > tools/include/uapi/linux/bpf.h | 8 ++++++++ > tools/testing/selftests/bpf/progs/ima.c | 2 +- > tools/testing/selftests/bpf/progs/ringbuf_bench.c | 2 +- > tools/testing/selftests/bpf/progs/test_ringbuf.c | 2 +- > tools/testing/selftests/bpf/progs/test_ringbuf_multi.c | 2 +- > 6 files changed, 20 insertions(+), 4 deletions(-) > [...]