[PATCH 00/61] reduce use of rte_memcpy

Stephen Hemminger stephen at networkplumber.org
Thu Aug 20 22:18:45 CEST 2026


On Thu, 20 Aug 2026 09:31:40 +0200
Morten Brørup <mb at smartsharesystems.com> 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.


More information about the dev mailing list