numam-dpdk/drivers/net
Guinan Sun 2d04b9e856 net/ixgbe/base: fix infinite recursion on PCIe link down
In some corner cases the functions ixgbe_clear_rar_generic and
ixgbe_clear_vmdq_generic may call one another leading to infinite
recursion.

When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL
flag, it's going to clear MPSAR registers, and proceed to call
ixgbe_clear_rar_generic, which in turn will clear the RAR registers,
and recursively call back ixgbe_clear_vmdq_generic. Normally, the
latter would detect that MPSAR registers have already been cleared
and terminate the recursion.

However, when PCIe link is down, and before the driver has had the
opportunity to shut itself down, all register reads return 0xFFFFFFFF,
and all register writes fail silently. In such case, because
ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers
succeeded, it's going to always call ixgbe_clear_rar_generic, which
in turn will always call back ixgbe_clear_vmdq_generic, creating
infinite recursion.

This patch re-reads MPSAR register values after they had been cleared.
In case of PCIe link failure, the values read will be non-zero, which
will terminate the recursion. On the other hand, under normal
circumstances the value read from MPSAR registers is going to be equal
to the value previously written, so this patch is expected not to cause
any regressions.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-07-11 06:18:53 +02:00
..
af_packet log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
af_xdp log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
ark log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
atlantic log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
avp log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
axgbe log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
bnx2x log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
bnxt net/bnxt: avoid hard coded values when reading counters 2020-07-11 06:18:53 +02:00
bonding net/bonding: fix socket ID check 2020-07-11 06:18:53 +02:00
cxgbe log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
dpaa bus/dpaa: enable set link status 2020-07-11 06:18:52 +02:00
dpaa2 net/dpaa2: support raw flow classification 2020-07-11 06:18:52 +02:00
e1000 net/e1000/base: update version 2020-07-07 23:38:27 +02:00
ena log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
enetc log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
enic log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
failsafe log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
fm10k log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
hinic net/hinic/base: modify returned error values 2020-07-07 23:38:26 +02:00
hns3 net/hns3: fix inserted VLAN tag position in Tx 2020-07-07 23:38:28 +02:00
i40e net/i40e: enable flow query RSS 2020-07-11 06:18:52 +02:00
iavf net/iavf: support flow director GTPU outer IPv4/IPv6 2020-07-11 06:18:52 +02:00
ice net/ice: support flow director GTPU outer IPv4/IPv6 2020-07-11 06:18:52 +02:00
igc log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
ionic log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
ipn3ke log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
ixgbe net/ixgbe/base: fix infinite recursion on PCIe link down 2020-07-11 06:18:53 +02:00
kni log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
liquidio log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
memif log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
mlx4 log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
mlx5 introduce restricted pointer aliasing marker 2020-07-10 15:35:32 +02:00
mvneta log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
mvpp2 log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
netvsc net/netvsc: detach external buffer on failure 2020-07-11 06:18:53 +02:00
nfb net/nfb: check array size before access 2020-04-21 13:57:06 +02:00
nfp log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
null log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
octeontx log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
octeontx2 net/octeontx2: add devargs to lock Rx/Tx contexts 2020-07-07 23:38:26 +02:00
pcap log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
pfe log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
qede net/qede: support registers dump 2020-07-11 06:18:53 +02:00
ring log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
sfc net/sfc: reap Tx descriptors at least once 2020-06-30 14:52:29 +02:00
softnic log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
szedata2 log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
tap log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
thunderx log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
vdev_netvsc log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
vhost log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
virtio net/virtio-user: support reply-ack 2020-07-11 06:18:52 +02:00
vmxnet3 log: introduce logtype register macro 2020-07-03 15:52:51 +02:00
Makefile net/igc: add skeleton 2020-04-21 13:57:07 +02:00
meson.build bus/pci: introduce Windows support with stubs 2020-06-30 00:02:54 +02:00