[PATCH v7 1/4] net/bnx2x: fix warnings about rte_memcpy lengths
Stephen Hemminger
stephen at networkplumber.org
Thu Mar 9 17:23:32 CET 2023
On Thu, 9 Feb 2023 17:49:31 +0100
Morten Brørup <mb at smartsharesystems.com> wrote:
> > rte_memcpy(old, new, sizeof(struct nig_stats));
> >
> > - rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats-
> > >mac_stx[1]),
> > - sizeof(struct mac_stx));
> > + rte_memcpy(RTE_PTR_ADD(estats,
> > + offsetof(struct bnx2x_eth_stats,
> > rx_stat_ifhcinbadoctets_hi)),
> > + &pstats->mac_stx[1], sizeof(struct mac_stx));
Stop using rte_memcpy() in slow path like this.
memcpy() is just as fast, compiler can optimize, and the checking tools
are better with it.
More information about the dev
mailing list