OpenCloudOS-Kernel/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 caif_virtio: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
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 drivers: net: hippi: Fix deadlock in rr_close() 2022-04-21 10:30:45 +02:00
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-23 21:19:17 -07:00
ieee802154 Stefan Schmidt says: 2022-05-02 13:57:56 -07:00
ipa net: ipa: fix page free in ipa_endpoint_replenish_one() 2022-05-27 18:29:50 -07:00
ipvlan net: add netif_inherit_tso_max() 2022-05-06 12:07:56 +01:00
mctp
mdio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-05 13:03:18 -07:00
netdevsim netdevsim: rely on XFRM state direction instead of flags 2022-05-06 08:34:33 +02:00
pcs net: pcs: pcs-xpcs: Convert to mdiobus_c45_read 2022-05-02 13:21:38 +02:00
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 net: wan: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
wireguard wireguard: device: check for metadata_dst with skb_valid_dst() 2022-04-22 15:59:05 -07:00
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 net: eql: Use kzalloc instead of kmalloc/memset 2022-04-21 14:40:21 +02:00
geneve.c geneve: avoid indirect calls in GRO path, when possible 2022-04-15 10:52:29 +01:00
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 rtnetlink: add extack support in fdb del handlers 2022-05-09 11:58:20 +01:00
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 sungem: Prepare cleanup of powerpc's asm/prom.h 2022-05-05 15:52:27 -07:00
tap.c
thunderbolt.c
tun.c net: switch to netif_napi_add_tx() 2022-05-05 15:54:12 -07:00
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