DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: <dev@dpdk.org>
Subject: Re: Risk of rte_ether_addr_copy() causing bugs
Date: Mon, 4 Nov 2024 08:15:00 -0800	[thread overview]
Message-ID: <20241104081500.6a757ea6@hermes.local> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F86F@smartserver.smartshare.dk>

On Mon, 4 Nov 2024 13:11:02 +0100
Morten Brørup <mb@smartsharesystems.com> 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?
> 
> Any other ideas for fixing it?
> 
> 
> Med venlig hilsen / Kind regards,
> -Morten Brørup
> 

Yes the order of arts is confusing.

For reference the Linux kernel has ether_addr_copy(dst, src)


  reply	other threads:[~2024-11-04 16:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 12:11 Morten Brørup
2024-11-04 16:15 ` Stephen Hemminger [this message]
2024-11-04 16:19   ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241104081500.6a757ea6@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).