From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9ECB4423F2; Mon, 16 Jan 2023 18:02:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E7D240151; Mon, 16 Jan 2023 18:02:17 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2088.outbound.protection.outlook.com [40.107.101.88]) by mails.dpdk.org (Postfix) with ESMTP id D508B40042 for ; Mon, 16 Jan 2023 18:02:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NV2hkG/Qq3k4UcKykuVwf0ZPwuB3qxZZWBqO7lL6b1DtY9UHpISQ1Q0pePOTTUeg5aidDz4Y3fkAOAO8Ss2g1xkLKWs2LK5qEr7rYDYnXJn9eOPtBdxNtTgexuaA9BWvo8lZBhVmfF8DxOrbok/BZFu/cdAk8KYqwLQSnQ23d/RKqmkNios2F5yeL796twdt1iJPh+BrTVtaY0MtGzQw5I/EHDScYj3ZthPnVOlVVNQP7wJ8FF88YPO1g2DLy4hkW19b6p9lCzZlOPVhtBciYtz4Prx0eSOehziZM9iV3PtW6gHcfPISx9dzulyJ6Zt5NR+9S0IokRh8emzbGTopXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OCVjUAc3XLVIl0P+T56oGVQltnkXwruN1ryO3xRpf4o=; b=ZyF4qCJv763gDTgmTvdoAylQgbajYa5zvQR50RyewSh3ZAD7PQsBPiRBtBsGYheeUX27+fD2oSZJi24fQ4V47LZAv4SfxZ9qTHWdf/Iaev8jC+hM8XdTaAltk5+L4kJnyKrFv/29nfuEVfVNKNJZAXvQOV0IDEKyWRLWE7UkfrOuwgJItmibz+rY3j8CsiCTIHOAVuuADSzsSW//R75DQIIC0b7Kt6QKo0kvPvrFFF5qRD+TcGnVhWvDuCJgLeyvfXFJVwI/2jNI0GFD53WTkUf4ll09o2L+ccDMs2l7Bw4rw/FqJ+rAlazf59lOQf2TUn8XCbn0Ucs2qHIUP3Wa3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OCVjUAc3XLVIl0P+T56oGVQltnkXwruN1ryO3xRpf4o=; b=QgVyfoeyY0zv/aeoRn/ibb7K5T9Kne42aK9yb2WwgyCwL8KN9q7ORQvk7G9eqVbYemysKENDHhKIdihWUXM4EJRjCVqZTi0dUTJNY5WHFMa0Z0Id3bQHr0cjpuH2PJcHuxDIVtSBg/xRPO5HFj4CuZwB0KQeD7zJ5cuy0BokzUk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DS7PR12MB6358.namprd12.prod.outlook.com (2603:10b6:8:95::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Mon, 16 Jan 2023 17:02:13 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%7]) with mapi id 15.20.5986.023; Mon, 16 Jan 2023 17:02:13 +0000 Message-ID: Date: Mon, 16 Jan 2023 17:02:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: =?UTF-8?Q?Morten_Br=c3=b8rup?= , dev@dpdk.org, roretzla@linux.microsoft.com, rmody@marvell.com, timothy.mcdaniel@intel.com, matan@nvidia.com, viacheslavo@nvidia.com Cc: ruifeng.wang@arm.com, zhoumin@loongson.cn, drc@linux.vnet.ibm.com, kda@semihalf.com, bruce.richardson@intel.com, konstantin.v.ananyev@yandex.ru References: <20221202153432.131023-1-mb@smartsharesystems.com> <20230116130724.50277-1-mb@smartsharesystems.com> <20230116130724.50277-4-mb@smartsharesystems.com> Content-Language: en-US From: Ferruh Yigit Subject: Re: [PATCH v7 4/4] eal: add nonnull and access function attributes In-Reply-To: <20230116130724.50277-4-mb@smartsharesystems.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P123CA0096.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS7PR12MB6358:EE_ X-MS-Office365-Filtering-Correlation-Id: 68a79788-3ead-40ab-d5fb-08daf7e3698b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JuJWxmWyYtiHmwPDwWKZlxKpao/o87fcCYFuAZ/RMsUZuht2Rlqzx/ecipShbB0bMLYjK5upVk2gZN8v8rES0GIifpev++IhoFkfwOg4Mop9+L5ShRSyWEixwgP4Mm8usE5tEiR+RS5WUVkBiG7ECNB1e06dBxZ8B8/qlshOLXF6GUdSrH1hxfIr/uHHaB6KyoWqvvHtYa5QIBlwKIHP1Zq0pWvnksI2gO27WqLmc60PYCQgE+xg8OBjZYhUTOXkTQuhiUBY7/oD1Otdjf9qGR29kPXTloy+stR09A33VdO9ztsTsKLI/uBIow39dQZf12gYyVAXORtAqAdg8Q1owzU8tROxSDRqlHX14kNeKFcDpTlswgLFgQ6EiWu4ACjDtXR2VK9yp9qgNU1h2kHFbab3PuLHFekfKUraFcBRtRDMW3FbU8aEJE3rd5DEYssDo99hJaKDehByyrVVTLvZjFab6I2SlzF9MFrIDOAKUkV/ZZQljktyNt4564GUaZy9WN5phZ1z1cPgRCxVG+NuUJulQ8BJoR4DkGQKnF4WS+K2EmVJ00ZI6RgNLa0Ii8m1O2dY+bLUswHPGG8CAzwR9HhxBncxG23iLKTkT4TO7BT16dnRiyIk0hMIMsc+ltPmPqNQXQF1kMUKOsISOHu+ISUTcXA36uHlk/lyAtLetUK3kJCFWcEFZ9xhkfegyEhmGijxw2HK1DDtUYQPrwLli4g10RGgEjUmP+ZR4npykeBRRKm9fzI8sTXxn+WIPjx3 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(376002)(396003)(39860400002)(366004)(136003)(346002)(451199015)(31686004)(36756003)(8676002)(38100700002)(86362001)(44832011)(8936002)(66476007)(66556008)(66946007)(31696002)(5660300002)(7416002)(2906002)(4326008)(83380400001)(6486002)(478600001)(6666004)(316002)(41300700001)(66574015)(53546011)(2616005)(6512007)(186003)(26005)(6506007)(21314003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bE9INDhvSFJkQWtpVHdYbElHOXhBbURNREh5MUxrSlhuSkZSc20yYWZldE90?= =?utf-8?B?S0EzOVdLYXpHbTZLRWJlcUsyeGgyQ1h4WVJ2ckw2aTRRcVk1SFU2RjRyTEh0?= =?utf-8?B?RnJwNlppZHAyU2ltcVN2d1VBbUpXcWxrVEVkclZmUXYxV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?utf-8?B?VktpdlpkL09Md01rS2JjdFFQVVF3NVk3N0ZWR0tTMUFGVGhNU0tneGNHYUlv?= =?utf-8?B?eVl4MEoyMEorRktVQW1CcytZK0hxdmNiQWwwQjllbXZ4QWl1L3ZFTWVDRkt4?= =?utf-8?B?S1B4cGhqS3BXRmNubVJMbE0rVU15TEdpajB2TmphSDlYSzVWTHpESDVnYUZJ?= =?utf-8?Q?pal83ut2+xmjbpXKbl2879SnL?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68a79788-3ead-40ab-d5fb-08daf7e3698b X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 17:02:13.0817 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gD3hfZrtTh26E9sdNlzn9pbuZja5BV0Msbbzjw08TLbYg1wOrF17YCKVtGdRgukK X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6358 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 1/16/2023 1:07 PM, Morten Brørup wrote: > Add nonnull function attribute to help the compiler detect a NULL > pointer being passed to a function not accepting NULL pointers as an > argument at build time. > > Add access function attributes to tell the compiler how a function > accesses memory pointed to by its pointer arguments. > > Add these attributes to the rte_memcpy() function, as the first in > hopefully many to come. > > Signed-off-by: Morten Brørup > Acked-by: Tyler Retzlaff > Reviewed-by: Ruifeng Wang > --- > v7: > * Fix indentation. (checkpatch) > v6: > * Make this the last patch in the series, putting the fixes first. > (David) > * Split the generic access macro into dedicated macros per access mode. > (David) > v5: > * No changes. > v4: > * No changes. > v3: > * No changes. > v2: > * Only define "nonnull" for GCC and CLANG. > * Append _param/_params to prepare for possible future attributes > attached directly to the individual parameters, like __rte_unused. > * Use RTE_TOOLCHAIN_GCC instead of RTE_CC_GCC, to fix complaints about > GCC_VERSION being undefined. > * Try to fix Doxygen compliants. > --- > lib/eal/arm/include/rte_memcpy_32.h | 8 +++ > lib/eal/arm/include/rte_memcpy_64.h | 6 +++ > lib/eal/include/rte_common.h | 76 +++++++++++++++++++++++++++++ > lib/eal/ppc/include/rte_memcpy.h | 3 ++ > lib/eal/x86/include/rte_memcpy.h | 6 +++ > 5 files changed, 99 insertions(+) > > diff --git a/lib/eal/arm/include/rte_memcpy_32.h b/lib/eal/arm/include/rte_memcpy_32.h > index fb3245b59c..a625a91951 100644 > --- a/lib/eal/arm/include/rte_memcpy_32.h > +++ b/lib/eal/arm/include/rte_memcpy_32.h > @@ -14,6 +14,8 @@ extern "C" { > > #include "generic/rte_memcpy.h" > > +#include > + > #ifdef RTE_ARCH_ARM_NEON_MEMCPY > > #ifndef __ARM_NEON > @@ -125,6 +127,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src) > memcpy((dst), (src), (n)) : \ > rte_memcpy_func((dst), (src), (n)); }) > > +__rte_nonnull_params(1, 2) > +__rte_write_only_param(1, 3) > +__rte_read_only_param(2, 3) > static inline void * > rte_memcpy_func(void *dst, const void *src, size_t n) > { > @@ -290,6 +295,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src) > memcpy(dst, src, 256); > } > > +__rte_nonnull_params(1, 2) > +__rte_write_only_param(1, 3) > +__rte_read_only_param(2, 3) > static inline void * > rte_memcpy(void *dst, const void *src, size_t n) > { > diff --git a/lib/eal/arm/include/rte_memcpy_64.h b/lib/eal/arm/include/rte_memcpy_64.h > index 85ad587bd3..0c86237cc9 100644 > --- a/lib/eal/arm/include/rte_memcpy_64.h > +++ b/lib/eal/arm/include/rte_memcpy_64.h > @@ -282,6 +282,9 @@ void rte_memcpy_ge64(uint8_t *dst, const uint8_t *src, size_t n) > } > > #if RTE_CACHE_LINE_SIZE >= 128 > +__rte_nonnull_params(1, 2) > +__rte_write_only_param(1, 3) > +__rte_read_only_param(2, 3) > static __rte_always_inline > void *rte_memcpy(void *dst, const void *src, size_t n) > { > @@ -303,6 +306,9 @@ void *rte_memcpy(void *dst, const void *src, size_t n) > } > > #else > +__rte_nonnull_params(1, 2) > +__rte_write_only_param(1, 3) > +__rte_read_only_param(2, 3) > static __rte_always_inline > void *rte_memcpy(void *dst, const void *src, size_t n) > { > diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h > index 15765b408d..c9cd2c7496 100644 > --- a/lib/eal/include/rte_common.h > +++ b/lib/eal/include/rte_common.h > @@ -149,6 +149,82 @@ typedef uint16_t unaligned_uint16_t; > __attribute__((format(printf, format_index, first_arg))) > #endif > > +/** > + * Tells compiler that the pointer arguments must be non-null. > + * > + * @param ... > + * Comma separated list of parameter indexes of pointer arguments. > + */ > +#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG) > +#define __rte_nonnull_params(...) \ > + __attribute__((nonnull(__VA_ARGS__))) > +#else > +#define __rte_nonnull_params(...) > +#endif > + What do you think to have a namespace for macros like '__rte_param_xxx', so name macros as: __rte_param_nonull __rte_param_read_only __rte_param_write_only No strong opinion, it just feels tidier this way > +/** > + * Tells compiler that the memory pointed to by a pointer argument > + * is only read, not written to, by the function. > + * It might not be accessed at all. > + * > + * @param ... > + * Parameter index of pointer argument. > + * Optionally followeded by comma and parameter index of size argument. s/followeded/followed/ multiple occurrences below > + */ > +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400) > +#define __rte_read_only_param(...) \ > + __attribute__((access(read_only, __VA_ARGS__))) > +#else > +#define __rte_read_only_param(...) > +#endif > + > +/** > + * Tells compiler that the memory pointed to by a pointer argument > + * is only written to, not read, by the function. > + * It might not be accessed at all. > + * > + * @param ... > + * Parameter index of pointer argument. > + * Optionally followeded by comma and parameter index of size argument. > + */ > +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400) > +#define __rte_write_only_param(...) \ > + __attribute__((access(write_only, __VA_ARGS__))) > +#else > +#define __rte_write_only_param(...) > +#endif > + > +/** > + * Tells compiler that the memory pointed to by a pointer argument > + * is both read and written to by the function. > + * It might not be read, written to, or accessed at all. > + * What I understand is difference between 'read_write' access mode and 'nonnull' attribute is, 'read_write' access mode additionally checks that variable is initialized before used in this function. Should we document this detail, although it is gcc manual I think it helps to clarify here. > + * @param ... > + * Parameter index of pointer argument. > + * Optionally followeded by comma and parameter index of size argument. > + */ > +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400) > +#define __rte_read_write_param(...) \ > + __attribute__((access(read_write, __VA_ARGS__))) > +#else > +#define __rte_read_write_param(...) > +#endif > + > +/** > + * Tells compiler that the memory pointed to by a pointer argument > + * is not accessed by the function. > + * > + * @param ... > + * Parameter index of pointer argument. > + * Optionally followeded by comma and parameter index of size argument. > + */ > +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400) > +#define __rte_no_access_param(...) \ > + __attribute__((access(none, __VA_ARGS__))) > +#else > +#define __rte_no_access_param(...) > +#endif > + > /** > * Tells compiler that the function returns a value that points to > * memory, where the size is given by the one or two arguments. > diff --git a/lib/eal/ppc/include/rte_memcpy.h b/lib/eal/ppc/include/rte_memcpy.h > index 6f388c0234..c36869a414 100644 > --- a/lib/eal/ppc/include/rte_memcpy.h > +++ b/lib/eal/ppc/include/rte_memcpy.h > @@ -84,6 +84,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src) > memcpy((dst), (src), (n)) : \ > rte_memcpy_func((dst), (src), (n)); }) > > +__rte_nonnull_params(1, 2) > +__rte_write_only_param(1, 3) > +__rte_read_only_param(2, 3) > static inline void * > rte_memcpy_func(void *dst, const void *src, size_t n) > { > diff --git a/lib/eal/x86/include/rte_memcpy.h b/lib/eal/x86/include/rte_memcpy.h > index d4d7a5cfc8..ee543aa37d 100644 > --- a/lib/eal/x86/include/rte_memcpy.h > +++ b/lib/eal/x86/include/rte_memcpy.h > @@ -42,6 +42,9 @@ extern "C" { > * @return > * Pointer to the destination data. > */ > +__rte_nonnull_params(1, 2) > +__rte_write_only_param(1, 3) > +__rte_read_only_param(2, 3) > static __rte_always_inline void * > rte_memcpy(void *dst, const void *src, size_t n); > > @@ -859,6 +862,9 @@ rte_memcpy_aligned(void *dst, const void *src, size_t n) > return ret; > } > > +__rte_nonnull_params(1, 2) > +__rte_write_only_param(1, 3) > +__rte_read_only_param(2, 3) > static __rte_always_inline void * > rte_memcpy(void *dst, const void *src, size_t n) > {