DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "lihuisong (C)" <lihuisong@huawei.com>
Cc: "Morten Brørup" <mb@smartsharesystems.com>,
	maxime.coquelin@redhat.com, chenbox@nvidia.com, dev@dpdk.org
Subject: Re: [PATCH v5] virtio: optimize stats counters performance
Date: Thu, 1 Aug 2024 19:42:56 -0700	[thread overview]
Message-ID: <20240801194256.0cd2c400@hermes.local> (raw)
In-Reply-To: <677a47da-c6ba-57a9-92c7-a98df739d216@huawei.com>

On Fri, 2 Aug 2024 10:23:12 +0800
"lihuisong (C)" <lihuisong@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.

  reply	other threads:[~2024-08-02  2:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 13:17 [PATCH] " Morten Brørup
2024-07-31 14:04 ` [PATCH v2] " Morten Brørup
2024-07-31 15:13 ` [PATCH v3] " Morten Brørup
2024-07-31 22:58 ` [PATCH v4] " Morten Brørup
2024-07-31 23:45   ` Stephen Hemminger
2024-07-31 23:51     ` Morten Brørup
2024-08-01 16:03 ` [PATCH v5] " Morten Brørup
2024-08-01 16:17   ` Stephen Hemminger
2024-08-01 20:38     ` Morten Brørup
2024-08-02 14:49       ` Morten Brørup
2024-08-02  2:23   ` lihuisong (C)
2024-08-02  2:42     ` Stephen Hemminger [this message]
2024-08-02  3:17       ` lihuisong (C)
2024-08-02 11:27     ` Morten Brørup
2024-08-05  1:14       ` lihuisong (C)
2024-08-05  1:19   ` lihuisong (C)
2024-08-06  8:23   ` Chenbo Xia
2024-09-10 15:01   ` Maxime Coquelin
2024-09-19 12:04   ` Maxime Coquelin

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=20240801194256.0cd2c400@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=lihuisong@huawei.com \
    --cc=maxime.coquelin@redhat.com \
    --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).