]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: disable softirqs for ptp TX
authorAlejandro Lucero <alejandro.lucero-palau@amd.com>
Tue, 26 Jul 2022 06:45:04 +0000 (08:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:03:54 +0000 (12:03 +0200)
commit1dcf948e54589a30513d7dc65dcfa7752257ec28
tree5041d66592356787d873fa7dcd9777755dbeec89
parent2607e1479fa809286400e5ac84dc017a0366ae10
sfc: disable softirqs for ptp TX

[ Upstream commit 40ed328e8c5ca35080cff1b0b00337eb1c83a374 ]

Sending a PTP packet can imply to use the normal TX driver datapath but
invoked from the driver's ptp worker. The kernel generic TX code
disables softirqs and preemption before calling specific driver TX code,
but the ptp worker does not. Although current ptp driver functionality
does not require it, there are several reasons for doing so:

   1) The invoked code is always executed with softirqs disabled for non
      PTP packets.
   2) Better if a ptp packet transmission is not interrupted by softirq
      handling which could lead to high latencies.
   3) netdev_xmit_more used by the TX code requires preemption to be
      disabled.

Indeed a solution for dealing with kernel preemption state based on static
kernel configuration is not possible since the introduction of dynamic
preemption level configuration at boot time using the static calls
functionality.

Fixes: 3ac514f76df8f ("drivers: net: sfc: use netdev_xmit_more helper")
Signed-off-by: Alejandro Lucero <alejandro.lucero-palau@amd.com>
Link: https://lore.kernel.org/r/20220726064504.49613-1-alejandro.lucero-palau@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sfc/ptp.c