• Dongli Zhang's avatar
    xen/netfront: stop tx queues during live migration · 042b2046
    Dongli Zhang authored
    The tx queues are not stopped during the live migration. As a result, the
    ndo_start_xmit() may access netfront_info->queues which is freed by
    talk_to_netback()->xennet_destroy_queues().
    
    This patch is to netif_device_detach() at the beginning of xen-netfront
    resuming, and netif_device_attach() at the end of resuming.
    
         CPU A                                CPU B
    
     talk_to_netback()
     -> if (info->queues)
            xennet_destroy_queues(info);
        to free netfront_info->queues
    
                                            xennet_start_xmit()
                                            to access netfront_info->queues
    
      -> err = xennet_create_queues(info, &num_queues);
    
    The idea is borrowed from virtio-net.
    
    Cc: Joe Jin <joe.jin@oracle.com>
    Signed-off-by: default avatarDongli Zhang <dongli.zhang@oracle.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    042b2046
xen-netfront.c 64.2 KB