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 4279343279; Fri, 3 Nov 2023 13:44:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB8724027F; Fri, 3 Nov 2023 13:44:22 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 1659740273 for ; Fri, 3 Nov 2023 13:44:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699015460; x=1730551460; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=8A0zOhtMydknnxBa0JtHK1OpoHfqpfCCPBHPWLsDK0E=; b=GJ24GsmQ7fvPeGUWWbBcWda+AODx1WLGwos7OOE8JA4Q4+V/SOjxBLxg CXxIu+dd4sl94N+zks5gA558j4OK8tM6fOgqGMe+b5Kb81QxfEeg23IWs kovoqsYv+815MY1XMQrc03+iMcR9dgNEvz0UpTUXLelDGxGunkFAC4dbk oTCdrRLmXhhe7T46jAz41D5wWcF+hVF9tFnj+ImkmQGBE8a0MTWOmjZ+n kkn1gqIRbqimMEgCm15p3geXhMqJyr2kG2P0YuT9Mp8+OKZJaMmZJaumS Y71bzzuKCLl115sGGliqP72Af879TwdSnC3GWsBAoKBEpOQwRc9lCP5MG A==; X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="379337715" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="379337715" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 05:44:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="738067264" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="738067264" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 03 Nov 2023 05:44:16 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.34; Fri, 3 Nov 2023 05:44:18 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.34; Fri, 3 Nov 2023 05:44:17 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.34 via Frontend Transport; Fri, 3 Nov 2023 05:44:17 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 3 Nov 2023 05:44:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I/j9Pd0ryBQ/ECuXmHP1nPYuZ8RyKgVWlsZne0G/x5GXdCMftUBjtHDsUQSVY9AG+SAyZ6/FccmWNB4Bwt9YD9SZdrRm01QCYscdHwgMg8i3QIIz/VTS0Dz5i6NJDxWB7GehBE8MJHAx5kZnsf+HOPsAFBTYey46EBd5V8Q0JGJ2S0kAl55y6FxqSQlNfIRSQN9tn3QlDstiYJyjaHTd9iFGMK5zeB96vh8in0yNsO8MHMP7JzTdeXn8nMtQzudgm9s3mGjYVe2k+3fGOXEUmn3sIQypfTTfiOt2fYV4WCv8qPN1bX91991HFmxSteP9rc79c7YgkSbS5gHyYzG+Dw== 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=8ZGY0weMXn1Qa1yEJlyE+rVw0JQCNE64vuWXqOlmjCc=; b=O0gFNRo/vjBB61nJ/7w8JPX6+TU2/awoELD+wUqOHUbMwJbJMDhxDLXSf2o1aWJmbkinPTs0fDpNYaiZnj+qsiPz0xCsF9S3egJx/bOh2t8wcbKzgaq78B3zol+2ISBXmSRP7A0l0q1h7tSxRwL3PV5PvWg7UhaqLDLIheyACeZ9P7Ujg5EDhN8/pTOl0SPsPFqhVTObq/pSvuzvkf+1dD47OD2eW8rBVFg45M4s0b1d88WP/Zs06sMom34SIQEKgiM/TpMEmNSuNCJPbjaXP596SCQncF8VzPva5r7laqVvROjlMwDxY1C6whQDwB+UFPLPayfk0Iu32xaDHGBKTQ== 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 DS0PR11MB7971.namprd11.prod.outlook.com (2603:10b6:8:122::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.26; Fri, 3 Nov 2023 12:44:14 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d70b:11a0:d28f:ec44]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d70b:11a0:d28f:ec44%6]) with mapi id 15.20.6954.021; Fri, 3 Nov 2023 12:44:14 +0000 Date: Fri, 3 Nov 2023 12:44:09 +0000 From: Bruce Richardson To: Stephen Hemminger CC: Subject: Re: [PATCH] eal: add const to init function parameter Message-ID: References: <20231102181148.56930-1-bruce.richardson@intel.com> <20231102115541.4dea4945@fedora> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DB9PR05CA0006.eurprd05.prod.outlook.com (2603:10a6:10:1da::11) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DS0PR11MB7971:EE_ X-MS-Office365-Filtering-Correlation-Id: d21585db-e720-4f82-86dc-08dbdc6a95d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XTPnYuEGBbdkblpnSXdNmNUGC7fxDzQEjOQF5DlxS4LuWJ7ObEA1x7ANYp5EXU/XYQIV8qktg0NDmLi5QxVnsTwdWWjmsBg26bi4LdoX6DhU0Gym5OKINS2EKNsD26iompqFJjh4ebNRGnMSd5JgM+UN4atZJ+OSvJRTNHKxQmIljUQVEGOKo+s89UhSSBSuYKFc9RnrehvZ2OUDi2sk5ZfRfo4KuWHpvJRtDEC9gsV89TsB12zYjCLPM8AT6Lip7/x9k7I11ggXdvJ5GJm2QGPJtpd3QzVjLhgE08zx7MQMwGK4zqwcHs/E7YeW6cZZvM1tkzmY/pxqL0P7SV+O5xqOnhiaPoBwkW629dlwb7xT3Z4GhyYMVx0iDeUJXuAdfYAxtZ3slqtrqhgAJgsi8vxcWLChGgsFYPZQC4vXd1K/21jpVz/1YRdDUnDjlfGD+bJHmQEifI9+LsSTxLi7SN+KhWi36AX+FdMdLqvaDyLMCrDfZANeMZC8059HpYs+ycNzCUR1L6afMwbTIZZTAPD1S5qZOLK3J0s+96aj9V8t0g2AEOJchHcrgoQaxMo2Nvr11r1ZtLGO8NwMIhikwHMpBSfT5oJNPbSxLzJPLO4= 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:(13230031)(346002)(136003)(39860400002)(396003)(376002)(366004)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(26005)(5660300002)(6512007)(6506007)(6666004)(44832011)(82960400001)(316002)(8676002)(8936002)(6916009)(66476007)(66556008)(41300700001)(66946007)(86362001)(6486002)(478600001)(4326008)(38100700002)(2906002)(60764002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ldpfwCY9d503PySgGuAJ0yjytfw8TNuNaEMGeKRGInnevX5Sp6zzVwkoZbMk?= =?us-ascii?Q?hDuBwAxdKJLZoaN4n9YuXjq/xypPleq3ED1uHod+Nw53BWNXPSpVXpSB1IdO?= =?us-ascii?Q?toUbOVpPx1qEIBszU6cx9gX8P4WzGHre7izHoPHPt7jbjU1Ufr4p0f8JmAUh?= =?us-ascii?Q?rzlsPdQt2vIWOVxy/KrmBKGGEo+tVlLbI3mSTSMFP88GD1uuzxS6VadHl2l9?= =?us-ascii?Q?1XTYc8aUwcb1JWI2yO6U9EYwWJ1vLYJGLE2jbt6EZXtHch/FCZR47MWOlmr7?= =?us-ascii?Q?lOLP3+uu3Ga36zz+CmlJkglzPiZEFpUZG0V0f0x/vrtNtzBOXq5HbOYHj4a2?= =?us-ascii?Q?6SjwAAciwu43Qe+YYSNxSiBegRdjwPFql3znSFcf9ul9MzpfQHWH1Ev3UT8i?= =?us-ascii?Q?B3ga12qJPRCJKlXruhXXbsKgyFDBjboU1kO+3RHMLmKlD06uIJxNWnH5ElLi?= =?us-ascii?Q?35LzXrVyFXIJXY76wUMfV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ascii?Q?44pjk779TSP+B8Xa2ZPyIjk2tcljnHGsU3wqJs5heKoOiTrw1oJYs16cv3WI?= =?us-ascii?Q?4AbOZ5lIr6AuNWyWVh5tF7+4cQar8Zkgtde0XvXeamSvpKzmUgtW50d842Ui?= =?us-ascii?Q?uG5J0E+FLoQWrgbC+YIzS6meZMWU7Jsp+p4jIaV7yoJ+eFGvfpdLEYMJiIdz?= =?us-ascii?Q?qcdX8F9t7Ng0o3XY5pAs5SJB2TGklj1vVwL/smKvATy1P2zGRSHr78BfCbO7?= =?us-ascii?Q?kQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: d21585db-e720-4f82-86dc-08dbdc6a95d9 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 12:44:14.3933 (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: tsQCH/FXOIvy/FmXjukOBGOR1dx2f9zWt4ImiqGGYkGL1AyymhFtvs5YHdqovTv3ZtCdYHqtBu9AEwIBEPbeX/Lp4QwJo6PWWT7FB5jHqr8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7971 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 Fri, Nov 03, 2023 at 10:17:49AM +0000, Bruce Richardson wrote: > On Thu, Nov 02, 2023 at 11:55:41AM -0700, Stephen Hemminger wrote: > > On Thu, 2 Nov 2023 18:11:48 +0000 Bruce Richardson > > wrote: > > > > > From: Bruce Richardson To: dev@dpdk.org > > > Cc: stephen@networkplumber.org, Bruce Richardson > > > Subject: [PATCH] eal: add const to init > > > function parameter Date: Thu, 2 Nov 2023 18:11:48 +0000 X-Mailer: > > > git-send-email 2.39.2 > > > > > > Change the parameter type of argv parameter to rte_eal_init from > > > "char **" to "char * const *", since we don't modify the argv > > > pointers passed in. > > > > > > Signed-off-by: Bruce Richardson > > > > Looks good but probably needs to cascade down a few more levels > > Yep. I only did a quick compile test, which passed, but I see the CI has > thrown up a bunch more issues. I'll do a v2 later. > Actually, this is not going to work as a patch. Marking as rejected in patchwork. This is because after parsing the EAL args, we actually assign the last arg handled, often "--", to be a copy of argv[0]. In short, we guarantee that when we do: int ret = rte_eal_init(argc, argv); /* error handling */ argv += ret; argc -= ret; that argv[0] is the original program name set as argv[0], and so application arg processing can be done in the usual way. Because of this, we do modify the params, and so can't set it as an array of const pointers. /Bruce