lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH net-next] sfc: replace in_interrupt() usage
Date
On Mon, Sep 28 2020 at 21:05, Edward Cree wrote:
> efx_ef10_try_update_nic_stats_vf() used in_interrupt() to figure out
> whether it is safe to sleep (for MCDI) or not.
> The only caller from which it was not is efx_net_stats(), which can be
> invoked under dev_base_lock from net-sysfs::netstat_show().
> So add a new update_stats_atomic() method to struct efx_nic_type, and
> call it from efx_net_stats(), removing the need for
> efx_ef10_try_update_nic_stats_vf() to behave differently for this case
> (which it wasn't doing correctly anyway).
> For all nic_types other than EF10 VF, this method is NULL and so we
> call the regular update_stats() methods, which are happy with being
> called from atomic contexts.
>
> Fixes: f00bf2305cab ("sfc: don't update stats on VF when called in atomic context")
> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Edward Cree <ecree@solarflare.com>

That's much nicer.

> ---
> Only compile-tested so far, because I'm waiting for my kernel to
> finish rebuilding with CONFIG_DEBUG_ATOMIC_SLEEP which I'm hoping
> is the right thing to detect the bug in the existing code.
> I also wasn't quite sure how to give credit to the thorough analysis
> in the commit message of Sebastian's patch. I don't think we have
> a Whatever-by: tag to cover that, do we?

Sebastian did the analysis and I did some word polishing, but the credit
surely goes to him.

Thanks,

tglx

\
 
 \ /
  Last update: 2020-09-28 22:25    [W:0.073 / U:1.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site