DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH RFC 0/2] vhost: support selective datapath
@ 2017-12-23  3:36 Zhihong Wang
  2017-12-23  3:36 ` [dpdk-dev] [PATCH RFC 1/2] vhost: make capabilities configurable Zhihong Wang
  2017-12-23  3:36 ` [dpdk-dev] [PATCH RFC 2/2] vhost: support selective datapath Zhihong Wang
  0 siblings, 2 replies; 5+ messages in thread
From: Zhihong Wang @ 2017-12-23  3:36 UTC (permalink / raw)
  To: dev
  Cc: jianfeng.tan, tiwei.bie, maxime.coquelin, yliu, cunming.liang,
	xiao.w.wang, dan.daly

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-31  5:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-23  3:36 [dpdk-dev] [PATCH RFC 0/2] vhost: support selective datapath Zhihong Wang
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

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).