Subject: Re: [PATCH net-next v4 2/2] netcons: Add udp send fail statistics to netconsole

From: Jakub Kicinski <[email-masked]>
Date: Thu, 31 Oct 2024 18:49:55 -0700

On Thu, 31 Oct 2024 21:19:26 -0400 Maksym Kutsevol wrote:
> Thanks for looking into this!
> 
> Parroting examples, e.g.
> struct pcpu_lstats {
> u64_stats_t packets;
> u64_stats_t bytes;
> struct u64_stats_sync syncp;
> } __aligned(2 * sizeof(u64));
> 
> in netdevice.h https://github.com/torvalds/linux/blob/master/include/linux/netdevice.h#L2743-L2747
> I don't have any strongly held opinion about this. I'd appreciate an
> explanation (a link would suffice) why this is a bad idea.

No entirely sure why the pcpu stats in netdev are aligned like this,
but yours are not per cpu, and not fast path of any sort. So aligning
is a premature optimization in the first place.

> > > +static void netpoll_send_udp_count_errs(struct netconsole_target *nt,
> > > +                                     const char *msg, int len)  
> >
> > This is defined in the netconsole driver, it should not use the
> > netpoll_ prefix for the function name.'  
> 
> netconsole_send_udp_count_errs sounds better?

I don't think the _count_errs() suffix is needed any more