[PATCH v5] virtio: optimize stats counters performance
Stephen Hemminger
stephen at networkplumber.org
Fri Aug 2 04:42:56 CEST 2024
On Fri, 2 Aug 2024 10:23:12 +0800
"lihuisong (C)" <lihuisong at huawei.com> wrote:
> > void
> > -virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf)
> > +virtio_update_packet_stats(struct virtnet_stats *const stats,
> > + const struct rte_mbuf *const mbuf)
> The two const is also for performace? Is there gain?
If you look at resulting code (ie godbolt.org) the resulting code never
changes when const is added. The compiler already
knows what is modified. Const is only a programmer and correctness thing.
More information about the dev
mailing list