Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3678971pxy; Tue, 4 May 2021 07:40:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypEFbMEeXIXN76uE8dYn6LI+SF9KVJaRlpTTGWS4X1WCHgs8AQqodOCpD3K+7irhNQ7Ywr X-Received: by 2002:a05:6402:26d1:: with SMTP id x17mr3894920edd.14.1620139233489; Tue, 04 May 2021 07:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620139233; cv=none; d=google.com; s=arc-20160816; b=Zq6LeY1yjz2EgdhzpJJLhjDJYW2p+y2QlPsmOwp3nzCT+dzPO5T5spfo4Sv3VFTajp ku51+QMC+Pc5d3YIgaYkZZ+hfTIEMN8qvxPMDNJjGAnRYt4m6+q798zWfnpGALoy29LD tt4NoklO6czA/d/e5UPi2pRg4jA0upRBgp83DQSiwk5aBty+t3wEJL7F9dtxQtnu1WhV 6DzGqjO3NodSXmffPI45+CHZJH/FQM30hP3T3SnADb/Dcqc8fh/o2JM5kIq/BNOis0RP C3cdb4hHl0atoygFqIht44xqxP8loC22PvxVE8znCz6rXInM6pgM6L18OlnqaChXyTa9 lLOA== 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=QTDqIV7/k9DScfd/QwCSAXbGgOt4/aGNOklhhuChvNM=; b=J9dgr5EN4tZSEavwtCbTtdKKgjfpm8jm8j4IvaqgtCIKvt8neU6WEJb3p1FaOt9q+Y cL9HhbClceHEuMEVd4fCsyDTvopFF47ZgqJq5ZYcRLv29IB2NPkXO8UEk3k8L8nRI/Ui 2mxL/+6CkXWCeJ1BWG+QpAhXt4xtbnwImhNa0zPQpw16vHgssI1+RnoG2V/g5xZ7DGuv 9tYELBkc7UTiKvAO7s/PAfaqFoLDP/ZHNXvMkDqkiDLJiCBbjYbxng8ZQKaUKA4/Twct CloUV1YquZ7PZP995fDlWIYEslTF4Weepg998HSCFjxusJvutgy8CRF3Ha5e/+jnIrRI A32w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AGnjSPU5; 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 j16si4508748edj.357.2021.05.04.07.40.09; Tue, 04 May 2021 07:40:33 -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=AGnjSPU5; 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 S231480AbhEDONN (ORCPT + 99 others); Tue, 4 May 2021 10:13:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbhEDONK (ORCPT ); Tue, 4 May 2021 10:13:10 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF305C061574; Tue, 4 May 2021 07:12:14 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id c3so9443444lfs.7; Tue, 04 May 2021 07:12:14 -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=QTDqIV7/k9DScfd/QwCSAXbGgOt4/aGNOklhhuChvNM=; b=AGnjSPU5vDFxQnP8n3dvBczS1CaaMqkCegNn25+aOcgU4QpTmICPVDdvKTeZJ6jWWH +WMoy1CGZRZvKA1ikD3Bil0OWgQWEHLezy0CKQu6uS3CK43m6h0u9jZiG7HEp0be0nc+ B72MtZmPSNnBNk5S9QaZJ0Vs092yUmcvClwaIxWBVtrcxLson1ZAdKj/opFc/m3g+ycD wZChMvdDXsN9kFQADbEil59mFFjAixQZ1QkirXOGCd0zbHgrqdhTKVzd8epAp7eJB2EU U8o9Y96Dy7AQnU1zL+Np1A/ZEuukct3tJPkQDPP2G2dj/uSgOQCSlRcSDW0T6V46QuzO 1U5w== 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=QmOOZODvaqhfxVKvEUC+lX6JSTdURm/OuH5K8G5myKRq3hDTdqTkNaaYWTrFlv9DRM bI67Cy7BVS+A+OqxsErgzygiI6HinjwgXFuzcYtLvFhkyf1YvW546MwVGUUU0c11ryBo TOxJUhHEW/NOXtl8l4pngiZkUwEoGdIaiCLUCnzUxDZRd09kM+176NmuUZS+VPOOKoFe 7HcMKWMNY50km3ttaAsSejXsm0Rmytg0SeOW+4o08DY2B/iySh+wbYUMlDiWq+Lmbcmx oMxs0uonGAVVPixFkPQlExA06NTGfvxSf6CDgGPBEtuU+ySaE9p8Q+SFc9trPpnC7BkN R2kQ== X-Gm-Message-State: AOAM530frRiQGxt/SSYc++k7UyMpghEVCXsmDO9pJcr1LEQ4c975zGmZ GTEI8hxISp32qKbbBuvsUFJfARw0xnEteouhsFk= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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