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 45030A0353 for ; Fri, 4 Mar 2022 14:14:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 329D2427C8; Fri, 4 Mar 2022 14:14:27 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 6D9EA4013F; Fri, 4 Mar 2022 14:14:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646399664; x=1677935664; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=2Ko2nQiN100gFN5fr2JFzzr57sTZrUsGN5d1bMWpjdU=; b=Ko4q6h4tZ83+GdroU7XM6+VRj+odNyGojqSDsuwiymJ21UMVsAujCkAt 6794r/2o4lPc/L/AyYWG6WE+MKFy5OxWvjgO5rj/W1WGquOHBeIMHQVDy OmGJuz6FM1isp78ukF34Qx/NscxM6PM8A8AX7rLZUEmnX8XWTy9RTf7R7 PyOuWf+p9JtVPCZDTDV+u/PG+a8ljg0Dy/r4oIaK2bsxjM/5uP3JvSuoH kYoAlKD1bFRGfAjW88e5tMkjjaJVwD+k+8BWggQloQJJSkk22TPlUKe4z ROYvAoIfQ36L1cTwygUy+o80r32V47hdhCmYiRDoifCq6X4kBXUo3Ahh8 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="253701441" X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="253701441" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 05:14:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="686873143" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga001.fm.intel.com with ESMTP; 04 Mar 2022 05:14:22 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Mar 2022 05:14:22 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Mar 2022 05:14:21 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Fri, 4 Mar 2022 05:14:21 -0800 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.48) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Fri, 4 Mar 2022 05:14:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hvMNRKfKLV6woAELXjq6zgepP3nzLseUHiGHOR0FO0UbBJfOOq7qlemqwCLl6SSiHtFz0tMjdLfInkUpzRlWuBSInCpktbK9WS/VnKX2Vz6l2eu/7ye++rqj1otAmt/OOBTIrC5C9CDhhttqGjZq1hCtwTjsSYFm8g7CiCSzawPzbASiY9VIvAIF+eQi2B6DZWJSRAeE+tKjWIKscRsDdMuqHRF6xCgT3sTfn7acTBp3+oR7eujN/A5X1fm4PGNVp7dPJV8gei1Vgd/HNW168OQ6eIaggfyTh687l+EIBHmG6oR0N/9ViOPEAsiilNQ0XWUlBP9CSOwcQjXAas6lyQ== 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=jFrRejXw5mfnWvvwp0a3uO937Ws3SzKdv8uVwCQeQtQ=; b=FHswtmsUiBfdQznmDRqpmCQc7nPf8V0DK/PLSzJQvCWqO9tpOVEUCvamza6MFG2VpLpuDPaw/0BVeAmCEEKxihk571yIi1hhGmVKtZgalPyP5ts+76hW4OJ2T1IA4fCOy161ttgrafB30ps1o/1ukYJIixu3sm2cxyQLKnEHFLwRQ1mBAuxzEnu2/bvtjngaPFTeHFRkBt9Qyq+0s5nPTntxfmn+tJFI4Nsg++EcXQWWz3Koj8kANLyJf7WbnxxU9HGTP22Sek5YmGM2aX9XvajV19ObXP3t3f2mlqz8GxVTW9A/vOywHuFXIBCmBW5FtfUzzsKKwP+eZs+XavU6tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by BYAPR11MB2535.namprd11.prod.outlook.com (2603:10b6:a02:be::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.17; Fri, 4 Mar 2022 13:14:18 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf%7]) with mapi id 15.20.5038.017; Fri, 4 Mar 2022 13:14:18 +0000 Message-ID: <69c7a2f3-80d9-e31f-25e0-310e7bd938d4@intel.com> Date: Fri, 4 Mar 2022 13:14:11 +0000 Content-Language: en-US To: Vamsi Krishna Attunuru , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram , "yux.jiang@intel.com" , "stable@dpdk.org" , Wei Ling , Srikanth Yalavarthi References: <20220302120701.2749772-1-vattunuru@marvell.com> <20220302134654.2760076-1-vattunuru@marvell.com> From: Ferruh Yigit Subject: Re: [EXT] Re: [PATCH v2 1/1] common/cnxk: fix static assertion failure X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DBBPR09CA0010.eurprd09.prod.outlook.com (2603:10a6:10:c0::22) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79065a1a-650b-4a13-7539-08d9fde0e37b X-MS-TrafficTypeDiagnostic: BYAPR11MB2535:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XRRc52yrcVWJ8NPYzLKUqXFWohGxyBBqLWeS+Segg3CRZmLAnyvZC08dvYeoDz779Etk7+GBqXGdUHa2NOzF2nUQp6uTlGjBH2LrnVn7qeATrZhbchluBEAxFRig/YQU5e5yqHaf+EKxIY8nehKgdJ7bPhe1a1uFdZrVz/2Q+4VDWUGFAYHJkiBqCmRIJnPYZKo3D0Lq5PJWtSW/RJ+8aDUDGJUZ1JB7n3G8aenVSId0Q6B3zgbz9xCh7/nEZgoE1nl3JUUrSig4Liqqse1nkr87L0ksAjUr/kDMy+tttrfHLYpJU9CzNT+PWSDys0Mpn5ZfXldxp2P34YHni07JcSljKSM41V7u9I/Q6fDd5Y2Nw5zr0dUMa88N7JeQInmI1Wffi715VnSggL39VfPFcAQ+GtZt2BY9Asjoicih0vAYEy9sx0qk0fA+2/2cJgoXzifZ7g0sDatdmcbKq7cnIJqucvUA7ZjzPGaTJ1fr21giBwa7im3Y+B3kEnshmI6wAvDdYFMBCFKHpZiViOBZOKgkqiARsKYNRBpzw4g8tzVrjkW3TJEkwsDoBwnez1hmONEcdjHK1Uk8RT3U9xfXZURPS0I1MjogfigDyUFEobg6gfSda51wy3RcKkz9I+15Wo34hD03XccgosBLr62xtw5kDLhSFOPUIZDeULUm72OwglXR/kWnqzJXjbJv/R5YpaYGp30jwCb8yHOprnE0Pw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(82960400001)(508600001)(38100700002)(8936002)(26005)(2616005)(186003)(6512007)(6666004)(6506007)(53546011)(31686004)(6486002)(2906002)(8676002)(86362001)(66946007)(110136005)(54906003)(36756003)(44832011)(316002)(4326008)(83380400001)(66556008)(66476007)(31696002)(5660300002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eWF0aVBFZ0hXc1MxVjFLSVRKM1BpdkJ3WVJxM3cxSlNXUk5RZ0Q0aVB3OGJ3?= =?utf-8?B?dkVpZU4xVTNHUzhiVm5wYXZOaDRKcFdHZnhoaU5EZEhNRVFHUktUVDlIZ29p?= =?utf-8?B?VllIbndxV2VUZGlSM1RXWnF5VE1HZjJycjgwdXFaUk14TWZIancrLyswVXVU?= =?utf-8?B?T2pjNGl3TVNKMlVRUzh2NkV3Sy9ETW9VZE5iWjdtK0xzYW12LzFQUGpzNkNV?= =?utf-8?B?WEJPU3FpSzZXc211bWY0M3o5U1I5SW5leUg0T0k3NlU1N0ZnUW5GL1VESjVP?= =?utf-8?B?a0ZLU3NIZmls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OYzFwdUZGRnlSRHN3c1o1UGd3?= =?utf-8?B?blFyVThSY0g3Q01HZkJPMTgyemxYSm1QWmZFS3BhVUQ4QnE5eHpGbWtHYUxU?= =?utf-8?Q?Y3KU/j+d8l/6wJxwgVlqoOA=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 79065a1a-650b-4a13-7539-08d9fde0e37b X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2022 13:14:18.5030 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Dp1jMzvQwO6ddVV+8xF/p0A4ca5oSM7G5Mg7klQijAfRd2ElyNKhdmesvUDoxRpZxovVuSRPTpRZNdPQb2dtwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2535 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 3/4/2022 10:20 AM, Vamsi Krishna Attunuru wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Thursday, March 3, 2022 10:52 PM >> To: Vamsi Krishna Attunuru ; dev@dpdk.org >> Cc: Jerin Jacob Kollanukkaran ; Nithin Kumar >> Dabilpuram ; yux.jiang@intel.com; >> stable@dpdk.org; Wei Ling ; Srikanth Yalavarthi >> >> Subject: [EXT] Re: [PATCH v2 1/1] common/cnxk: fix static assertion failure >> >> External Email >> >> ---------------------------------------------------------------------- >> On 3/2/2022 1:46 PM, Vamsi Attunuru wrote: >>> Use dynamically allocated memory for storing soft expiry ring base >>> addresses which fixes the static assertion failure, as the size of >>> dynamic allocation depends on RTE_MAX_ETHPORTS which varies based on >>> the build config. >>> >> >> Hi Vamsi, >> >> "fix static assertion failure" is not enough descriptive. >> assertions already added to verify assumptions, and in this case it seems it >> failed, but what was actually wrong? >> >> Is it that allocated memory size for ring wrong? (this is what I got from >> commit log but I am not sure) >> >> Can you please describe what actually was wrong and fixed now? >> > Hi Ferruh, > > Earlier sa_soft_exp_ring struct member was an array of pointers and it's size is linked to num RTE_MAX_ETHPORTS, > and the whole struct size is confined and protected by size assertion. It resulted in build failure with -Dmax_ethports=1024 > option and assertion caught that failure. V2 fixes the issues by allocating the required memory dynamically instead > of using array of pointers. > just to double check if I got it right, The failing assertion is: PLT_STATIC_ASSERT(sizeof(struct nix_inl_dev) <= ROC_NIX_INL_MEM_SZ); Technically you can calculate the 'ROC_NIX_INL_MEM_SZ' as a function of 'RTE_MAX_ETHPORTS' and that would work (although need to calculate size for proper cache alignment). But instead you prefer to convert array to function pointer to fix the struct size and make it independent from the configured 'RTE_MAX_ETHPORTS' config. And I assume current magic number for the 'ROC_NIX_INL_MEM_SZ' is calculated based on max memory requirement of the cn9k & cn10k: #define ROC_NIX_INL_MEM_SZ (1280) If so it can be better to describe 'ROC_NIX_INL_MEM_SZ' as what it is calculated from, like following but it is up to you: max(sizeof(x), sizeof(y)) ... >>> Bugzilla ID: 940 >>> Fixes: d26185716d3f ("net/cnxk: support outbound soft expiry >>> notification") Cc:stable@dpdk.org >>> >>> Reported-by: Wei Ling >>> Reported-by: Yu Jiang >>> Signed-off-by: Vamsi Attunuru >>> Signed-off-by: Srikanth Yalavarthi >>> --- >>> V2: Add bugzilla & reportee details, remove unused changes. >>> --- >