[dpdk-dev] [RFC][PATCH 0/3] example/vhost: Introduce Vswitch Framework

Pankaj Chauhan pankaj.chauhan at nxp.com
Sat Aug 27 18:26:23 CEST 2016


Introduce generic vswitch framework in vhost-switch application. Following
are the goals/aim of the framework:

1. Make vhost-switch application generic so that it can support devices 
which don't support VMDQ.

2. Provide a framework so that any switching logic (generic in software or
vendor specefic like VMDQ) can work with vhost-switch. Thus making vhost-switch
applicable for multiple platforms of different vendors.

3. Make vhost-switch and switching logic scalable in terms of ports or policies
of doing rx/tx across the ports added to switch.

The patchset includes three patches:
1. "Add vswitch(generic switch) framework": This adds the generic framework, it provides
the APIs/accessor functions which the vhos-switch application uses without knowing
anything about underlying switching logic. The framework introduces the concept of
vswitch_device, vswitch_port, and vswitch_ops. The idea is that vhost-switch will
sit over the framework and different switching logics will plug into the framework
underneath it. Please refer the patch description for more details of devices, ports
and ops.

2. "Add vswitch command line options": Adds two new command line options for vswitch.
3. "Add VMDQ vswitch device": This patch basically delinks existing vhost/main.[c,h]
from VMDQ and adds VMDQ as a vswitch device implmentation which plugs into the vswitch
framework. Any other vendor logic for switching can also be plugged in same way.

Thanks to Tan Jianfeng, Yuanhan Liu, Maxime coquelin for early discussions and inputs
on this concept.

** Caution and disclaimer **
1. The patch set is not tested, it just compiles fine: I just finished the coding and
sending the RFC patch so that it can be reviewed early. In parallel i will start testing it
and therefore please forgive if you find some code which you think will crash shamelessly
(i know it will crash :), it is not tested). So please review the concept, meanwhile
i will test and  send the next version soon.

2. This patchset is first step towards using vhost-switch on platforms other than
intel and making it generic. It is no way complete, so i expect that we discuss/develop
toghether towards the goals i mentioned in this cover letter.

TODO list:
1. Test obviously : i will do it in comming week, once basic things are working i will
send another version which you can use for your testing. Till then don't spend your
time in test because i am sure it will waste your time for my silly mistakes.

2. Addd constructor based logic for registration of Vswitch implmentations like VMDQ.
we will use similar mechanism as registration of PMD drivers (base on constructor function)
to register all the switch implmentations in vhost-switch and then select the required
implementation using command line option 'switch'.

Pankaj Chauhan (3):
  examples/vhost: Add vswitch (generic switch) framework
  examples/vhost: Add vwitch command line options
  examples/vhost: Add VMDQ vswitch device

 examples/vhost/Makefile         |   2 +-
 examples/vhost/main.c           | 603 +++++++++++--------------------------
 examples/vhost/main.h           |  10 +
 examples/vhost/vmdq.c           | 649 ++++++++++++++++++++++++++++++++++++++++
 examples/vhost/vmdq.h           |  59 ++++
 examples/vhost/vswitch_common.c | 467 +++++++++++++++++++++++++++++
 examples/vhost/vswitch_common.h | 175 +++++++++++
 7 files changed, 1528 insertions(+), 437 deletions(-)
 create mode 100644 examples/vhost/vmdq.c
 create mode 100644 examples/vhost/vmdq.h
 create mode 100644 examples/vhost/vswitch_common.c
 create mode 100644 examples/vhost/vswitch_common.h

-- 
1.9.1



More information about the dev mailing list