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 755D9A04FD; Mon, 23 May 2022 12:22:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 082BF40141; Mon, 23 May 2022 12:22:32 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 245BB40041 for ; Mon, 23 May 2022 12:22:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653301351; x=1684837351; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=AotfFgUcyLcgvKqUYTJqLCnnx02iJiZ3aN5O4M4qbP8=; b=glq7Fs9+rnH/s5U1EM7wteRp5xK9XgW6AIm9l+vnERcEJwSTLD6kB8zI ryY4bCsXmeUYYRbKGopbt7yFuyc8Qj+5vMzq8OWOUNyxullM6721H11hF PyT3X42tzkAjQi7uyguxKJUSDifnMo0K8W61f/EAenghYeF/8hApJcJY/ Nix8JK2k/INLNAbVlAPF+iS5Xm+/tlPFQOyb/4Ushqhg8UjukT1yIZdCO JdrYIq0SCbSWt6RViumiFMNhV20A1ZEA1PY0IqD5yoEyeJr3/jKDxLOR4 cIc7KdTXYBTtqKd7VXPnQuKxbhsqP6awL1tMlC5w/cwOk/FUrDNipz+0X w==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="255239258" X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="255239258" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 03:22:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="547889338" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by orsmga006.jf.intel.com with ESMTP; 23 May 2022 03:22:28 -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 v9 00/13] add virtio_blk device support to vdpa/ifc Date: Mon, 23 May 2022 17:35:11 +0800 Message-Id: <1653298524-232138-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. 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 | 415 +++++++++++++++++++++++++++++++-- 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 | 88 +++++++ lib/vhost/vhost_user.h | 13 ++ usertools/dpdk-devbind.py | 5 +- 14 files changed, 739 insertions(+), 31 deletions(-) create mode 100644 examples/vdpa/vdpa_blk_compact.h -- 1.8.3.1