linux/drivers/net/ethernet/freescale/enetc
Jiafei Pan 215602a8d2 enetc: use napi_schedule to be compatible with PREEMPT_RT
The driver calls napi_schedule_irqoff() from a context where, in RT,
hardirqs are not disabled, since the IRQ handler is force-threaded.

In the call path of this function, __raise_softirq_irqoff() is modifying
its per-CPU mask of pending softirqs that must be processed, using
or_softirq_pending(). The or_softirq_pending() function is not atomic,
but since interrupts are supposed to be disabled, nobody should be
preempting it, and the operation should be safe.

Nonetheless, when running with hardirqs on, as in the PREEMPT_RT case,
it isn't safe, and the pending softirqs mask can get corrupted,
resulting in softirqs being lost and never processed.

To have common code that works with PREEMPT_RT and with mainline Linux,
we can use plain napi_schedule() instead. The difference is that
napi_schedule() (via __napi_schedule) also calls local_irq_save, which
disables hardirqs if they aren't already. But, since they already are
disabled in non-RT, this means that in practice we don't see any
measurable difference in throughput or latency with this patch.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03 18:21:30 -07:00
..
Kconfig enetc: Add adaptive interrupt coalescing 2020-07-21 15:38:30 -07:00
Makefile enetc: Make MDIO accessors more generic and export to include/linux/fsl 2020-01-05 23:22:32 -08:00
enetc.c enetc: use napi_schedule to be compatible with PREEMPT_RT 2020-08-03 18:21:30 -07:00
enetc.h enetc: Add adaptive interrupt coalescing 2020-07-21 15:38:30 -07:00
enetc_cbdr.c enetc: Configure the Time-Aware Scheduler via tc-taprio offload 2019-11-16 12:49:16 -08:00
enetc_ethtool.c enetc: Add adaptive interrupt coalescing 2020-07-21 15:38:30 -07:00
enetc_hw.h enetc: Add interrupt coalescing support 2020-07-21 15:38:30 -07:00
enetc_mdio.c enetc: Set MDIO_CFG_HOLD to the recommended value of 2 2020-01-05 23:22:32 -08:00
enetc_msg.c enetc: Add vf to pf messaging support 2019-01-24 21:55:53 -08:00
enetc_pci_mdio.c net: enetc: fix an issue about leak system resources 2020-05-04 10:51:20 -07:00
enetc_pf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-07-25 17:49:04 -07:00
enetc_pf.h net: enetc: Use DT protocol information to set up the ports 2020-07-19 18:05:49 -07:00
enetc_ptp.c enetc: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions 2019-08-31 23:53:17 -07:00
enetc_qos.c net/enetc: Fix wrong return value in enetc_psfp_parse_clsflower() 2020-08-03 15:57:07 -07:00
enetc_vf.c enetc: Remove unused variable 'enetc_drv_name' 2020-03-23 13:09:32 -07:00