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 6B16945C78; Mon, 4 Nov 2024 17:15:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DC3F4028E; Mon, 4 Nov 2024 17:15:05 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id C215E400D5 for ; Mon, 4 Nov 2024 17:15:03 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-20c7ee8fe6bso39971865ad.2 for ; Mon, 04 Nov 2024 08:15:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1730736903; x=1731341703; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Jl1Ul+8/tE7mTVLfij/d90hGm2JE6tAz8cOigh2IdVI=; b=qBfkUMXJcBsUwjnVb422IwfWcZEEAd7ydLIwB06uzEPdBLJ9gbJ2uD3aNZ/5prqv64 LwMqBBU263fmAZ3DGIyk8GZVOT7k3HbzCY1ajqt0JFH/eUo3sD7jK26NWlWuG3WWdDQX zgasZftVu//soBQ6nH97QaHxsEo+wti5YGoFNS3TqooEVqKxV0SVM/41/t89KZdhBz5V D31slNoTWbP77C0XELirftGWPX/+Euz7JT3fpdcI6fp4HU12cKBq0lrFvKvB1fhg4GOe 7wg0IHQJt2ThsJOurFR/+wjmm5NUX0RwHbtPccsDERzfCvh73JNS16OnxqPomEX1Hj7x rWMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730736903; x=1731341703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jl1Ul+8/tE7mTVLfij/d90hGm2JE6tAz8cOigh2IdVI=; b=jTVDTHkIQJ4U/ah00YiWZRZIoL3hFu+hXDNRdnstK7Mss+AZsJEWRWZ+/ylPLnZNJe yaTFusL+h66QUKrb0lA9LZaQu8iuaUefROMiX5ndo4RE9hkJCuGi6n1Is7JXSLRPQZQf PkGEinqARyNKYSPgHtOJmUW2Q7iyBhgrWt27R8DzvJecBn12VJjUaOT9XIZ8ovQh6C9e 2KwAklRiHEOAEk4Fm6gMo0f3wFjzUaa5Y9IKdaf0wRtIVIjga5QiTcDDgW7f5/GmAZlr Jylqu4tXOnahx9xckrus7qtv1xltrogt8BwIx5pzLRwqBkjX21CKi4hWq7SZWRa2kzVH UKLw== X-Gm-Message-State: AOJu0Yzk3a8IBLy+USlxwmRYN6rxURiZjhnNG+3M0a5pAXGxTzwONdwH UeFJvKYVYGIWrIU8UcdBhDiYeBDlTjf923cEq0lGX/l3QjDs00Jymkx0KZexF0zpYx82gSpAXbs o+5I= X-Google-Smtp-Source: AGHT+IFBPdncyslKWxXvrRxu7pL7iYa5l4Svxu/kIfj/X2Q00vc+42o1PPBC90AKghyGy+l6WITKQw== X-Received: by 2002:a17:902:ea0e:b0:20d:27f8:d72a with SMTP id d9443c01a7336-210c6cd6531mr430646055ad.61.1730736902711; Mon, 04 Nov 2024 08:15:02 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211057a72a2sm63130305ad.170.2024.11.04.08.15.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 08:15:02 -0800 (PST) Date: Mon, 4 Nov 2024 08:15:00 -0800 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: Subject: Re: Risk of rte_ether_addr_copy() causing bugs Message-ID: <20241104081500.6a757ea6@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F86F@smartserver.smartshare.dk> References: <98CBD80474FA8B44BF855DF32C47DC35E9F86F@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 4 Nov 2024 13:11:02 +0100 Morten Br=C3=B8rup wrote: > Unlike memcpy() and other copy functions, rte_ether_addr_copy() takes the= destination as the second parameter. >=20 > Not following well established conventions adds a high risk of causing bu= gs in the applications/libraries/drivers; it is likely that developers expe= ct copy() functions to take parameters in the usual memcpy() order, and pas= s the parameters to rte_ether_addr_copy() in that order instead of the reve= rse order expected by rte_ether_addr_copy(). >=20 > How can we fix this? >=20 > One way would be to introduce a new copy function and mark the old functi= on deprecated (due to risk of bugs). > Does the community support such a change? > And what would be a good name for the new function? >=20 > Any other ideas for fixing it? >=20 >=20 > Med venlig hilsen / Kind regards, > -Morten Br=C3=B8rup >=20 Yes the order of arts is confusing. For reference the Linux kernel has ether_addr_copy(dst, src)