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 3E199428C0; Mon, 3 Apr 2023 19:04:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1699241153; Mon, 3 Apr 2023 19:04:23 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id BCC0D400D6 for ; Mon, 3 Apr 2023 19:04:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680541461; x=1712077461; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=PF/bwcjznUYS3aEItF8zoF8Q3t/8+ErXFr8a0jzDY6U=; b=VhdhQWU9IbYdv/UeATZyhaneQBcEUkbtGwoNZKMqQAnWRhGo6onRyR8G hcXTDEBN9aSQ2ltPjhUZLaHOLMWpIXB9/Yom3AfyJq/d+szZEzPyTZtxt Ckm4npUdYYd5xWR0ZhZ2YkQ0Tk3DiLvAm3uZk4xif6xlJfEsU9m+U2hat zWOpT+I5U+cBT2EjYj3tHspfROW1NBi8i5h7n5Al03KuxxjD6wywBxFEl fLd7kCR+jbtSzmFgRG79B510jJRQ5ZCS15Vb4TbBMPW3aseDt3vGoX0C4 aTut+esWOFg1wVvCH0Nk6H5UJOT072/5SUM3xwYbOaRm7LYVnrsYOomC/ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="407012473" X-IronPort-AV: E=Sophos;i="5.98,315,1673942400"; d="scan'208";a="407012473" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2023 10:04:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="860284119" X-IronPort-AV: E=Sophos;i="5.98,315,1673942400"; d="scan'208";a="860284119" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga005.jf.intel.com with ESMTP; 03 Apr 2023 10:04:20 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 3 Apr 2023 10:04:20 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 3 Apr 2023 10:04:19 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 3 Apr 2023 10:04:19 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Mon, 3 Apr 2023 10:04:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nhcQC3JCOLopL1yD0A54l25nUXbwmDLvx0p7K72behM2HhapY7/PT+VGLOILrjHQbbVhxagt0ZYqIXjAoPIdD/05f0NeHLdYzkX6TwLiHVl/xwUL/Fe5D9itqztsIBcGy/Lw2V/FyXuXWaf6Aqcr5D++CVYCzYLPqgwpGMRvjkDk5m2C6vOzy7tdtJdBYqZtpykFIp/E3n7qr41IUfkUebRHMOC5AJsat0DXLSM/RZcF3ImQq5eJyMWYeHmKI2KcZmAXJvKo7tM2Kr5rVCFE/SmyVU1rlOri4jvYYYfDaKEKitvKdc70+bcFM8BcT/CwUbJwE3fe16+kG/l8xQ3bTg== 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=MhDV67/G4E8pSANRUEJJrbuWqYRnj+MmQ/8SX+HbH5A=; b=nU3GPfK0v6j9S3zXHWmiSwS/aUchGWf102l6s++vDtmpu1NR1B+CkWECt0Xkw+gyMmtmEAGJQswzTUtjlmLn1oJ2lV7sFsfePWugBR0H1nHKtu2GDeMyhBoh5vco1NWn3y4XI5ZasAgpjMcB/rsbZy02ImB0Sm1t5lSOeGY7+uuI83LVej5d+Wcs99LyJ3wwYHpDzLhLZcn0OVP7nsThbdEDRkn688Ujz2GPW9BSFItn8zDg4M8oaVk2uWoqLbDKmwvZoDKi1XNYyDsHaQ7m3UPkoyhc5a/TBLuNHG/wtxNaWcuJbQRWPl4rZFBtreHKzV+0rj6kK6im73oVxwHpfQ== 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 DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SJ0PR11MB6718.namprd11.prod.outlook.com (2603:10b6:a03:477::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.28; Mon, 3 Apr 2023 17:04:16 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c%6]) with mapi id 15.20.6254.030; Mon, 3 Apr 2023 17:04:16 +0000 Date: Mon, 3 Apr 2023 18:04:08 +0100 From: Bruce Richardson To: Tyler Retzlaff CC: , , , Subject: Re: [PATCH 0/2] improve code portability Message-ID: References: <1680539424-20255-1-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1680539424-20255-1-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: LO3P265CA0017.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:bb::22) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ0PR11MB6718:EE_ X-MS-Office365-Filtering-Correlation-Id: 4842094e-72ce-4cdf-b183-08db346574fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fhe8eZkxqGBjEMcDUgFJSjEp/7FWtcX0KuwFXcqPxQjSN+axq9ewV1W4j1flsMOmxE0kh6IXY5U2xZKPQUccK8etLkoVctwbKfxrkmfu4CYOaOAYv3KfxKVPeEzBClzHV3iCQh/Zz+BFseK2W6KhcJSUszjjXEz81LBOHakxK6v66SvtUBH7LlD/wdo38ix5zxxf+9JjMvNW6cvFAKQuCMavDSic7RlnlqgLlZkKv2HpipAu17/cVYVVMfZ2S9NhfNVrt28wQQwoRfWYdSK1JEBv3h41ddJz8GAUUQ1ru5VQYjcDVhEkkRXS1vEXiSu8pzaxSQvOyjGv7Qo+pJT+9K8AlPvYR4DZR7/yRUfEckBOrTMhG4BIppdeeuKsNXbwVjgkiaSZg7Hx5UIpFncsoLOJIQIlKH7WbXhnsNNVZ7oUtHjd+XDofmN9UrDZ1TM3B61Gfd3KE7w+O8HdZmOMvW9KrKmkgkzpT+jkG4oC2+s47yy/yyPxfejkMKYJof9ox36FJcCYWqQgJRSnQPMYcJ1e7AoNOF9dmm31FuX/0PagSHozh7lR8+aYg5uY45uE X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(346002)(376002)(136003)(39860400002)(366004)(451199021)(186003)(83380400001)(6916009)(66556008)(6486002)(6666004)(6506007)(66946007)(66476007)(26005)(6512007)(4326008)(478600001)(316002)(82960400001)(41300700001)(38100700002)(2906002)(5660300002)(8676002)(8936002)(44832011)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Dgh7nRJ3ctakDUfW04RntNdch98TSHUD5P0dIDbfctE7JLb4YsxbcQpwwxcC?= =?us-ascii?Q?7fSD6g4f0tq0a60DJ9GDaQ+3iQ30goDt5tmrecvSqh6SXZU17eJv1cl3YUB7?= =?us-ascii?Q?4TA8TDbuz4HNeKZr5Fjt6BLXGpOTHhDu9ltR6eOVyCQ/+boYTZwuOpMmcqeg?= =?us-ascii?Q?nk0F/xyTDkigneojCHNDk/ITdx1nwxUPf7z478S99SVUPA5GQ+XhLGQYapxU?= =?us-ascii?Q?/fBF1SobZs0EZK43T1A6njmavy6WVTTfzfRxvWiyGadJSDefPi6oMKGSKt9/?= =?us-ascii?Q?iWwjCoyBSTUVD7q1b+oSzS1tVmDmCmWQkrecsMW+MRm8q5BGJ+qEfy2QGT64?= =?us-ascii?Q?MPsykxXSbynwl/N6Ht5pN4HB4IbZZxGRDjUZRKm7QJNZoNMg10sOHVnptuoc?= =?us-ascii?Q?KfVj471zw+/TqKQQhAkUEp6wYqW6Mac8pnaM5oEbrkvYbOApT4YNBsKNTih6?= =?us-ascii?Q?GMBf7/3Uog8ermiyZbMO8fJ9K85kdCRbjQQEnxHCKqaypQfTvPc50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YDl61Cn5GsFetBfTUwEi7GUpSVwHylmGY+?= =?us-ascii?Q?GAGL7SFbVrU4+8fo9aE2/koYR6GkMWUXo7tbH95mF6h/4cZgy3R+1K447BMh?= =?us-ascii?Q?Z7jwo08aIJLp7171yu8YS3IgFDDgQq4Bvm1FWaW2NO1tJU6vkCct5Zx8/NYQ?= =?us-ascii?Q?z+2HXA1K8VK28iYxlfey673pdkpjNyD1b/swt0xr2JyoPMwr6nHgqO5Y4b8z?= =?us-ascii?Q?Kg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 4842094e-72ce-4cdf-b183-08db346574fe X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 17:04:16.4641 (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: xfDitBMjSAbKy1HgsFaM+Z6rHOOl9StgKUtZtBNoAzTIM4jNf9ZuDPYt6vMneQpiS4Of17AbM2oWHyABK9NWTQNm1YdY3h3mcuEr9Y50ifk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB6718 X-OriginatorOrg: intel.com 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 Mon, Apr 03, 2023 at 09:30:22AM -0700, Tyler Retzlaff wrote: > Improve portability of telemetry code to allow it to be compiled by msvc > unconditionally. > > Remove use of VLA and instead dynamically allocate. MSVC will never > implement VLAs due to misuse / security concerns. > > Remove use of ranged based initializer (a gcc extension) instead just > explicitly initialize individual array elements. > > Tyler Retzlaff (2): > telemetry: use malloc instead of variable length array > telemetry: use portable syntax to initialize array > Is this worth doing, given that DPDK telemetry uses a unix domain socket for it's connectivity, which would not be available on windows anyway? I don't particularly like these patches as: * The removal of the VLAs means we will potentially be doing a *lot* of malloc and free calls inside the telemetry code. It may not be a data path or particularly performance critical, but I know for things like CPU busyness, users may want to call telemetry functions hundreds (or potentially thousands) of times a second. It also makes the code slightly harder to read, and introduces the possibility of us having memory leaks. * The second patch just makes the code uglier. True, it's non-standard, but it really does make the code a whole lot more readable and managable. If we need to make this standards-conforming, then I think we need to drop the "const", and do runtime init of this array with loops for the ranges. All that said, if we do have a path to get telemetry working on windows, I think we can work together to get a suitable patchset in for it. /Bruce