Code includes barrier() followed by writel(). writel() already has a
barrier on some architectures like arm64.
This ends up CPU observing two barriers back to back before executing the
register write.
Create a new wrapper function with relaxed write operator. Use the new
wrapper when a write is following a barrier().
Since code already has an explicit barrier call, changing writel() to
writel_relaxed() and adding mmiowb() for ordering protection.
Signed-off-by: Sinan Kaya <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 6d2e1a8d5e25e5f4563f5ea24bcb5da1ae261b26)
Signed-off-by: Kamal Mostafa <email address hidden>
028f2ff...
by
Netanel Belgazal <email address hidden>
net: ena: fix error handling in ena_down() sequence
ENA admin command queue errors are not handled as part of ena_down().
As a result, in case of error admin queue transitions to non-running
state and aborts all subsequent commands including those coming from
ena_up(). Reset scheduled by the driver from the timer service
context would not proceed due to sharing rtnl with ena_up()/ena_down()
Signed-off-by: Netanel Belgazal <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit ee4552aaf3fef5345199b8a82e40be7245b289fb)
Signed-off-by: Kamal Mostafa <email address hidden>
81c887b...
by
Netanel Belgazal <email address hidden>
Signed-off-by: Netanel Belgazal <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 70097445686209f2b365b51f8154be0ee5b0ba53)
Signed-off-by: Kamal Mostafa <email address hidden>
0af1e2d...
by
Netanel Belgazal <email address hidden>
net: ena: add detection and recovery mechanism for handling missed/misrouted MSI-X
A mechanism for detection of stuck Rx/Tx rings due to missed or
misrouted interrupts.
Check if there are unhandled completion descriptors before the first
MSI-X interrupt arrived.
The check is per queue and per interrupt vector.
Once such condition is detected, driver and device reset is scheduled.
Signed-off-by: Netanel Belgazal <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 8510e1a3d16c7e4e2b47c9675b18725407c616b7)
Signed-off-by: Kamal Mostafa <email address hidden>
bc14e70...
by
Netanel Belgazal <email address hidden>
net: ena: fix race condition between device reset and link up setup
In rare cases, ena driver would reset and re-start the device,
for example, in case of misbehaving application that causes
transmit timeout
The first step in the reset procedure is to stop the Tx traffic by
calling ena_carrier_off().
After the driver have just started the device reset procedure, device
happens to send an asynchronous notification (via AENQ) to the driver
than there was a link change (to link-up state).
This link change is mapped to a call to netif_carrier_on() which
re-activates the Tx queues, violating the assumption of no tx traffic
until device reset is completed, as the reset task might still be in
the process of queues initialization, leading to an access to
uninitialized memory.
Signed-off-by: Netanel Belgazal <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit d18e4f6834451dbc12407c26acd5fae4da14c489)
Signed-off-by: Kamal Mostafa <email address hidden>