linux-stable/drivers/net
Stephan Gerhold 8af52fe9fd virtio_net: fix xdp_rxq_info bug after suspend/resume
The following sequence currently causes a driver bug warning
when using virtio_net:

  # ip link set eth0 up
  # echo mem > /sys/power/state (or e.g. # rtcwake -s 10 -m mem)
  <resume>
  # ip link set eth0 down

  Missing register, driver bug
  WARNING: CPU: 0 PID: 375 at net/core/xdp.c:138 xdp_rxq_info_unreg+0x58/0x60
  Call trace:
   xdp_rxq_info_unreg+0x58/0x60
   virtnet_close+0x58/0xac
   __dev_close_many+0xac/0x140
   __dev_change_flags+0xd8/0x210
   dev_change_flags+0x24/0x64
   do_setlink+0x230/0xdd0
   ...

This happens because virtnet_freeze() frees the receive_queue
completely (including struct xdp_rxq_info) but does not call
xdp_rxq_info_unreg(). Similarly, virtnet_restore() sets up the
receive_queue again but does not call xdp_rxq_info_reg().

Actually, parts of virtnet_freeze_down() and virtnet_restore_up()
are almost identical to virtnet_close() and virtnet_open(): only
the calls to xdp_rxq_info_(un)reg() are missing. This means that
we can fix this easily and avoid such problems in the future by
just calling virtnet_close()/open() from the freeze/restore handlers.

Aside from adding the missing xdp_rxq_info calls the only difference
is that the refill work is only cancelled if netif_running(). However,
this should not make any functional difference since the refill work
should only be active if the network interface is actually up.

Fixes: 754b8a21a9 ("virtio_net: setup xdp_rxq_info")
Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20220621114845.3650258-1-stephan.gerhold@kernkonzept.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-06-22 19:09:13 -07:00
..
appletalk net: appletalk: remove Apple/Farallon LocalTalk PC support 2022-05-11 13:08:38 +01:00
arcnet
bonding bonding: ARP monitor spams NETDEV_NOTIFY_PEERS notifiers 2022-06-17 20:18:44 -07:00
caif
can can: ctucanfd: platform: add missing dependency to HAS_IOMEM 2022-05-23 22:00:06 +02:00
dsa net: dsa: qca8k: reduce mgmt ethernet timeout 2022-06-22 18:33:51 -07:00
ethernet Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 2022-06-22 18:59:29 -07:00
fddi net: fddi: skfp: smt: Remove extra parameters to vararg macro 2022-05-22 23:05:56 +01:00
fjes
hamradio hamradio: 6pack: fix array-index-out-of-bounds in decode_std_command() 2022-06-17 11:39:46 +01:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-23 21:19:17 -07:00
ieee802154
ipa net: ipa: fix page free in ipa_endpoint_replenish_one() 2022-05-27 18:29:50 -07:00
ipvlan
mctp
mdio
netdevsim
pcs
phy net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode 2022-06-21 21:59:47 -07:00
plip
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-19 11:23:59 -07:00
slip
team
usb net: usb: ax88179_178a needs FLAG_SEND_ZLP 2022-06-15 09:32:12 +01:00
vmxnet3 net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup() 2022-05-17 12:03:52 +02:00
vxlan net: vxlan: Fix kernel coding style 2022-05-20 17:38:27 -07:00
wan
wireguard
wireless USB / Thunderbolt changes for 5.19-rc1 2022-06-03 11:17:49 -07:00
wwan wwan: iosm: use a flexible array rather than allocate short objects 2022-05-20 17:56:50 -07:00
xen-netback xen/netback: fix incorrect usage of RING_HAS_UNCONSUMED_REQUESTS() 2022-05-31 12:22:22 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c eth: amd: remove NI6510 support (ni65) 2022-05-11 13:09:59 +01:00
amt.c amt: fix wrong type string definition 2022-06-06 14:27:35 -07:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c net: loopback: enable BIG TCP packets 2022-05-16 10:18:56 +01:00
macsec.c macsec: fix UAF bug for real_dev 2022-06-01 12:01:47 +02:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c veth: Add updating of trans_start 2022-06-17 11:38:09 +01:00
virtio_net.c virtio_net: fix xdp_rxq_info bug after suspend/resume 2022-06-22 19:09:13 -07:00
vrf.c
vsockmon.c
xen-netfront.c xen: switch gnttab_end_foreign_access() to take a struct page pointer 2022-05-27 11:05:29 +02:00