From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id AF115398B868 for ; Tue, 4 May 2021 14:12:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AF115398B868 Received: by mail-lf1-x12b.google.com with SMTP id z9so9015291lfu.8 for ; Tue, 04 May 2021 07:12:14 -0700 (PDT) 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=QTDqIV7/k9DScfd/QwCSAXbGgOt4/aGNOklhhuChvNM=; b=UTdO0xZs+q6fEtxnQyYeVL4oHTxqWMzlmY+1lM9zyRU6+74Dvf5xAJ1ZMtu+9v5+1M 7xTKxKvo90y/UL8gszxmMX1ya5XYd9U6jyxxbCPyI8XwS+44V6ce8+OrwGU0t9zP7tCY J4eSDlZd+MpWppt7FowlHunsXHVv0izAAVWXPJRg0mNXeMMYhxPio9KYZAOeqKDUlNT1 edBs+KeT5j6+iaOS/QGgonqRnc+J4ggB4O36Mq4Zc+fyJj8BkE2LXnQ4OHBezl2q9QRJ IR5+L/Yy+7YCH+aocNSx2Dx277YoMIyXyJlUm8zYnOcaDEqNkxqiYSiy92OJmIypx5sb wsQg== X-Gm-Message-State: AOAM532Yvq14g1l9mIZQcQlPoR8UdvU5n/MW/Eh60RhfNtteCes4pAmz bekXBtbc2BaRs5AAvv1V+2SYhOtguh3jMtn9dJ4= X-Google-Smtp-Source: ABdhPJxQFkUhvT82spmdlrtrb+tk7HQF+yOJcDpm93nb5OLIvaQOCU9vjN7QJ8uZh4g1UFv1A19bsALcRpiHSZY9B7Q= X-Received: by 2002:ac2:5b1a:: with SMTP id v26mr4491543lfn.534.1620137532998; Tue, 04 May 2021 07:12:12 -0700 (PDT) MIME-Version: 1.0 References: <20210423230609.13519-1-alx.manpages@gmail.com> <20210504110519.16097-1-alx.manpages@gmail.com> In-Reply-To: <20210504110519.16097-1-alx.manpages@gmail.com> From: Alexei Starovoitov Date: Tue, 4 May 2021 07:12:01 -0700 Message-ID: Subject: Re: [RFC v2] bpf.2: Use standard types and attributes To: Alejandro Colomar Cc: "Michael Kerrisk (man-pages)" , linux-man , LKML , glibc , GCC , bpf , David Laight , Zack Weinberg , Joseph Myers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2021 14:12:16 -0000 On Tue, May 4, 2021 at 4:05 AM Alejandro Colomar wrote: > > Some manual pages are already using C99 syntax for integral > types 'uint32_t', but some aren't. There are some using kernel > syntax '__u32'. Fix those. > > Some pages also document attributes, using GNU syntax > '__attribute__((xxx))'. Update those to use the shorter and more > portable C11 keywords such as 'alignas()' when possible, and C2x > syntax '[[gnu::xxx]]' elsewhere, which hasn't been standardized > yet, but is already implemented in GCC, and available through > either --std=c2x or any of the --std=gnu... options. > > The standard isn't very clear on how to use alignas() or > [[]]-style attributes, so the following link is useful in the case > of 'alignas()' and '[[gnu::aligned()]]': > > > Signed-off-by: Alejandro Colomar > Cc: LKML > Cc: glibc > Cc: GCC > Cc: Alexei Starovoitov > Cc: bpf > Cc: David Laight > Cc: Zack Weinberg > Cc: Joseph Myers > --- > man2/bpf.2 | 49 ++++++++++++++++++++++++------------------------- > 1 file changed, 24 insertions(+), 25 deletions(-) > > diff --git a/man2/bpf.2 b/man2/bpf.2 > index 6e1ffa198..04b8fbcef 100644 > --- a/man2/bpf.2 > +++ b/man2/bpf.2 > @@ -186,41 +186,40 @@ commands: > .PP > .in +4n > .EX > -union bpf_attr { > +union [[gnu::aligned(8)]] bpf_attr { > struct { /* Used by BPF_MAP_CREATE */ > - __u32 map_type; > - __u32 key_size; /* size of key in bytes */ > - __u32 value_size; /* size of value in bytes */ > - __u32 max_entries; /* maximum number of entries > - in a map */ > + uint32_t map_type; > + uint32_t key_size; /* size of key in bytes */ > + uint32_t value_size; /* size of value in bytes */ > + uint32_t max_entries; /* maximum number of entries > + in a map */ For the same reasons as explained earlier: Nacked-by: Alexei Starovoitov