From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rich Lane Subject: Re: [PATCH] vhost: reset device properly Date: Thu, 12 Nov 2015 00:31:51 -0800 Message-ID: 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=UTF-8 Cc: dev@dpdk.org To: Yuanhan Liu Return-path: Received: from mail-vk0-f53.google.com (mail-vk0-f53.google.com [209.85.213.53]) by dpdk.org (Postfix) with ESMTP id A67FA9198 for ; Thu, 12 Nov 2015 09:31:52 +0100 (CET) Received: by vkgy188 with SMTP id y188so6058268vkg.1 for ; Thu, 12 Nov 2015 00:31:52 -0800 (PST) In-Reply-To: <1447301441-10590-2-git-send-email-yuanhan.liu@linux.intel.com> 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" On Wed, Nov 11, 2015 at 8:10 PM, Yuanhan Liu wrote: > 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