Re: rndis gadget: Inconsistent locking

Jarek Poplawski
2011-01-12T13:41:36Z

On Wed, Jan 12, 2011 at 02:32:20PM +0100, Eric Dumazet wrote:
> Le mercredi 12 janvier 2011 ?? 13:23 +0000, Jarek Poplawski a écrit :
> > On Wed, Jan 12, 2011 at 02:07:12PM +0100, Eric Dumazet wrote:
> > ...
> > >
> > > Hmm...
> > >
> > > So all net devices in gen_ndis_query_resp() should have a
> > > ndo_get_stats() or ndo_get_stats64() method, not allowed to use
> > > spin_lock_bh() / spin_unlock_bh()
> > >
> > > If yes, we should add big fat comments to pn_net_stats()/eth_get_stats() so that nobody
> > > tries to revert your patch ;)
> >
> > I'm not sure I got your point: my patch could be replaced with
> > ndo_get_stats64() implementing irq safe locking or by changing
> > gen_ndis_query_resp() calling context. It's intended as a fast
> > (compatible) fix.
>
> I was mentioning that we tried in past months to remove useless
> ndo_get_stats() methods that were only doing :
>
> return &net->stats;
>
> random commit : b27d50a9ff5cf2775b7a4daf5
>
> Another possibility would be to use u64_stats_sync.h for these txq
> counters.
>
> (no locking needed to read counters, only a seqcount fetch/retry)
>
> As a bonus, no overhead on 64bit arches.

Well, I'm OK with anything, but this thread gets older and older ;-)

Jarek P.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html