Re: [PATCH 00/61] reduce use of rte_memcpy

Stephen Hemminger <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
On Thu, 20 Aug 2026 09:31:40 +0200
Morten Brørup <[email protected]> wrote:

> > Many platforms have no special rte_memcpy() and just use memcpy().
> > 
> > But many analysis and test tools know that memcpy() is a special
> > case and check for overwrite, bounds errors etc. Therefore memcpy()
> > should be preferred wherever possible.  
> 
> I think this is the only substantial benefit of replacing rte_memcpy() with memcpy()!
> Could we reap this benefit by having special builds for such tools, where rte_memcpy() is modified to use memcpy() instead?
> Then we wouldn't have to compromise on performance.
> 
> Also, rte_memcpy() used to have a pragma disabling bounds checks due to some Intel drivers using [0] instead of []; the pragma was removed from rte_memcpy() when the Intel drivers were fixed.
> I'm not sufficiently familiar with analysis/test tools to say what they can detect when using memcpy() instead of the copy methods used by rte_memcpy().


The most common one is fortify which is runtime checking and part of Ubuntu etc
build. So no doing some #ifdef FORTIFY_SOURCE really is not helping.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.