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 27581A0503; Wed, 18 May 2022 15:00:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C0BA040156; Wed, 18 May 2022 15:00:28 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A9928400D6 for ; Wed, 18 May 2022 15:00:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652878826; x=1684414826; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=idI1fHaS+5z8Ti9W7z52PyKcOeg1u8uBWiusEnkjY0o=; b=aouGjAbHR4T5IW93ZITRVC5p5idWSjHSHkDKPw32J/jr9FcEEzRvi3xt XEg3dR3M9+ysx6dIPkAPfiXqX3yUVyintvSQ2C4r/zQ9tYRJLTkOxGfmG NoTTyU5/O5Z9NfBrDESHbwVddxBRqTCGr1mfPo24jLqlVvTvtZG4YJaqD CcMdH1/CCV3EwCq9N5wa5/ky0zX9AL9SHkvFkcWW8FcF0IzMdHEN9VzWe eg3zr8MPBl/GLExNCDwwGWNIQDmEscZkBOOJq4vwYb1PfCk1Q1q8LL3rA ZZOi6d9rzfkgKCalwPCkAXxJ+mYPlZIMd6Yunwg8il4NcFjeWgXAx6J4w g==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="271353488" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="271353488" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 06:00:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="556312065" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by orsmga002.jf.intel.com with ESMTP; 18 May 2022 06:00:23 -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 v8 00/13] add virtio_blk device support to vdpa/ifc Date: Wed, 18 May 2022 20:13:42 +0800 Message-Id: <1652876035-70513-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. 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 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 | 21 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 408 +++++++++++++++++++++++++++++++-- examples/vdpa/main.c | 56 +++++ examples/vdpa/vdpa_blk_compact.h | 58 +++++ 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 | 73 ++++++ lib/vhost/vhost_user.h | 13 ++ usertools/dpdk-devbind.py | 5 +- 14 files changed, 725 insertions(+), 25 deletions(-) create mode 100644 examples/vdpa/vdpa_blk_compact.h -- 1.8.3.1