From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] vhost: reset device properly Date: Thu, 12 Nov 2015 12:31:16 +0100 Message-ID: <1619932.CiF7gkQMAT@xps13> References: <1447301441-10590-1-git-send-email-yuanhan.liu@linux.intel.com> <1447301441-10590-2-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Yuanhan Liu Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 03C1C8E6A for ; Thu, 12 Nov 2015 12:32:29 +0100 (CET) Received: by wmec201 with SMTP id c201so86971655wme.1 for ; Thu, 12 Nov 2015 03:32:28 -0800 (PST) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > Currently, we reset all fields of a device to zero when reset > > happens, which is wrong, since for some fields like device_fh, > > ifname, and virt_qp_nb, they should be same and be kept after > > reset until the device is removed. And this is what's the new > > helper function reset_device() for. > > > > And use rte_zmalloc() instead of rte_malloc, so that we could > > avoid init_device(), which basically dose zero reset only so far. > > Hence, init_device() is dropped in this patch. > > > > This patch also removes a hack of using the offset a specific > > field (which is virtqueue now) inside of `virtio_net' structure > > to do reset, which could be broken easily if someone changed the > > field order without caution. > > > > Cc: Tetsuya Mukawa > > Cc: Xie Huawei > > Signed-off-by: Yuanhan Liu > > > > I had a patch that just saved the ifname but this is much better. > > Acked-by: Rich Lane Applied, thanks