DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zhihong Wang <zhihong.wang@intel.com>
To: dev@dpdk.org
Cc: jianfeng.tan@intel.com, tiwei.bie@intel.com,
	maxime.coquelin@redhat.com, yliu@fridaylinux.org,
	cunming.liang@intel.com, xiao.w.wang@intel.com,
	dan.daly@intel.com
Subject: [dpdk-dev] [PATCH RFC 0/2] vhost: support selective datapath
Date: Fri, 22 Dec 2017 22:36:41 -0500	[thread overview]
Message-ID: <1514000203-69699-1-git-send-email-zhihong.wang@intel.com> (raw)

This patch set introduces support for selective datapath in DPDK vhost-user
lib to enable acceleration. The default selection is the existing software
implementation, while more options are available when more engines are
present.

vDPA stands for vhost Data Path Acceleration. The idea is to enable various
types of devices to do data transfer with virtio driver directly.

Design details
====

An engine is a group of devices support virtio datapath operations, like
enqueue, dequeue, interrupt, doorbell. The definition of engine is as
follows:

struct rte_vdpa_eng_id {
        union {
                uint8_t __dummy[64];

                struct {
                        struct rte_pci_addr pci_addr;
                };
        };
};

struct rte_vdpa_eng_attr {
        char name[MAX_VDPA_NAME_LEN];
        struct rte_vdpa_eng_id *id;
};

struct rte_vdpa_dev_ops {
        vdpa_dev_conf_t        dev_conf;
        vdpa_dev_close_t       dev_close;
        vdpa_vring_state_set_t vring_state_set;
        vdpa_migration_done_t  migration_done;
};

struct rte_vdpa_eng_ops {
        vdpa_eng_init_t eng_init;
        vdpa_eng_uninit_t eng_uninit;
};

struct rte_vdpa_eng_driver {
        const char *name;
        struct rte_vdpa_eng_ops eng_ops;
        struct rte_vdpa_dev_ops dev_ops;
} __rte_cache_aligned;

struct rte_vdpa_engine {
        struct rte_vdpa_eng_attr eng_attr;
        struct rte_vdpa_eng_driver *eng_drv;
} __rte_cache_aligned;

Changes to the current vhost-user lib are:
====

 1. Make vhost device capabilities configurable to adopt various engines.
    Such capabilities include supported features, protocol features, queue
    number. APIs are introduced to let app configure these capabilities.

 2. In addition to the existing vhost framework, a set of callbacks is
    added for vhost to call the driver for device operations at the right
    time:

     a. dev_conf: Called to configure the actual device when the virtio
        device becomes ready

     b. dev_close: Called to close the actual device when the virtio device
        is stopped

     c. vring_state_set: Called to change the state of the vring in the
        actual device when vring state changes

     d. migration_done: Called to allow the device to response to RARP
        sending

 3. To make vhost aware of its own type, an engine id (eid) and a device
    id (did) are added into the vhost data structure, to index the actual
    device. APIs are introduced to let app configure it.

Working process:
====

 1. Register driver during DPDK initialization.

 2. Register engine with name and attributes, the name is used to match the
    right driver.

 3. For each vhost device creation in app:
 
      a. Reserve device in the engine, so the eid and did are confirmed.

      b. Register vhost-user socket.

      c. Set capabilities of the vhost-user socket.

      d. Register vhost-user callbacks.

      e. Start to wait for connection.

 4. When connection comes and virtio device data structure is created,
    set the eid and did in the new_device callback.

Zhihong Wang (2):
  vhost: make capabilities configurable
  vhost: support selective datapath

 lib/librte_vhost/Makefile     |   4 +-
 lib/librte_vhost/rte_vdpa.h   | 126 ++++++++++++++++++++++++++++++++++++++++++
 lib/librte_vhost/rte_vhost.h  |  98 ++++++++++++++++++++++++++++++++
 lib/librte_vhost/socket.c     |  77 ++++++++++++++++++++++++++
 lib/librte_vhost/vdpa.c       | 122 ++++++++++++++++++++++++++++++++++++++++
 lib/librte_vhost/vhost.c      |  53 ++++++++++++++++++
 lib/librte_vhost/vhost.h      |   7 +++
 lib/librte_vhost/vhost_user.c |  96 +++++++++++++++++++++++++++-----
 8 files changed, 566 insertions(+), 17 deletions(-)
 create mode 100644 lib/librte_vhost/rte_vdpa.h
 create mode 100644 lib/librte_vhost/vdpa.c

-- 
2.7.5

             reply	other threads:[~2017-12-22 15:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-23  3:36 Zhihong Wang [this message]
2017-12-23  3:36 ` [dpdk-dev] [PATCH RFC 1/2] vhost: make capabilities configurable Zhihong Wang
2018-01-30 14:59   ` Maxime Coquelin
2018-01-31  5:37     ` Wang, Zhihong
2017-12-23  3:36 ` [dpdk-dev] [PATCH RFC 2/2] vhost: support selective datapath Zhihong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1514000203-69699-1-git-send-email-zhihong.wang@intel.com \
    --to=zhihong.wang@intel.com \
    --cc=cunming.liang@intel.com \
    --cc=dan.daly@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=xiao.w.wang@intel.com \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).