Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3904526imc; Thu, 14 Mar 2019 07:53:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTEF0gtWw4OrvSxD+76h99MjfXyCrS32pFv4t9cTEQD1t8saww3F+6imaS7hTxiCVxFm5/ X-Received: by 2002:a63:ce41:: with SMTP id r1mr45176537pgi.119.1552575212907; Thu, 14 Mar 2019 07:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552575212; cv=none; d=google.com; s=arc-20160816; b=THTRZvJacnTuIDBs4PJ8ACuERKvH5jE6qwhoSR+GVvwSda4C5sbP9VPt/bFSKELdhN snIDfy3+yRmkuSy8hP7slXn/TNgUlYVXAJNw7QLzsdOSu+DHkexm7OYzdm1VXZVTJfbG abTivIQTWkoNDxb29SNjENC+LMw1mi6GTfgrXW6T3Xf5uHzKxk8pz1T96q6rWC0xCaQ5 5VtiG8+Abo1vW32qCUTIm192HFnMqUuYDdoZlCoy0hyLHwu6T/8tCzG7Fx0lkd80f54K e2lHLkFHPuN+l0D/1LK3WquCjYTDfbp52C9ed/YDBVdHieruMrS8uJ7ToGHavf8h9XBv z9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=30l/yLVqcv3PdQ2omNlC84KOCY1EsOA8XbXrjw+dVbM=; b=sJ7AQruoLeCFot0Z58UiRx+bNSKu9W44pESWjbvHgpoBzClOR91gP6gH5i95fiLH5V qUQwRFy0AxSj/Ek/kDYKEadaUa8kj1EKUuEsDZAeATTo9mvd60JG47Fj8TTrvHIhdP2E c2mzQoCDKc10PlxAeyTrfgCcBfbUQJbTyKCc/vm1CTgg867smaUUia6dMdhEEeDvlPRt DLouBjnbc8iJN8CQqHJCwxdwlMKQcmznxC54CmPTWcsN0C3l15rm8y6mZgzjNIkhxGak R4bAoxeeU1Yy0ucQ1+HDeHbrgQu7oC8gbVxjXW83Y8oT97jG9SRBURcXSteB74r3bsDJ C/wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aSOguwzw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si12314109pgv.166.2019.03.14.07.53.16; Thu, 14 Mar 2019 07:53:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aSOguwzw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbfCNOwc (ORCPT + 99 others); Thu, 14 Mar 2019 10:52:32 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33297 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726539AbfCNOwb (ORCPT ); Thu, 14 Mar 2019 10:52:31 -0400 Received: by mail-lj1-f193.google.com with SMTP id z7so5107562lji.0; Thu, 14 Mar 2019 07:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=30l/yLVqcv3PdQ2omNlC84KOCY1EsOA8XbXrjw+dVbM=; b=aSOguwzwteBhNslSigmWnIdkblpckeD2VoozvmSFNDEth5eemT0RzSAGgBVey+uzql sTzAHujX3+rirXxUzPurbc7YbjRnnw+pFGIcUmu9gh37nXrwOpzUcsbYtowHDsOK5Cih 3gQ1QNWCBDM8ffz1iYbO6k8kltIPWOtUDVeyWoU8doMAyp5X1ULNAimrd1LaOU9ugVIX BslRLZIyhfPsqOWckFaDZ78hNnD9e9iE/+r1fKwrkfWp73PFjIRh9CCc+Rhepr52f+rZ Q+gllIN681fBgAudrHa3KYixvpSfvCZ4uTj+eLa0hNv6rnCdUZst6JVCecJ1iNX2JIT3 ayAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=30l/yLVqcv3PdQ2omNlC84KOCY1EsOA8XbXrjw+dVbM=; b=e36v7ZHcp2IH4GF2Rz2AKcljPXR2A2iPoT4diIb95vA+Iw/XG9Xv0D7LPgtiH1UElO n3fzNlD3swkzQvr55X54AWZex1JuxB5ukaBZSy2a9cY7esp6ug7Ll+iO8iEt1O95ntNt 6nyzd2QVOTghgdVzsjSn+i887ztlJsvYZPYsXRydmiY3B6P2I2UY+mMM3TTUJUP7o6HQ EkoBp2RFajHkVor9tW963ZCrZvJ1iXTJX9r2FFrUnjCmV1KvVVL64co3oLEtLlJdKAXL tpnFyWLHdWNOZM5BASUku7RHT/VbKvDH5jMSp+SipBs7N3+RpmEZ9ZBucghWG/dlC9CA ueGA== X-Gm-Message-State: APjAAAUzdrygwZqlLDieW2O4YMjoKLrvRWzOWCNbuRU/xykGSj9pfn2T Q7UqKPG+Nv/If2tJa7WAwJM= X-Received: by 2002:a2e:9f0b:: with SMTP id u11mr28451717ljk.64.1552575147858; Thu, 14 Mar 2019 07:52:27 -0700 (PDT) Received: from [10.17.182.20] (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id s73sm776388lfs.62.2019.03.14.07.52.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:52:27 -0700 (PDT) Subject: Re: [Xen-devel][PATCH] xen/netfront: Remove unneeded .resume callback To: Boris Ostrovsky , netdev@vger.kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, jgross@suse.com, sstabellini@kernel.org, davem@davemloft.net Cc: Oleksandr Andrushchenko , Volodymyr Babchuk References: <20190314131749.25706-1-andr2000@gmail.com> From: Oleksandr Andrushchenko Message-ID: <6205819a-af39-8cd8-db87-f3fe047ff064@gmail.com> Date: Thu, 14 Mar 2019 16:52:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/19 4:47 PM, Boris Ostrovsky wrote: > On 3/14/19 9:17 AM, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> Currently on driver resume we remove all the network queues and >> destroy shared Tx/Rx rings leaving the driver in its current state >> and never signaling the backend of this frontend's state change. >> This leads to the number of consequences: >> - when frontend withdraws granted references to the rings etc. it cannot >> be cleanly done as the backend still holds those (it was not told to >> free the resources) >> - it is not possible to resume driver operation as all the communication >> means with the backned were destroyed by the frontend, thus >> making the frontend appear to the guest OS as functional, but >> not really. > > What do you mean? Are you saying that after resume you lose connectivity? Exactly, if you take a look at the .resume callback as it is now what it does it destroys the rings etc. and never notifies the backend of that, e.g. it stays in, say, connected state with communication channels destroyed. It never goes into any other Xen bus state, so there is no way its state machine can help recovering. > > -boris > > >> Fix this by not destroying communication channels/rings on driver >> resume. >> >> Signed-off-by: Oleksandr Andrushchenko >> --- >> drivers/net/xen-netfront.c | 17 ----------------- >> 1 file changed, 17 deletions(-) >> >> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c >> index c914c24f880b..2ca162048da4 100644 >> --- a/drivers/net/xen-netfront.c >> +++ b/drivers/net/xen-netfront.c >> @@ -1422,22 +1422,6 @@ static void xennet_disconnect_backend(struct netfront_info *info) >> } >> } >> >> -/** >> - * We are reconnecting to the backend, due to a suspend/resume, or a backend >> - * driver restart. We tear down our netif structure and recreate it, but >> - * leave the device-layer structures intact so that this is transparent to the >> - * rest of the kernel. >> - */ >> -static int netfront_resume(struct xenbus_device *dev) >> -{ >> - struct netfront_info *info = dev_get_drvdata(&dev->dev); >> - >> - dev_dbg(&dev->dev, "%s\n", dev->nodename); >> - >> - xennet_disconnect_backend(info); >> - return 0; >> -} >> - >> static int xen_net_read_mac(struct xenbus_device *dev, u8 mac[]) >> { >> char *s, *e, *macstr; >> @@ -2185,7 +2169,6 @@ static struct xenbus_driver netfront_driver = { >> .ids = netfront_ids, >> .probe = netfront_probe, >> .remove = xennet_remove, >> - .resume = netfront_resume, >> .otherend_changed = netback_changed, >> }; >>