From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bigswitch_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fU44yLXiEZx7AlOHO9Ch9K6xao91FZCBVPGA1C4/cSk=; b=ALGtIjx8Q0xt+uuiO/xCc67OxRavk0VY8wZXC4cHCW4/rjfXhccHO7EUxMc3iRq8WL c2vmY/VoI0XVF48KSPbMfLEjGN7q2fPYNZMiLuhO0ZV0Bm5qqz9EUNuLf4puefFnjBpR wkUofHOtxEJ0UaSuVStD8MOXKzSH85TH1JSDakXk7MTv/TZNhtJ4fBFerMrX/wBGG9HD +gZ+Fjk8L/8lvIX6hvz5q8WCe74M2Nzar8lqHCUIZEiRF7ghmfrBJhqNuEfw2eNLUAdB LtPH9bYIB976hKo5yeiJM5FN/4/1YlvlKUyTggZHvNF5Jx/2aVVWv+YCIxv+TFYMMrXt GrIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=fU44yLXiEZx7AlOHO9Ch9K6xao91FZCBVPGA1C4/cSk=; b=I7wn+8BKEATGIG/EGzQzsWQCi3yeEB8Cvv0XwsieShZgdghchY3cntBD6qk9l15gTG gLNuQtLaFj4Yn20incAJrSBwiIYXbgkbSkmtImgowEYBoCm0Ymlk4RkPYL2YMQUty24m zTOPa8oO4VQ+zUj5Ru2hQ3NTE5doYu425Mia1A3cPx6gMI6gfjHw74wFaZPteEZlSHzc a74gJ+3R+SkEHD3XRn/VhMJRpkmBCP3Z38DwSP8OOkvP31BVygwkxyu4MOvpjalsvojY ZADf8cxBRUX5dBexvhO1trqrDe++MiyxKp3IMy1Qidfiv7ZVPSU9TahL3O8Jylp4UurJ UCvA== X-Gm-Message-State: ALoCoQmMzZO28Z3rknf+AvHt0hXdALecmQWaT/jUw6zW9nTs6Jlnz+OIdhZVEBch/GTZwAgTYPc9 MIME-Version: 1.0 X-Received: by 10.31.13.67 with SMTP id 64mr2032973vkn.100.1447317112045; Thu, 12 Nov 2015 00:31:52 -0800 (PST) Received: by 10.31.92.72 with HTTP; Thu, 12 Nov 2015 00:31:51 -0800 (PST) In-Reply-To: <1447301441-10590-2-git-send-email-yuanhan.liu@linux.intel.com> References: <1447301441-10590-1-git-send-email-yuanhan.liu@linux.intel.com> <1447301441-10590-2-git-send-email-yuanhan.liu@linux.intel.com> Date: Thu, 12 Nov 2015 00:31:51 -0800 Message-ID: From: Rich Lane To: Yuanhan Liu Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] vhost: reset device properly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 08:31:52 -0000 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