linux/drivers/net/xen-netback
Paul Durrant 9476654bd5 xen-netback: support dynamic unbind/bind
By re-attaching RX, TX, and CTL rings during connect() rather than
assuming they are freshly allocated (i.e. assuming the counters are zero),
and avoiding forcing state to Closed in netback_remove() it is possible
for vif instances to be unbound and re-bound from and to (respectively) a
running guest.

Dynamic unbind/bind is a highly useful feature for a backend module as it
allows it to be unloaded and re-loaded (i.e. updated) without requiring
domUs to be halted.

This has been tested by running iperf as a server in the test VM and
then running a client against it in a continuous loop, whilst also
running:

while true;
  do echo vif-$DOMID-$VIF >unbind;
  echo down;
  rmmod xen-netback;
  echo unloaded;
  modprobe xen-netback;
  cd $(pwd);
  brctl addif xenbr0 vif$DOMID.$VIF;
  ip link set vif$DOMID.$VIF up;
  echo up;
  sleep 5;
  done

in dom0 from /sys/bus/xen-backend/drivers/vif to continuously unbind,
unload, re-load, re-bind and re-plumb the backend.

Clearly a performance drop was seen but no TCP connection resets were
observed during this test and moreover a parallel SSH connection into the
guest remained perfectly usable throughout.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-26 15:16:26 -08:00
..
common.h xen-netback: add reference from xenvif to backend_info to facilitate coredump analysis 2019-04-12 10:10:28 -07:00
hash.c xen-netback: don't populate the hash cache on XenBus disconnect 2019-02-28 12:50:37 -08:00
interface.c xen-netback: support dynamic unbind/bind 2019-12-26 15:16:26 -08:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
netback.c xen-netback: support dynamic unbind/bind 2019-12-26 15:16:26 -08:00
rx.c xen-netback: make function xenvif_rx_skb static 2018-02-26 11:36:54 -05:00
xenbus.c xen-netback: support dynamic unbind/bind 2019-12-26 15:16:26 -08:00