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 D2478438FF; Fri, 19 Jan 2024 14:10:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70F1F4029F; Fri, 19 Jan 2024 14:10:26 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2051.outbound.protection.outlook.com [40.107.93.51]) by mails.dpdk.org (Postfix) with ESMTP id 70CCE40279 for ; Fri, 19 Jan 2024 14:10:25 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQ9rIndGRqDBNRJ2GNJFoSXuTZgpGAg+OzJfNsaXmCFYfnxq2PdD4Q3Wnj/hPMl5EITDY6W6V/IPYfm31s0d+FeMuKAoNYZycUDvnDwBprY31CnJXq1GH+U/H52luxXe7uk0XgqiiobwDiXEOhSNHxIDTLDo1m4TdvUpR15xz50GMQFshIwWA9xA5BNDaSer/gqFFtYcjxvBp1bA8XiwQ5zgQpjoHa6Y7wYmbVbWveSaNC/JAFJ8qPw+GeVT1KS+KFIPH8u/bmZ5iKqgih7Zb1P7V4FZOU7GfmFdo/rwFTFfGTDL7xqqg2JPOd0k3HpLoQH+Pij4Crrd24xHijHGQQ== 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=XuDCPRyu6mzAokGcj4vE75+73GGv+tNA43lPLaaSzLQ=; b=ZBvngSN7a785Nb4xbMMhRd+cHlVahNQeehnEA1tiWp3VhiqzFY8wCFAXY12fYfgfEw3ocGPempA48HYnBVrSxNAsPRwUm+25+Qj7ahHLeMc5URR6VsYuYhV2zjeHY/eja5Egz0ZOTwbTZXte05DSSOg18IfUUTq1rVwYParX1PNv87TNIXaumopDGoFDjacL3YVAdXsmJ9N4UABkvktaaQCJb58R/IGnPp5tDpSwFYQ+3L4f5SfkvrEP0xIH7JkZEtMwo9Gcr8706oeFreG84DqCcFe/rhDsvgITCFJDvqM37hEDwL7YYIZKqqSihUMd8ozWDbBwvU6WdzkUXD588w== 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=XuDCPRyu6mzAokGcj4vE75+73GGv+tNA43lPLaaSzLQ=; b=Q79Eh0a7A/ZVd/z7ED33K1uKgclTXyvZ82ie1bGi29FRcvt155cROp+cigSBl8hInh9WEZ7G7l/mIhmnrxBVbmknwtitjqfZpoHxpp7dFAS35N5wCSLFyUI6lXWyngSZdcSo9uJiBZse6z0q+twZLbUWAf44+p7+TTnNYJKEBjw= 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 CH0PR12MB5026.namprd12.prod.outlook.com (2603:10b6:610:e1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.26; Fri, 19 Jan 2024 13:10:20 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f%4]) with mapi id 15.20.7202.027; Fri, 19 Jan 2024 13:10:20 +0000 Message-ID: <43103aaa-c6fa-4ce0-ac56-66414e24d7d6@amd.com> Date: Fri, 19 Jan 2024 13:10:16 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 6/6] eal: replace out of bounds VLA with static_assert To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Stephen Hemminger , dev@dpdk.org Cc: Tyler Retzlaff References: <20231111172153.57461-1-stephen@networkplumber.org> <20240118165315.63959-1-stephen@networkplumber.org> <20240118165315.63959-7-stephen@networkplumber.org> <98CBD80474FA8B44BF855DF32C47DC35E9F175@smartserver.smartshare.dk> Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlw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UJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F175@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0024.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::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_|CH0PR12MB5026:EE_ X-MS-Office365-Filtering-Correlation-Id: a58c26a3-f347-4437-a559-08dc18effcf8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R4FArcc2kpnzlUlqBMmRvyTVtj/uqqN4BIotsc2hNzTE0VMvqJywYJUxuu+cUbMmBEMSkMzSsKQvSSvCf8NO8BlZT0LK2A62iGOwRCnSSsFBRK2NMU4gc7SLgYe6w+hhHwhVNZW7dYqUQ4AZk8WPlIafju2AU3kqLdnpWqyRN/VSvqXK5wP0NLCWKHwMU5KxLKI6gGp5vrteZSQwqmizbebCf0FXC0nUySZ8PxZqx/3LurZHTQeg7U0QQeS4f56NN4H/pYfrIhoU/pvRKy977BdOGI0yc5otAgX5JHxRloxSLTA9uABZ2Jvz2ElirhNQWKFkNWGn+ncQ+3qCwKXiwKRREJB/gC2fB/4/Kwih9ZY7LsLIItvKItVxVya4jq3yigLvNrcaY3EgZEGVKaqyKrEJlEI2atvGAlkTbUIsF+UtorhR7fT793AmpsafzPdD9NKYKmkMfBClW4I6Skq4zE5ZqIVf7ubw7GG92CRoIPP4S5X2Mlvsx7sISmNy6SaXyVFjTXF3n60J93j/A7YbsXXZFDK2VQAtBB+JT1l8gEQ7Mi1uyHcH/uMox5hfFSz44ib3PkthB/rAa/gQrSiPhvlv7jhmlFujMImqAmgmML5fTTy056z9xJp0NhksVJXVlWZUfyKYJa2+MApvq6kjfA== 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:(13230031)(39860400002)(366004)(346002)(136003)(396003)(376002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(31686004)(86362001)(31696002)(6512007)(53546011)(6486002)(36756003)(478600001)(2616005)(83380400001)(38100700002)(4744005)(26005)(2906002)(66476007)(66556008)(66946007)(316002)(110136005)(5660300002)(66574015)(6666004)(6506007)(4326008)(44832011)(41300700001)(8676002)(8936002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NDg1L2xuNFFhdTBiaEd2NytaUzJDcW9QTDFXb2d4eVJpbmJUK3ZveDZzSHF4?= =?utf-8?B?S2tTTklkWHZNQllwK1dMSExSVGVpaEE3UWxNWnNlOUpHMnNkeWpFd2JOUWtK?= =?utf-8?B?YWhHeDc1a3lSWm9RUHNXRmNRRFVaYVVIbzV5aXkzMXdNNjlzNzdSQmxGVTNz?= =?utf-8?B?Tm5CcllmVHBvbGlPZzBsSlBTeUpiVlBtdllKNWY1SjU1Tm5zc2w3S0FESjFw?= =?utf-8?B?ZHZKSE1vUTlucHUyWVJCMlI3RHJqdG1FNFRxREhjOHVEMjdqM2krN0t1TzY1?= =?utf-8?B?SUVSOHc4M3VOSFJ2YUVrWmVuYkdyRXE5SXEyRkY0bFZuMmxyWmltRE1PbWND?= =?utf-8?B?NGhaVjMwdS9uRGtWQ3hCNHJ6aElSajhyVDZINnI4aTk2dnhENkVsa3U5RkJX?= =?utf-8?B?SHBBNHdwZDZsTXB5Yj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URHMHlFUCsvbkxPUkRVd3dUN2hKSjRWVTVSY0VJYkMvUGRmYXBsVlh0?= =?utf-8?B?c29PTTFTRjlXODVOUlRxQ2FwQi9zM3ZyUVo4N05BUCt1SkptUG5vUSt4ZlEw?= =?utf-8?B?UE0yS2pkUkNrRFhLUnJ3dnF3cVJRZnZkRGlmOFpkS1lKSHpNUGlBVXFnKy9z?= =?utf-8?B?c0FpOUhnNlpXbUw1ZzJPNkFEOE1NNTRhT25yY1N0bWlpR3hmVjJ4bzJFckpq?= =?utf-8?B?K3kyZGs2enpITjZZNFlhazl4eTVCdXB0MFdBNXN4Q3U3WEEwVmw2Z2xYdnVa?= =?utf-8?B?d1E2aGJadzJZY1R1Y0cvd05BK3ZDU1gyVlJvUjB5L20vUFNFTnlCN1lYTWdM?= =?utf-8?B?SDVOUzFrZHJsdFFyRlpxRTlROVVyOGtLMStTTjZyczdjazVLa3VsZmlLSjB4?= =?utf-8?B?R3FvbmFxUlJXTHBmVGdxL3A4OXNBQnR6cXB3R0wwNW03clRrckQ3SnlycGYy?= =?utf-8?B?NUNXWVIxK2ZYSXVHcnE4S25QNmlkdEVqZEN3NnYyUGJEQkxLSUtkM2k4d2dq?= =?utf-8?B?V2lsempMUHJWVDZ5YnRsNXRVTWhTTjdqNmV5MEthT1V6bkh0V0tBM0RlOFhQ?= =?utf-8?B?c2JidVgxOVl5bnloQis3TmxqcVpDSHV2bkt3alh0TFVMdHJhQnVGVjczYzha?= =?utf-8?B?a1BjenVEclFZVjNUQmhFUERLSitsQ0RLRkpvUFFJL0lBbGxjS29Wc3pwZWx5?= =?utf-8?B?S1ZOWlJFRG11eWxRdjh1RHFxaDNXd0FSb0FqanFPaGw1cFdqRHJSMG94YmtP?= =?utf-8?Q?Abwf71GSvBZEs98Die/Tn/klo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a58c26a3-f347-4437-a559-08dc18effcf8 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2024 13:10:20.2924 (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: PKZXWy3mRNOHmyTDd7EjLpY/TmPnWG81U9+0aYOfKZcD/+cAkLqzuj59MaLRt2id X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5026 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/18/2024 6:42 PM, Morten Brørup wrote: >> From: Stephen Hemminger [mailto:stephen@networkplumber.org] >> Sent: Thursday, 18 January 2024 17.51 >> >> Both Gcc, clang and MSVC have better way to do compile time >> assertions rather than using out of bounds array access. >> The old method would fail if -Wvla is enabled because compiler >> can't determine size in that code. Also, the use of new >> _Static_assert will catch broken code that is passing non-constant >> expression to RTE_BUILD_BUG_ON(). >> >> Add workaround for clang static_assert in switch, >> and missing static_assert in older FreeBSD. >> >> Signed-off-by: Stephen Hemminger >> Acked-by: Morten Brørup >> Acked-by: Tyler Retzlaff >> --- > > Reviewed-by: Morten Brørup > Acked-by: Ferruh Yigit