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 7F82643B05; Tue, 13 Feb 2024 10:40:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C113410ED; Tue, 13 Feb 2024 10:40:03 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2050.outbound.protection.outlook.com [40.107.94.50]) by mails.dpdk.org (Postfix) with ESMTP id C5F98402AD for ; Tue, 13 Feb 2024 10:40:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BJ4C1Qud6j7FRDuT5SejQ12cnAleBHdo04xvy7Msx80OabxbQb+JYnua4XMa9KVX6wbMdKXMc/5VX12LMzue2ETf9UrKBm5GwYOUZTkeDMDp9zhl/b/WMD233KtccN2GVkHKZeKCsRly4xeeFSO2EnwHc0xdzzQeEnaA0scYvV2JNIIL3BU6Dbcagu1ggEAIxaT08ViIom2aQkP4DYfZjkVJYjSEddFvrK4epN+12WlkJxaTHk/6+3UCyrKZpR433aTMOrS9ejzmz2OCVtgvYpxHMK87CPpF+fvOm40Vs/NfrGv0JUqHfTT+/MpjGrlalRz+QZxPCWSe42Je4Emvqg== 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=Vi1jBdBW9xsJw6i86pDjmnO2CwRdzTaArhg3uQd3q9c=; b=i8fcLdBIRFXh4nlWk6CKF25tNfw44CinMWPnvzdDdIsrja8M+MMkYPy5bIai2T1Ypv2/aMm6R7tWMqvaBgYXZpgZmlaCLicZyhm3FcQzNfQ9ghClm03txYjVgxFpnViWpIdCOl6CJxpZ06ZDXuWNRcQ2jcto5NmagTczDrgl3DJO42vjsteu16brYFj47bEJe0+CCwpv6E7nKur6PADg37CWp3oqR9MjRZV7WUZZQcVxoBRZhUAzgbB1Eu/g48D9f7Vnvw/aJEPQusjNmRGA3ZvwncgvpfY8Vb8Hn4bZug9ILW5aRy/gHL3qlxX7muy6N8aIcxQihaGtGCChrQUcZg== 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=Vi1jBdBW9xsJw6i86pDjmnO2CwRdzTaArhg3uQd3q9c=; b=43PPc5vg0SnEsmuM9Iqm+8akrfyJjnP0y2fgzkVraJz4IPeWYBXOL/k6qGXsDfyUj4OwcGkhXeAmSqdiGq5RMhnsOlX5j1atf70XzMyW2s29RQWL0TfTum8qbSuRpAtv97aRv9oXY63yDyhLY37ohOvCAYrOsH0tHkFRgwlgjFY= 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 DS7PR12MB6311.namprd12.prod.outlook.com (2603:10b6:8:94::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Tue, 13 Feb 2024 09:39:59 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529%4]) with mapi id 15.20.7292.022; Tue, 13 Feb 2024 09:39:59 +0000 Message-ID: Date: Tue, 13 Feb 2024 09:39:55 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] common/sfc: replace out of bounds condition with static_assert To: Stephen Hemminger , dev@dpdk.org Cc: =?UTF-8?Q?Morten_Br=C3=B8rup?= References: <20240118201843.189978-1-stephen@networkplumber.org> <20240212054917.12475-1-stephen@networkplumber.org> 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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6UdcP/0/kEp49aI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Zk= In-Reply-To: <20240212054917.12475-1-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0568.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS7PR12MB6311:EE_ X-MS-Office365-Filtering-Correlation-Id: 56b8a7ae-fa4a-4ef7-b7fc-08dc2c77bee3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YnobZ7syLLDiXkCc8JJ4aPuY2cLoLsGFL/bkZREnHTiIeUJuPzV80aDWJrUgTQz+4/u0sPqhmRnGpqFbRJNWID4nDzZnPx9zdK6XSzcLVfa6GqBud6YVoz2jSCdPrWHw2Be/fIRTxNevl4iUPWNpYtJGLAPSn/XQfpt3ZB8zX8LwW9+W2sdZoXzKEPgNQ+WbIsfczOn6jASlIYFnPZ0kvsQcrZZ1hVzs9l44zT9guuBhVHRFv/x/W37i79StTe27zSyU2rxAdABdkkzGshW1yGA0qhkpAmd1qbMHu0NMbJ2S3sFI1FUf0Y+WlRSypTgEBa8CdTyZHg4xtWRJZkxApz1F1L0zRIx4ft+FjvJ3Ybv8MoFweEZ+RghraNWTejvCd9SogFvqER2MPF+WGNk4pMSG1qyIQaYaXWFCGJzv2LkhnjSN/7m48qdqDqCf8Om87U+wjZGT6Yv6vyxM0049QE3Oj44dAYSjC7M2SzrtkJldFjvumKuI9N/09mLkxHa0aNHUAk9dCOZQH92b31xZ+qZsBSZo8vIs92b6bWdMtXiKPlayWu7DDmZDxodIADja 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(31686004)(53546011)(6486002)(478600001)(41300700001)(5660300002)(8936002)(8676002)(4326008)(44832011)(4744005)(2906002)(66476007)(66946007)(6506007)(6666004)(6512007)(66556008)(316002)(26005)(66574015)(31696002)(86362001)(83380400001)(2616005)(38100700002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UmhiOXVYSHg0dlBLSGd5WFVvMmVMbzBUN0pOVUo4U2VMNktKTGM2VVdvTWts?= =?utf-8?B?M2JNNllIMFZUTmIyWW4vWnlIUlJCdEFTY0FpMm5jaUJTd25sZ21kNWtSVXFp?= =?utf-8?B?OTNIZVM0dzYxU0hGUzhRNlhZR1BPNnNWZ1ZFS1VHcVJadE5PSnVObzBmdkww?= =?utf-8?B?U3NvOEYvb1BtMk5kK2pLaXVHSVVQSThNSVZuaFRCQVc5ZUpwV2VuQjJ1TVBD?= =?utf-8?B?dTNDRDV4ODAxaHhPL250NmttaFlXdDdVd3lpQWQzTjJtY09RREZRSWtYVjYz?= =?utf-8?B?WjIrSEJVdm55VFNBOEpobHlyRzE5M2pQUVN5WmhYeTFRdnRWZU9oMjhTOW1R?= =?utf-8?B?dzdOQ3VhcXpSWlIyRzJVUnh5ZUlCQW13ZG5JRkdZVkFKRFc0V0VkTndOaVRZ?= =?utf-8?B?aGx5bWpLSnZWTytKa0hCeEFUNFR1ejUwOGdBN3A5YnMwbmRQcS9McjlVMTZI?= =?utf-8?B?a1liMjdPS1p2cHkzbkt5U08zYjc0ZEEzWFpwdVlpOTduVXI5UEJtTnd5bkZR?= =?utf-8?B?dUhjbkwvOHpyRlE4SmloTHVkNmdLMFBOOHhwQUZqVnpmc2VHNjg1L0dwZjRh?= =?utf-8?B?aSs4U1c4NkpKMTF6SCtRVm9UUlpZQT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lMK0Y0aDBITWdZYUF1bEFjUFBSYTF5UzN6Mzd0by9B?= =?utf-8?B?amQrUW0yV1QxRTZKY2o5ODFNQlRmaW1kcENsQ3VOSDZJSU9DYXY0L0NzZUp3?= =?utf-8?B?SG1zYmR5dmloT3RYbVY3UWdrUHRzbHNJN3h6eVM4ZCtvcEtBRlo2NUZDWXdI?= =?utf-8?B?cjd2L3VDSkJQdkFLaVFwY2wzd2lBN2plb1RjSXpZT0w1K0xlT2QrelR0VmR1?= =?utf-8?B?TUEwYXlTek5paXZ2R2Q1OWF6Um93WjhMa0ZJWTVoUnBUVDZXRGJoNE5HUWI4?= =?utf-8?B?RXpYOGRZam0wWlJoeHpmTnJQa2xIRlNET01mYXpROGY2RVpFV1M0dDlMaC9C?= =?utf-8?B?cmZwS2tGMnpiMHR1NFhVNE5YYXlzdHhFRkhWSkVyOFRyTlZLbXBUOVhCSFlt?= =?utf-8?B?RGNhMTVSaFVZUU1EeWZtWDdleldKUCs2SkRrKzk2Mnd5cmw4L1hpUzBseHBB?= =?utf-8?B?VDhHd3UzeU4yd1VqMlBxKzRSZW1VcDV1L2V3RDR0T0ZnUEZkeFNnMnNweExi?= =?utf-8?B?MXB4eDZIQ0xxZTV6M21iM1RKNk5mWVdRNVdTSGdacmovNy85Qy8xZTJkT1Np?= =?utf-8?Q?HHj/QYeLLgnzXLtPWuPgvBAvL?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56b8a7ae-fa4a-4ef7-b7fc-08dc2c77bee3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 09:39:59.6744 (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: LMGPfED7Hl0iH3KFshLfEHGVn6mI8iGOouw0XMGrWUQ8Ls5KAs15arL6rIQotNg4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6311 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 2/12/2024 5:48 AM, Stephen Hemminger wrote: > The sfc base code had its own definition of static assertions > using the out of bound array access hack. Replace it with a > static_assert like rte_common.h. > > The use of null pointer to compute offset is not always a constant > in older versions of clang. Use standard offsetof() instead. > > Fixes: f67e4719147d ("net/sfc/base: fix coding style") > Signed-off-by: Stephen Hemminger > Acked-by: Morten Brørup > Reviewed-by: Morten Brørup > Moving ack from previous version: Acked-by: Andrew Rybchenko Applied to dpdk-next-net/main, thanks.