[dpdk-dev] [PATCH] vhost: reset device properly

Rich Lane rich.lane at bigswitch.com
Thu Nov 12 09:31:51 CET 2015


On Wed, Nov 11, 2015 at 8:10 PM, Yuanhan Liu <yuanhan.liu at linux.intel.com>
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 <mukawa at igel.co.jp>
> Cc: Xie Huawei <huawei.xie at intel.com>
> Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
>

I had a patch that just saved the ifname but this is much better.

Acked-by: Rich Lane <rlane at bigswitch.com>


More information about the dev mailing list