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 2081945C78; Mon, 4 Nov 2024 17:19:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE50540E26; Mon, 4 Nov 2024 17:19:11 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id E58FF40279 for ; Mon, 4 Nov 2024 17:19:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730737150; x=1762273150; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=V6Tyb54DQedUDH3cCdykbBOsgCj4Rdi41oafsNMm9ug=; b=juqOgv836dXbF9mgZKagqRnsXWmn3hb20ZkLCS+oAS4Kqv4Ix96q7GR4 q+G3qP74+VedD1W1QXLQXxFdSnE5shn9eiGgRSKKJCf+caiJYdSpG2EPi jBE8nSH6calOp75lCG04jKdnskulr7DWzZKDBXSoIUaZhAaCweD+96FrH lEldR5sPOghYS5YyD0oxBkAAL3+kPX71LtcfCYFaiudeOj6zRSSVCQ49L eYYITnSN0aGxuPpMRlBuFVhjEvxdHRZzt0zz4HOtAePwkZ+vLI3TPd6d4 /R1VCnU/yIyKhHk0RbyEX1UqWNDk3AYZ0EfTHpvBu0xQycsUVPA9sVkhC A==; X-CSE-ConnectionGUID: qvb2mEILRF60MDpoe5mDkg== X-CSE-MsgGUID: ELtA5iAcT/6Om9ekaPQWjg== X-IronPort-AV: E=McAfee;i="6700,10204,11246"; a="55844849" X-IronPort-AV: E=Sophos;i="6.11,257,1725346800"; d="scan'208";a="55844849" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 08:19:09 -0800 X-CSE-ConnectionGUID: dDlvAJY7SfCaA4EQAkA66w== X-CSE-MsgGUID: sQ7ui6PMQ2yTwV1HexD24w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,257,1725346800"; d="scan'208";a="88528678" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Nov 2024 08:19:09 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 4 Nov 2024 08:19:08 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 4 Nov 2024 08:19:08 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.45) 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.2507.39; Mon, 4 Nov 2024 08:19:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FKBybBo17RWU5y6WCCRLT6Xy181RCPuGn44pMvbCbYpuJ8vGtocb8WdNZ9tac6oQVLaEJ+4OFC158IX1ZHJBEj+bOH3DPSxVSkNxpywAnroZRsiXSmOazkjE6V9LxTXmNq6KkfY1GI48GVWSXZlLbB203pZrMpT3fDVDOlMLTzWs+R2N1HGWklIRKR/JX5NGWWOy9IPofqiJoAkyaHRDR3VH50hGd1T6e8is6LOpJ1pR2NPoqLZUcgk9mMmPfvF2jaw84Wfv80BSTA82cYGs5KKJkpGQk7dpwInWlyqe7KafJxZ77ONQP3r2E2wLR0/1xUCqHbPZT9Kup+O9TKugvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=hiQOo4c98M+VWfYgLoIOcWpu1R0N9FC8mHmDafgOS1g=; b=T4jSQoV1qijw3m9ZvH95xYRgJkjXBh2gS8ZBjycwO9ej5YB+z4321gm9oZ4XJsvXYkUZDS+3cFFbTBy7Mu+zIqBLlVhWtNNXv/K2/tpfSvugkRNq6sEbadWQjzPPxRA/nHssLgK2uXWco0luhxE5e78Ra2eloc5jL1S+Rg5UqbQBDGOW504rAOAYDtjGHi8ol6zb3ZbrGugGEVSsQmvJNIl3J+O/Dij8iyQgJ++9m8+0BZgVioZ305Ij8m7nI6zYWJXjB5S/DJwjXBmuxGLos0Mma74EQwC22jqj2tgCFdP0wnEDrdr3KUcQW94+uPVFKcIVpEQlwF6elmVIPUtzGg== 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 SN7PR11MB8261.namprd11.prod.outlook.com (2603:10b6:806:26f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Mon, 4 Nov 2024 16:19:05 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%4]) with mapi id 15.20.8093.018; Mon, 4 Nov 2024 16:19:05 +0000 Date: Mon, 4 Nov 2024 16:19:00 +0000 From: Bruce Richardson To: Stephen Hemminger CC: Morten =?iso-8859-1?Q?Br=F8rup?= , Subject: Re: Risk of rte_ether_addr_copy() causing bugs Message-ID: References: <98CBD80474FA8B44BF855DF32C47DC35E9F86F@smartserver.smartshare.dk> <20241104081500.6a757ea6@hermes.local> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241104081500.6a757ea6@hermes.local> X-ClientProxiedBy: MI2P293CA0006.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:45::18) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SN7PR11MB8261:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a819468-3f8b-4208-e8d1-08dcfcec6706 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?igwhGKKLVTQ+ntqE2MTVdVQtDTLxUOFcyD5yCsh1GZjF2tr70ny4WwKpq3?= =?iso-8859-1?Q?UOFlOuOkAYba5UAH5OhyBaXXKZno59S0J/5v1ujSvvBCS/O7MX+ozWH5nT?= =?iso-8859-1?Q?viHAFugPL3F0aASuPOXyGxX47MJvsGEw7Xb3Cxifl/M8Dj+bx5bsuyrxGd?= =?iso-8859-1?Q?HEvJwsy0JjctQr8BmSD8k7YcrMnFHz2v95oLn1ahKZCXYjpXX0NimsjUQM?= =?iso-8859-1?Q?T1AkJ0vdiaqFqcwVz8e9Qw03hbGrAxm6ZYaeeyaIp7atVOlxX6idPX3qbW?= =?iso-8859-1?Q?rMht2ztcfXIiTFWUE2h+GcFka40zSTNUyxr2BcOqVCtb/lTRbewuZWFkx8?= =?iso-8859-1?Q?f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Ro5kxoHk62sW2xOqg+U?= =?iso-8859-1?Q?brAR+N8ZPseu8OZ5KGAAPqQmZDL3qij+7NTS1EDFHeL8Z1zME93TVUbtrE?= =?iso-8859-1?Q?1uf4KMtIkUwHTPZRsdhgeSAMsBfvh21l4aIBq6u1hXodGEtT7s2a1J53pS?= =?iso-8859-1?Q?8l0JlWoP6p?= 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:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?QOGCPrdBrkFfO/cUsU4pN0IRNHFFHHJQh6x/7WVaXV1SIPuuCu6MiqdJvM?= =?iso-8859-1?Q?5ldpyrbbsVo8zRnBxwOtCbSHmP7SRpucP9GHCdm26AkewmtwDRHZTK7kCO?= =?iso-8859-1?Q?aOa5SY/rGweW0k9b4vqq/qaABdlFgmDzQu9TPJO5QynfA5SaHwlReYxzY9?= =?iso-8859-1?Q?+loVZX3pslM2u1gOcCK9JbOHre3OLQSt84iIKwQf9l3Ccwea9R8ovjZmaX?= =?iso-8859-1?Q?gF2fE3X8KPzMzdSBXLYW3gFfxbGxzhUTrcDbPfb+osbjHTCotJ7Iv0GnyW?= =?iso-8859-1?Q?xM3ThsAUW6SzQQUGubhBXVTp4RDXhu/1s7g3ZFELUDkBN2rGKfV7snvJ1E?= =?iso-8859-1?Q?yCAHpE94Zte0B6YQvoTtmbw7LEhfWiW11gCgK9nHo0FyoCuDHleUyekSvQ?= =?iso-8859-1?Q?wzfVqhA51zmjRmYHoP7pBrSJne4/AhEzmJB6DvrsY7TtT8xYrRms3J+Tkn?= =?iso-8859-1?Q?RcUo40NsEuGfFgNAvDHs2BDA+N7VvRlYUCe2CkoKmdyj1eFitVY3Ttba4/?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MyUO1n+vAC76Td9N1gqOQq5PkYC3I1?= =?iso-8859-1?Q?pHOy1ybDxl4jOX7DqN9YeHP+PPelmZjPcF9H1ytFVQyWA+lnZ0tujry3h1?= =?iso-8859-1?Q?rrw5plBMQMmLwUvHMyTpTJqXhxfXIP+Z+FaBiyA5rjTI3Xsk4447nUbHMr?= =?iso-8859-1?Q?fVgOXKpdUh+oPFAbjtC3W6cjRrFVkAotsHrSxIvWblVO1/WKccaUW6k91B?= =?iso-8859-1?Q?UJ/tmUowwbR3XyhGn/V0ZbaYbxEJjHM+qQa6CNRFKp1nzZGlnc89Ptlw?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5a819468-3f8b-4208-e8d1-08dcfcec6706 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2024 16:19:05.2365 (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: 8dKaBa0IAka8GPqsDcKdQl/UGS1luG/Xz5iwVCK6Pl5TiLZXj0WsYVjpT7KMqDnyEc5/0K021sEIrvfvlMaO1o1Fni0m7fOKBPAQ4FenYzE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB8261 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, Nov 04, 2024 at 08:15:00AM -0800, Stephen Hemminger wrote: > On Mon, 4 Nov 2024 13:11:02 +0100 > Morten Brørup wrote: > > > Unlike memcpy() and other copy functions, rte_ether_addr_copy() takes the destination as the second parameter. > > > > Not following well established conventions adds a high risk of causing bugs in the applications/libraries/drivers; it is likely that developers expect copy() functions to take parameters in the usual memcpy() order, and pass the parameters to rte_ether_addr_copy() in that order instead of the reverse order expected by rte_ether_addr_copy(). > > > > How can we fix this? > > > > One way would be to introduce a new copy function and mark the old function deprecated (due to risk of bugs). > > Does the community support such a change? > > And what would be a good name for the new function? > > Include "memcpy" in the name instead of copy, to make the order of args clear? "rte_eth_addr_memcpy"? Other thought is to do a macro version of the function, which would mean that the name is capitalized. /Bruce