Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp372724pxf; Wed, 7 Apr 2021 01:22:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRNORXwmzHaHObE91LklcaUiG7V8HsWCUaW9yVYMFMrGvEbjHKNqIWPLFukgbfC5PKDED5 X-Received: by 2002:a92:c241:: with SMTP id k1mr1922610ilo.119.1617783773830; Wed, 07 Apr 2021 01:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617783773; cv=none; d=google.com; s=arc-20160816; b=FIphy7O7bFcNeTufca0K0IgM9q9I+95EvXaDzRBoXc7GW40T/eBhVrejFtaknMbzLe aMWUl5/M+avDGgaWG6flRI+kj47pk2jdAWMg6N5Ys58cxHkh59sW4gHmhDKNa7QcN6O3 8vmG9whZf1ee8LJBgwIq6Sh7Ed8djpneryUDMRzHCwPtxb3ZraqV8YyBW0vAizm3c7Vj RFu9W90mAgsFDxif1cJR/HGgMS8zPtBertB5R41akcP6zh2w1W6yj+mxOvSLXs9yDTwB kfFBulL/JC9HtA4vhZ8N0d2mmc5VZ9D6EEIcUPqf0JP92ngaoETERxiy0t5KaN/0yAGv aNdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0k9ST6Sqw/pWXllPyrKJXa/iA6xjIOi51e4J0l+LPoY=; b=xMthDC/H8RVG/rqjYad4xJ2bsOKsk6XGrFhmXexOJ+feQruRrCvIzBwVTwgN/PyX2R /TCCh3L/DZdVAI6Vl2gyvaIo+hO0RUOrum8AV+g7hk8UklxjW/yMAO3D4mRM8STqPBRb wqhBS/ZfVe04S1FbcX1oLPBt+CAIi3VtMxN1LjaJnL+xMJuBkMdbEgFfifrT38YzRguf Epmdn+pcmL0vR524XH4UBaJbz3Fds7tPDVdMOLnTb9S9VKesQ54R7ustXkmtUdvS511m 3negmz5CEYtRgNrLEF/gphGcd6aID5nfM5HUtsBi3UZCe1PZCJ5bA/WUI7jDaxrgBP88 mtUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="S8a/uDh3"; 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 r5si972722ilb.16.2021.04.07.01.22.41; Wed, 07 Apr 2021 01:22:53 -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="S8a/uDh3"; 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 S233062AbhDFS6n (ORCPT + 99 others); Tue, 6 Apr 2021 14:58:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbhDFS6l (ORCPT ); Tue, 6 Apr 2021 14:58:41 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51782C06174A; Tue, 6 Apr 2021 11:58:31 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id j7so11971059qtx.5; Tue, 06 Apr 2021 11:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0k9ST6Sqw/pWXllPyrKJXa/iA6xjIOi51e4J0l+LPoY=; b=S8a/uDh3395wy3FV13q5iCO6nyhLa9VrO7pKfSZAvZHD1ck29dng/z9i8HohDB4AgS wRhxw8hIyg6miTVDoR5CmiHbPEKwEI8Xlz7KtloZJyvTEf+EWR6cjzYHZLgqu9uHSOJt 0lXJ38C/4nprr+D74jPeaTNzJNH4V6vTZ9g5S0bN5jmLkyorHN/7lAVYHoqo8mqBTNem 0XHlY9cySUGAk4xZ8eGPj76tZ0ABsZ5JBCEe407BXjzYOX3tTVvqv6GKq0x0yu/fF2us mdXzvEifGmtYxh1uDpRPFuD4e3Boz773k6p7Mb/l2ShxBjxcGfvPueuIQdgQ9lXYBlMe v7bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0k9ST6Sqw/pWXllPyrKJXa/iA6xjIOi51e4J0l+LPoY=; b=At2H6kqCZjmC00aDA5GvFPibm/arW6Epzxo7oABReUeOyokXnOi7jDvYgZejbPyb77 3Qnid6PWzITwc8SdK/jEuZ7Ixde5/9zfudgTRuJKZkReduDrxbzD7HOMroB73BoiFsMo AkTfEdbYfGh9rC6N755/n3f5FPOSTeoItuEgq0XDnGB1ogLMdFZh05lrCOgZrvMG6H3z BP7T/oc7TsRBG9ZABypnKR+fobSov9tA2ENZUIn9+rTRh94lM2GhkEBEXfchY9j6Fmoo z9p92o3eOGRmRExf3K4xZrHbnpsyRvgQJGAn3E3AF4KwHeOrPTOFbtwX1A0raz5xEFGW S/Fg== X-Gm-Message-State: AOAM531ySSd0Dy2QWoh3IBaDVLvvZFPpTrdPIf+whHYejY5fBF6g6urY 5NTKzzDxbFqRc0tBSqixkUE= X-Received: by 2002:ac8:43cb:: with SMTP id w11mr29308676qtn.84.1617735510550; Tue, 06 Apr 2021 11:58:30 -0700 (PDT) Received: from localhost.localdomain ([179.218.4.27]) by smtp.gmail.com with ESMTPSA id 19sm14209579qtt.32.2021.04.06.11.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 11:58:30 -0700 (PDT) From: Pedro Tammela X-Google-Original-From: Pedro Tammela To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Joe Stringer , Quentin Monnet , netdev@vger.kernel.org (open list:BPF (Safe dynamic programs and tools)), bpf@vger.kernel.org (open list:BPF (Safe dynamic programs and tools)), linux-kernel@vger.kernel.org (open list) Cc: Pedro Tammela Subject: [PATCH bpf-next] libbpf: clarify flags in ringbuf helpers Date: Tue, 6 Apr 2021 15:58:04 -0300 Message-Id: <20210406185806.377576-1-pctammela@mojatatu.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In 'bpf_ringbuf_reserve()' we require the flag to '0' at the moment. For 'bpf_ringbuf_{discard,submit,output}' a flag of '0' might send a notification to the process if needed. Signed-off-by: Pedro Tammela --- include/uapi/linux/bpf.h | 7 +++++++ tools/include/uapi/linux/bpf.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 49371eba98ba..8c5c7a893b87 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -4061,12 +4061,15 @@ union bpf_attr { * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, notification + * of new data availability is sent if needed. * Return * 0 on success, or a negative error in case of failure. * * void *bpf_ringbuf_reserve(void *ringbuf, u64 size, u64 flags) * Description * Reserve *size* bytes of payload in a ring buffer *ringbuf*. + * *flags* must be 0. * Return * Valid pointer with *size* bytes of memory available; NULL, * otherwise. @@ -4078,6 +4081,8 @@ union bpf_attr { * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, notification + * of new data availability is sent if needed. * Return * Nothing. Always succeeds. * @@ -4088,6 +4093,8 @@ union bpf_attr { * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, notification + * of new data availability is sent if needed. * Return * Nothing. Always succeeds. * diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 69902603012c..51df1bd45cef 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -4061,12 +4061,15 @@ union bpf_attr { * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, notification + * of new data availability is sent if needed. * Return * 0 on success, or a negative error in case of failure. * * void *bpf_ringbuf_reserve(void *ringbuf, u64 size, u64 flags) * Description * Reserve *size* bytes of payload in a ring buffer *ringbuf*. + * *flags* must be 0. * Return * Valid pointer with *size* bytes of memory available; NULL, * otherwise. @@ -4078,6 +4081,8 @@ union bpf_attr { * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, notification + * of new data availability is sent if needed. * Return * Nothing. Always succeeds. * @@ -4088,6 +4093,8 @@ union bpf_attr { * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. + * If **0** is specified in *flags*, notification + * of new data availability is sent if needed. * Return * Nothing. Always succeeds. * -- 2.25.1