From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77532A04FF; Tue, 24 May 2022 05:35:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E04C4014F; Tue, 24 May 2022 05:35:30 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id EC6F0400D6 for ; Tue, 24 May 2022 05:35:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653363329; x=1684899329; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=cucNu79uH7xZdNB2HrvyCF0Fv4ixySb+lXaKMUXpMdM=; b=MRAXtxM8EebHRLFjmVxHC7G/Ipiizsp1pmsBDIZe42hBBF5P41qvAv59 vLrvqNRe7N+5/sqTayMv00Fxl5LaDRdc9LK5NAsyhGEyEw7n9hJAhUYUX sL31bS9Bb+onUMq7X2vpFyim2RQmxPt10fO6bxgRezuH8bjsZy+dK91+w IvgnDZcmyw0Bf/cjMQY/MmSBPJuZ0YbsxK4ASUFUzvRJ15gjkU1WFNM3E KD3M/ZhoZD4Va8rbGjHISOcUkO6dg7knAHTLi+8taKUhr6NJFYNkHBL3r aFOjH0E38IpMF4uEeSF4dmoS64xE/F4oD1+H8Z4GaLUxcGezZrWqqAwCI g==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="273533591" X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="273533591" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 20:35:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="745046893" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by orsmga005.jf.intel.com with ESMTP; 23 May 2022 20:35:25 -0700 From: Andy Pei To: dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, gang.cao@intel.com, changpeng.liu@intel.com, rosen.xu@intel.com, qimaix.xiao@intel.com Subject: [PATCH v10 00/13] add virtio_blk device support to vdpa/ifc Date: Tue, 24 May 2022 10:48:04 +0800 Message-Id: <1653360497-18080-1-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643093258-47258-2-git-send-email-andy.pei@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch set add virtio_blk device support to vdpa/ifc driver. With a lot of similarities, I re-use part of vdpa/ifc driver. Distinguish the virtio net and blk device by device id, and implement specific features and ops. Add example to vdpa to support virtio_blk device. To support blk device live migration, some modification to vhost lib. Perform dev_conf op only under VHOST_USER_SET_VRING_CALL msg. v10: fix typo. add more NULL pointer check. fix a error handler. v9: fix some naming issue. add more NULL pointer check. close open file when errors occur. v8: delete some redundant code. fix some commit log. v7: Check on expected fd num in new vhost msg handler. Sanity check on vhost msg size. Fix typo. Add commit log to help understand code. Remove duplicated code. Add new API to get vDPA device type. v6: fix some commit log. add vhost socket in log output to make it more user-friendly. when driver ops fail, just output some log, do not break message handler. check vhost msg size in msg handler. v5: fix some coding style issues. v4: add args "isblk" to vdpa example to specify a block device, fix some issue in example. Make sure code specify for block device does not affect net device. v3: Fix some compile issues. v2: Fix some coding style issues. Andy Pei (13): vdpa/ifc: add support for virtio blk device vhost: add vDPA ops for blk device vhost: add vhost msg support for get/set config vdpa/ifc: add blk ops for ifc device vdpa/ifc: add vDPA interrupt relay for blk device vdpa/ifc: add block device SW live-migration vhost: add API to get vDPA device type vdpa/ifc: add get device type ops to ifc driver examples/vdpa: add virtio blk support usertools: add support for virtio blk device vdpa/ifc: add log for config space of virtio blk vdpa/ifc: add interrupt handling for config space vdpa/ifc/base: access correct register for blk device doc/guides/prog_guide/vhost_lib.rst | 5 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/vdpa/ifc/base/ifcvf.c | 34 ++- drivers/vdpa/ifc/base/ifcvf.h | 27 ++- drivers/vdpa/ifc/ifcvf_vdpa.c | 420 +++++++++++++++++++++++++++++++-- examples/vdpa/main.c | 56 +++++ examples/vdpa/vdpa_blk_compact.h | 50 ++++ lib/vhost/rte_vhost.h | 17 ++ lib/vhost/socket.c | 44 ++++ lib/vhost/vdpa_driver.h | 11 +- lib/vhost/version.map | 1 + lib/vhost/vhost_user.c | 85 +++++++ lib/vhost/vhost_user.h | 13 + usertools/dpdk-devbind.py | 5 +- 14 files changed, 741 insertions(+), 31 deletions(-) create mode 100644 examples/vdpa/vdpa_blk_compact.h -- 1.8.3.1