Netdev List
 help / color / mirror / Atom feed
From: Victor Nogueira <victor@mojatatu.com>
To: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next 5/8] net/sched: add const qualifiers to gnet_stats helpers
Date: Fri, 8 May 2026 15:33:34 -0300	[thread overview]
Message-ID: <6b5d2268-ffaa-4746-87d0-8f16135aba44@mojatatu.com> (raw)
In-Reply-To: <20260507221948.335726-6-edumazet@google.com>

On 07/05/2026 19:19, Eric Dumazet wrote:
> In preparation of lockless qdisc dumps, add const qualifiers to:
> 
> - gnet_stats_add_basic()
> - gnet_stats_copy_basic()
> - gnet_stats_copy_queue()
> - gnet_stats_read_basic()
> - ___gnet_stats_copy_basic()
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> [...]
> diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c
> index 1a2380e74272de8eaf3d4ef453e56105a31e9edf..3b2f9ea2eb072dde792aad5b60cf00dcc2efa76d 100644
> --- a/net/core/gen_stats.c
> +++ b/net/core/gen_stats.c
> @@ -124,7 +124,7 @@ void gnet_stats_basic_sync_init(struct gnet_stats_basic_sync *b)
>   EXPORT_SYMBOL(gnet_stats_basic_sync_init);
>   
>   static void gnet_stats_add_basic_cpu(struct gnet_stats_basic_sync *bstats,
> -				     struct gnet_stats_basic_sync __percpu *cpu)
> +				     const struct gnet_stats_basic_sync __percpu *cpu)

This seems to be causing a compilation error:

net/core/gen_stats.c: In function ‘gnet_stats_add_basic_cpu’:
./include/linux/percpu-defs.h:238:1: error: initialization discards 
‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   238 | ({ 
         \
       | ^
net/core/gen_stats.c:133:54: note: in expansion of macro ‘per_cpu_ptr’
   133 |                 struct gnet_stats_basic_sync *bcpu = 
per_cpu_ptr(cpu, i);

cheers,
Victor

  reply	other threads:[~2026-05-08 18:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 22:19 [PATCH net-next 0/8] net/sched: prepare lockless qdisc dumps Eric Dumazet
2026-05-07 22:19 ` [PATCH net-next 1/8] net/sched: add READ_ONCE() in gnet_stats_add_queue[_cpu] Eric Dumazet
2026-05-07 22:19 ` [PATCH net-next 2/8] net/sched: add qdisc_qlen_inc() and qdisc_qlen_dec() Eric Dumazet
2026-05-07 22:19 ` [PATCH net-next 3/8] net/sched: annotate data-races around sch->qstats.backlog Eric Dumazet
2026-05-07 22:19 ` [PATCH net-next 4/8] net/sched: add qdisc_qlen_lockless() helper Eric Dumazet
2026-05-07 22:19 ` [PATCH net-next 5/8] net/sched: add const qualifiers to gnet_stats helpers Eric Dumazet
2026-05-08 18:33   ` Victor Nogueira [this message]
2026-05-09 17:53     ` Eric Dumazet
2026-05-09 21:03       ` Victor Nogueira
2026-05-07 22:19 ` [PATCH net-next 6/8] net/sched: mq: no longer acquire qdisc spinlocks in dump operations Eric Dumazet
2026-05-07 22:19 ` [PATCH net-next 7/8] net/sched: mq_prio: no longer acquire qdisc spinlocks in mqprio_dump() Eric Dumazet
2026-05-07 22:19 ` [PATCH net-next 8/8] net/sched: mq_prio: no longer acquire qdisc spinlocks in mqprio_dump_class_stats() Eric Dumazet

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=6b5d2268-ffaa-4746-87d0-8f16135aba44@mojatatu.com \
    --to=victor@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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