[RFC 1/7] mac80211: Add check for napi handle before WARN_ON

Rakesh Pillai pillair at codeaurora.org
Sun Jul 26 12:19:51 EDT 2020



> -----Original Message-----
> From: Rakesh Pillai <pillair at codeaurora.org>
> Sent: Friday, July 24, 2020 11:51 AM
> To: 'Johannes Berg' <johannes at sipsolutions.net>;
> 'ath10k at lists.infradead.org' <ath10k at lists.infradead.org>
> Cc: 'linux-wireless at vger.kernel.org' <linux-wireless at vger.kernel.org>;
> 'linux-kernel at vger.kernel.org' <linux-kernel at vger.kernel.org>;
> 'kvalo at codeaurora.org' <kvalo at codeaurora.org>; 'davem at davemloft.net'
> <davem at davemloft.net>; 'kuba at kernel.org' <kuba at kernel.org>;
> 'netdev at vger.kernel.org' <netdev at vger.kernel.org>;
> 'dianders at chromium.org' <dianders at chromium.org>;
> 'evgreen at chromium.org' <evgreen at chromium.org>
> Subject: RE: [RFC 1/7] mac80211: Add check for napi handle before
> WARN_ON
> 
> 
> 
> > -----Original Message-----
> > From: Johannes Berg <johannes at sipsolutions.net>
> > Sent: Friday, July 24, 2020 1:37 AM
> > To: Rakesh Pillai <pillair at codeaurora.org>; ath10k at lists.infradead.org
> > Cc: linux-wireless at vger.kernel.org; linux-kernel at vger.kernel.org;
> > kvalo at codeaurora.org; davem at davemloft.net; kuba at kernel.org;
> > netdev at vger.kernel.org; dianders at chromium.org;
> evgreen at chromium.org
> > Subject: Re: [RFC 1/7] mac80211: Add check for napi handle before
> > WARN_ON
> >
> > On Thu, 2020-07-23 at 23:56 +0530, Rakesh Pillai wrote:
> >
> > > > > -	WARN_ON_ONCE(softirq_count() == 0);
> > > > > +	WARN_ON_ONCE(napi && softirq_count() == 0);
> > > >
> > > > FWIW, I'm pretty sure this is incorrect - we make assumptions on
> > > > softirqs being disabled in mac80211 for serialization and in place of
> > > > some locking, I believe.
> > > >
> > >
> > > I checked this, but let me double confirm.
> > > But after this change, no packet is submitted from driver in a softirq
> > context.
> > > So ideally this should take care of serialization.
> >
> > I'd guess that we have some reliance on BHs already being disabled, for
> > things like u64 sync updates, or whatnot. I mean, we did "rx_ni()" for a
> > reason ... Maybe lockdep can help catch some of the issues.
> >
> > But couldn't you be in a thread and have BHs disabled too?
> 
> This would ideally beat the purpose and possibly hurt the other subsystems
> running on the same core.
> 

Hi Johannes,

We do have the usage of napi_gro_receive and netif_receive_skb in mac80211.
                /* deliver to local stack */
                if (rx->napi)
                        napi_gro_receive(rx->napi, skb);
                else
                        netif_receive_skb(skb);


Also all the rx_handlers are called under the " rx->local->rx_path_lock" lock.
Is the BH disable still required ?


> >
> > johannes





More information about the ath10k mailing list