Skip to content

Commit

Permalink
netdev-dpdk: DPDK v17.11 upgrade
Browse files Browse the repository at this point in the history
This commit adds support for DPDK v17.11:
- minor updates to accomodate DPDK API changes
- update references to DPDK version in Documentation
- update DPDK version in travis' linux-build script
- document DPDK v17.11 virtio driver bug

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Jan Scheurich <jan.scheurich@ericsson.com>
Tested-by: Jan Scheurich <jan.scheurich@ericsson.com>
Tested-by: Guoshuai Li <ligs@dtdream.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
  • Loading branch information
mark-kavanagh authored and istokes committed Dec 8, 2017
1 parent d1ce9c2 commit 5e925cc
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fi

if [ "$DPDK" ]; then
if [ -z "$DPDK_VER" ]; then
DPDK_VER="17.05.2"
DPDK_VER="17.11"
fi
install_dpdk $DPDK_VER
if [ "$CC" = "clang" ]; then
Expand Down
1 change: 1 addition & 0 deletions Documentation/faq/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ Q: What DPDK version does each Open vSwitch release work with?
2.6.x 16.07.2
2.7.x 16.11.3
2.8.x 17.05.2
2.9.x 17.11
============ =======

Q: I get an error like this when I configure Open vSwitch:
Expand Down
10 changes: 5 additions & 5 deletions Documentation/intro/install/dpdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Build requirements
In addition to the requirements described in :doc:`general`, building Open
vSwitch with DPDK will require the following:

- DPDK 17.05.2
- DPDK 17.11

- A `DPDK supported NIC`_

Expand Down Expand Up @@ -69,9 +69,9 @@ Install DPDK
#. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::

$ cd /usr/src/
$ wget http://fast.dpdk.org/rel/dpdk-17.05.2.tar.xz
$ tar xf dpdk-17.05.2.tar.xz
$ export DPDK_DIR=/usr/src/dpdk-stable-17.05.2
$ wget http://fast.dpdk.org/rel/dpdk-17.11.tar.xz
$ tar xf dpdk-17.11.tar.xz
$ export DPDK_DIR=/usr/src/dpdk-17.11
$ cd $DPDK_DIR

#. (Optional) Configure DPDK as a shared library
Expand Down Expand Up @@ -583,7 +583,7 @@ Limitations
The latest list of validated firmware versions can be found in the `DPDK
release notes`_.

.. _DPDK release notes: http://dpdk.org/doc/guides/rel_notes/release_17_05.html
.. _DPDK release notes: http://dpdk.org/doc/guides/rel_notes/release_17_11.html

Reporting Bugs
--------------
Expand Down
2 changes: 1 addition & 1 deletion Documentation/topics/dpdk/ring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ DPDK. However, this functionality was removed because:
- :doc:`vhost-user interfaces <vhost-user>` are the defacto DPDK-based path to
guests

.. _DPDK documentation: https://dpdk.readthedocs.io/en/v17.05/prog_guide/ring_lib.html
.. _DPDK documentation: https://dpdk.readthedocs.io/en/v17.11/prog_guide/ring_lib.html
32 changes: 27 additions & 5 deletions Documentation/topics/dpdk/vhost-user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ To begin, instantiate a guest as described in :ref:`dpdk-vhost-user` or
DPDK sources to VM and build DPDK::

$ cd /root/dpdk/
$ wget http://fast.dpdk.org/rel/dpdk-17.05.2.tar.xz
$ tar xf dpdk-17.05.2.tar.xz
$ export DPDK_DIR=/root/dpdk/dpdk-stable-17.05.2
$ wget http://fast.dpdk.org/rel/dpdk-17.11.tar.xz
$ tar xf dpdk-17.11.tar.xz
$ export DPDK_DIR=/root/dpdk/dpdk-17.11
$ export DPDK_TARGET=x86_64-native-linuxapp-gcc
$ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
$ cd $DPDK_DIR
Expand Down Expand Up @@ -327,6 +327,28 @@ Finally, start the application::

# TODO

.. important::

DPDK v17.11 virtio PMD contains a bug in the vectorized Rx function that
affects testpmd/DPDK guest applications. As such, guest DPDK applications
should use a non-vectorized Rx function.

The DPDK v17.11 virtio net driver contains a bug that prevents guest DPDK
applications from receiving packets when the vectorized Rx function is used.
This only occurs when guest-bound traffic is live before a DPDK application is
started within the guest, and where two or more forwarding cores are used. As
such, it is not recommended for guests which execute DPDK applications to use
the virtio vectorized Rx function. A simple method of ensuring that a non-
vectorized Rx function is used is to enable mergeable buffers for the guest,
with the following QEMU command line option::

mrg_rxbuf=on

Additional details regarding the virtio driver bug are available on the
`DPDK mailing list`_.

.. _DPDK mailing list: http://dpdk.org/ml/archives/dev/2017-December/082801.html

.. _dpdk-vhost-user-xml:

Sample XML
Expand Down Expand Up @@ -387,15 +409,15 @@ Sample XML
<source type='unix' path='/usr/local/var/run/openvswitch/dpdkvhostuser0' mode='client'/>
<model type='virtio'/>
<driver queues='2'>
<host mrg_rxbuf='off'/>
<host mrg_rxbuf='on'/>
</driver>
</interface>
<interface type='vhostuser'>
<mac address='00:00:00:00:00:02'/>
<source type='unix' path='/usr/local/var/run/openvswitch/dpdkvhostuser1' mode='client'/>
<model type='virtio'/>
<driver queues='2'>
<host mrg_rxbuf='off'/>
<host mrg_rxbuf='on'/>
</driver>
</interface>
<serial type='pty'>
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Post-v2.8.0
* Add support for compiling OVS with the latest Linux 4.13 kernel
- "flush-conntrack" in ovs-dpctl and ovs-appctl now accept a 5-tuple to
delete a specific connection tracking entry.
- DPDK:
* Add support for DPDK v17.11

v2.8.0 - 31 Aug 2017
--------------------
Expand Down
5 changes: 3 additions & 2 deletions lib/netdev-dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <sys/socket.h>
#include <linux/if.h>

#include <rte_bus_pci.h>
#include <rte_config.h>
#include <rte_cycles.h>
#include <rte_errno.h>
Expand Down Expand Up @@ -140,8 +141,8 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);

#define DPDK_ETH_PORT_ID_INVALID RTE_MAX_ETHPORTS

/* DPDK library uses uint8_t for port_id. */
typedef uint8_t dpdk_port_t;
/* DPDK library uses uint16_t for port_id. */
typedef uint16_t dpdk_port_t;

#define VHOST_ENQ_RETRY_NUM 8
#define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)
Expand Down

0 comments on commit 5e925cc

Please sign in to comment.