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 AF9B643B00; Mon, 12 Feb 2024 13:09:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37281402CB; Mon, 12 Feb 2024 13:09:43 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) by mails.dpdk.org (Postfix) with ESMTP id 98A29402A3 for ; Mon, 12 Feb 2024 13:09:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WWfXAYicRfDE6LNjCTZo7rCO7HCgMFB+oyR0F514CaPoOHtOZIdi0pF/s1BdoHKOi1ZuAO0vwpANZJlN3tLBKz9vUGoz5lZeQ5WJcMhmfdI5Ixz6O8ebHiQXOQ4oBRVXn8wOabWPFsQ8msdhYQYoiYRqzgjL8jhVgFStAFmCfIP7VsfNR60gd/hPl71vYs6kCjeASdvfW1akrHa094+OLr8KjAF9CQcUrj0ZmidOcMUqwR1qKJ27UFb6wvconJErQ2AOtU166nJpirEljDHXIsvFCXPuxQLe8QRYe6c6hhNPMaRCtkSfyVH/r/XwTy/e59ZvLRD62Hju8Tulex9QCw== 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=n7rV88AiiJydbY7nSpIwk35bqCOZvLrl0V9V8yql5Z8=; b=NKLtlA2wnjTL+Bphhkx2h5Xo5KcL1luey3Tl9/PSVaJVofUX/Uc+MmmRgv0Em2pnZk/eIbVdLpfMGgp0UGI6Z3tzz6USHBDdRIb+oPH5OFDYxaoBSBo9tfUsiX1Ei+enWEnEOeRut7/PNLPSfIrvRIQNhGn1f+b90Le9WONNwieUE+LREkbA7cTmHLXe67/YhF+1AxyXMVHJqexDe61m/pHUtIGq1LcSt6PBB8sH2khM7y/dYcYKCC/Mca5UpUR6VpMGs1YYMe7XXPzMzZpWfaysnkVARLTGmDqha8L6n2Bvu3zutb+vrhCs++0f+dKc/M0iu7zUhaf+26uOB4CYug== 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=n7rV88AiiJydbY7nSpIwk35bqCOZvLrl0V9V8yql5Z8=; b=3H6wSNKj+aTUnEXKcpcDNyxhoFMv6mRIPEzvbemToKY33JVRygquYW1vp/g3ruhEPllc1IDuJv/OAjwa28ijW0t4gE52BLYR7z1ywutNr+hDeybiiidKqstSow+KruDtH8442Zxn2ExPJ6CnCtsCiaCj4h90lEfp72q/tD/WTuI= 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 SJ0PR12MB5454.namprd12.prod.outlook.com (2603:10b6:a03:304::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Mon, 12 Feb 2024 12:09:39 +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; Mon, 12 Feb 2024 12:09:39 +0000 Message-ID: <25dd0757-c832-49ae-a407-cba125632ff0@amd.com> Date: Mon, 12 Feb 2024 12:09:35 +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?= , Andrew Rybchenko , Ivan Malov , Andy Moreton 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 AQIeAQIXgAIZARYhBEm7aYjps5XGs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IZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20240212054917.12475-1-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0037.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::6) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ0PR12MB5454:EE_ X-MS-Office365-Filtering-Correlation-Id: aec1b81e-e9a2-4ffb-b5c3-08dc2bc37cc9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BwoSJDx0no7IfRvLQPy10ZV7oajlK/Gavk1uNQFEp0DiEW4F8o29nS2ml/LMPgKiGne/GyDA4MAXZEvYy0MgF+kflhY9oZQdNSniOCOAOCe8W6K652O0n8yVmTu2u8hTUi6NRwvTunKwx3KSeHKihHPs9BZ0JRknbNFONT4Ur53+WilGEiFtUrKSj7fNY/nLCrplnXHLYci/zPyk9ccE4U9lmalw0ubZk/NL99A8Dm3HmwjklAFhndIW4/nul/CU0TaR7wyD8HxsXipTL2fVEY8oLtI+XTbRJXvNFrG30VhluENC0tnbOy5GscNZKvsS2sYlht+vVucoqkkz1gIo3iO9qNF7kmfgYTo3ZXUWhi+jB5wieS9HFvS0pGWzBGzLSufCjTbw1VIV3AUaOOESdsPl2mezzCA2dOt7fUDhNBqcekSe7Q+ocC2iS1TNIzkrl+phSK6d0qQ88MZAu4PINFEO93tl+FX4k+OIFZlkQQpX15o8TpIFCSMdNQSY0w1wXY/kCs+TA/BUwm7i5bPRRrGnckq1Na5EPap2eccF7or0XBLP1IhXBsS7GL+KKtne 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)(376002)(39860400002)(136003)(366004)(346002)(396003)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(2906002)(31686004)(4744005)(44832011)(2616005)(478600001)(83380400001)(53546011)(66476007)(5660300002)(6512007)(6486002)(8676002)(8936002)(4326008)(66574015)(6506007)(66946007)(66556008)(26005)(36756003)(41300700001)(54906003)(6666004)(316002)(38100700002)(86362001)(31696002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SmtrYk0wZktHYkVhdks5UFo5ZFYyenZmWXdvN29ZQ0JkN0NJQlZIdG1wUmpI?= =?utf-8?B?Y3JJWHUzL1BkT2h2UEsrcnRON3o1WmpYTDl1UmZOL0JzYzZ5bURVUzA0NlhE?= =?utf-8?B?TmxwRk9JMndsN0RFd3BzQTluTjBPU2srZllYRUNWWmhFclZnazNPMGZreUNR?= =?utf-8?B?UW5XNUplMDZ6eTBMUDBwanVmb2NTN3hqcHRtV0pCbXJ3WFhhVHdmR1dYSzFE?= =?utf-8?B?SlRKTFVCY2dROGQ4T0Z5Snd5SzJudU94UkNQeEJvZEZ3dWpxZ0RwVU1SSDl0?= =?utf-8?B?Sm03Ni9aTGlzb2NUaTFSNWdMVjllVVlJVjc4Vlh4a2tEaWVFNWVXelRYams3?= =?utf-8?B?emJ4Zll3MjlDNzJ4dXpmd2xGVjk2eFFrVEZmN0FVM2g5UjBsVjYxbFIwS3F0?= =?utf-8?B?OEpXeUtVbWg0cGRVZnpOZ2tad0xTaVFscEM2eGVrWGxieHlqUnR3cXpmMVJL?= =?utf-8?B?aU5IUUhTaUYvOU0ranh5UXFZQkErUkMwend2dmYzWlpaWThOaTN6bGZpdGR4?= =?utf-8?B?R2FvdVNHak92U1piOXZ4QXZ6MmJoUkRxemlyMmdPQUFEUm41Ry9s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nRlh3THJtazliNVhEZHJCMHNP?= =?utf-8?B?a0dyVnV6Y00zNVRPNnIwRCtkdWxaK0hMTkdiNWpQNXZNa1pSTXJ0dStmQXZX?= =?utf-8?B?bFM1NTFYbXFrWnZkaFFER05XTlJ0OGhnUUFtdE84N3M5elN5WllSRm82VTUv?= =?utf-8?B?bnY2UHVweTlWQXdvWWtLd3VQanJKd2hyL2gyaWlhbUNxbGwzcFBBSmV5aE5t?= =?utf-8?B?bGt0OEZjWExYdDN2M0ZESGlwNGhJRklZRWRzTHpsUDNHSGtWN3c5Q3pISEx4?= =?utf-8?B?ZFJ4SzVZNFdVOFozbFFVMC9RVS8wbmNQWXFYOEJibnpWZ2w1ZlNNdXQ4N3VH?= =?utf-8?B?OHRBUHZGd1pLM1hNSlRnK2YzUWRkeExsR2hlYjBaYUYzd0svNVhERVUzVUlU?= =?utf-8?B?ZWtreXpiek1uOW5WYWxXaXRYRW53MC80UVNnK2FDQjJTRCs1WWovUjFhdTJ5?= =?utf-8?B?dllzQld5OXRUN2ppVzNPYzlTNm92T0EzeDNBVGNSYmQ3dHFHTERUMTlrYVh4?= =?utf-8?B?RkMwMmRmZ3RQYVNlMHJ5K2RTMTVJK0FQU3p3empmSkMvblNWZnQxa3N3cUhs?= =?utf-8?B?NytjcFpZOUZ2VWNCZ3Nmc1R4ZkZ5ekVVaHkybVl3aHVzakpORXdHUTNxaXBJ?= =?utf-8?Q?xV6PeZrF4zkNnn5t+B51Yplj4?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: aec1b81e-e9a2-4ffb-b5c3-08dc2bc37cc9 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 12:09:39.4197 (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: 0e3IVffzfljJZu2YdfopNGfAD419HONX66r6UQ82sflBbOx9E8h5KXRu+MhT15mo X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5454 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")> Cc: stable@dpdk.org > > Signed-off-by: Stephen Hemminger > Acked-by: Morten Brørup > Reviewed-by: Morten Brørup > Looks good to me, unless there is no objection from driver maintainers I will merge it.