Skip to content

Commit

Permalink
dpdk: Update to use DPDK v21.11.
Browse files Browse the repository at this point in the history
This commit adds support for DPDK v21.11, it includes the following
changes.

1. ci: Install python elftools for DPDK 21.02.
2. ci: Update meson requirement for DPDK 21.05.
3. netdev-dpdk: Fix build with 21.05.
4. ci: Compile DPDK in non developer mode.

   http://patchwork.ozlabs.org/project/openvswitch/list/?series=242480&state=*

5. netdev-dpdk: Remove access to DPDK internals.
6. netdev-dpdk: Remove unused attribute from rte_flow rule.
7. netdev-dpdk: Fix mbuf macros namespace with 21.11-rc1.
8. netdev-dpdk: Fix vhost namespace with 21.11-rc2.

   http://patchwork.ozlabs.org/project/openvswitch/list/?series=271159&state=*

In addition documentation and DPDK unit tests were also updated in this
commit for use with DPDK v21.11.

For credit all authors of the original commits to 'dpdk-latest' with the above
changes have been added as co-authors for this commit.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Co-authored-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Emma Finn <emma.finn"intel.com>
Tested-by: Seamus Ryan <seamus.ryan@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
  • Loading branch information
istokes and david-marchand committed Dec 9, 2021
1 parent 72745ab commit 17346b3
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 94 deletions.
6 changes: 5 additions & 1 deletion .ci/linux-build.sh
Expand Up @@ -159,6 +159,10 @@ function install_dpdk()
# Disable building DPDK unit tests. Not needed for OVS build or tests.
DPDK_OPTS="$DPDK_OPTS -Dtests=false"

# Disable DPDK developer mode, this results in less build checks and less
# meson verbose outputs.
DPDK_OPTS="$DPDK_OPTS -Ddeveloper_mode=disabled"

# Install DPDK using prefix.
DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"

Expand Down Expand Up @@ -216,7 +220,7 @@ fi

if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
if [ -z "$DPDK_VER" ]; then
DPDK_VER="20.11.1"
DPDK_VER="21.11"
fi
install_dpdk $DPDK_VER
if [ "$CC" = "clang" ]; then
Expand Down
4 changes: 2 additions & 2 deletions .ci/linux-prepare.sh
Expand Up @@ -21,8 +21,8 @@ make -j4 HAVE_LLVM= HAVE_SQLITE= install
cd ..

pip3 install --disable-pip-version-check --user \
flake8 hacking sphinx wheel setuptools
pip3 install --user 'meson==0.47.1'
flake8 hacking sphinx wheel setuptools pyelftools
pip3 install --user 'meson==0.49.2'

if [ "$M32" ]; then
# Installing 32-bit libraries.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/faq/releases.rst
Expand Up @@ -225,7 +225,7 @@ Q: Are all the DPDK releases that OVS versions work with maintained?
The latest information about DPDK stable and LTS releases can be found
at `DPDK stable`_.

.. _DPDK stable: http://doc.dpdk.org/guides-20.11/contributing/stable.html
.. _DPDK stable: http://doc.dpdk.org/guides-21.11/contributing/stable.html

Q: I get an error like this when I configure Open vSwitch:

Expand Down
16 changes: 8 additions & 8 deletions Documentation/intro/install/dpdk.rst
Expand Up @@ -42,7 +42,7 @@ Build requirements
In addition to the requirements described in :doc:`general`, building Open
vSwitch with DPDK will require the following:

- DPDK 20.11.1
- DPDK 21.11

- A `DPDK supported NIC`_

Expand All @@ -59,8 +59,8 @@ vSwitch with DPDK will require the following:

Detailed system requirements can be found at `DPDK requirements`_.

.. _DPDK supported NIC: https://doc.dpdk.org/guides-20.11/nics/index.html
.. _DPDK requirements: https://doc.dpdk.org/guides-20.11/linux_gsg/sys_reqs.html
.. _DPDK supported NIC: https://doc.dpdk.org/guides-21.11/nics/index.html
.. _DPDK requirements: https://doc.dpdk.org/guides-21.11/linux_gsg/sys_reqs.html

.. _dpdk-install:

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

$ cd /usr/src/
$ wget https://fast.dpdk.org/rel/dpdk-20.11.1.tar.xz
$ tar xf dpdk-20.11.1.tar.xz
$ export DPDK_DIR=/usr/src/dpdk-stable-20.11.1
$ wget https://fast.dpdk.org/rel/dpdk-21.11.tar.xz
$ tar xf dpdk-21.11.tar.xz
$ export DPDK_DIR=/usr/src/dpdk-21.11
$ cd $DPDK_DIR

#. Configure and install DPDK using Meson
Expand Down Expand Up @@ -121,7 +121,7 @@ Install DPDK

.. _DPDK sources: http://dpdk.org/rel
.. _DPDK documentation:
https://doc.dpdk.org/guides-20.11/linux_gsg/build_dpdk.html
https://doc.dpdk.org/guides-21.11/linux_gsg/build_dpdk.html

Install OVS
~~~~~~~~~~~
Expand Down Expand Up @@ -722,7 +722,7 @@ Limitations
release notes`_.

.. _DPDK release notes:
https://doc.dpdk.org/guides-20.11/rel_notes/release_20_11.html
https://doc.dpdk.org/guides-21.11/rel_notes/release_21_11.html

- Upper bound MTU: DPDK device drivers differ in how the L2 frame for a
given MTU value is calculated e.g. i40e driver includes 2 x vlan headers in
Expand Down
8 changes: 4 additions & 4 deletions Documentation/topics/dpdk/phy.rst
Expand Up @@ -117,7 +117,7 @@ tool::

For more information, refer to the `DPDK documentation <dpdk-drivers>`__.

.. _dpdk-drivers: https://doc.dpdk.org/guides-20.11/linux_gsg/linux_drivers.html
.. _dpdk-drivers: https://doc.dpdk.org/guides-21.11/linux_gsg/linux_drivers.html

.. _dpdk-phy-multiqueue:

Expand Down Expand Up @@ -235,7 +235,7 @@ To hotplug a port with igb_uio in this case, DPDK must be configured to use
physical addressing for IOVA mode. For more information regarding IOVA modes
in DPDK please refer to the `DPDK IOVA Mode Detection`__.

__ https://doc.dpdk.org/guides-20.11/prog_guide/env_abstraction_layer.html#iova-mode-detection
__ https://doc.dpdk.org/guides-21.11/prog_guide/env_abstraction_layer.html#iova-mode-detection

To configure OVS DPDK to use physical addressing for IOVA::

Expand Down Expand Up @@ -267,7 +267,7 @@ Representors are multi devices created on top of one PF.

For more information, refer to the `DPDK documentation`__.

__ https://doc.dpdk.org/guides-20.11/prog_guide/switch_representation.html
__ https://doc.dpdk.org/guides-21.11/prog_guide/switch_representation.html

Prior to port representors there was a one-to-one relationship between the PF
and the eth device. With port representors the relationship becomes one PF to
Expand Down Expand Up @@ -401,7 +401,7 @@ in the ``options`` column of the ``Interface`` table.
kernel netdevice, and be inherited from it when Open vSwitch is restarted,
even if the options described in this section are unset from Open vSwitch.

.. _bifurcated-drivers: https://doc.dpdk.org/guides-20.11/linux_gsg/linux_drivers.html#bifurcated-driver
.. _bifurcated-drivers: https://doc.dpdk.org/guides-21.11/linux_gsg/linux_drivers.html#bifurcated-driver

- Configure the VF MAC address::

Expand Down
2 changes: 1 addition & 1 deletion Documentation/topics/dpdk/vdev.rst
Expand Up @@ -63,4 +63,4 @@ run::
More information on the different types of virtual DPDK PMDs can be found in
the `DPDK documentation`__.

__ https://doc.dpdk.org/guides-20.11/nics/overview.html
__ https://doc.dpdk.org/guides-21.11/nics/overview.html
2 changes: 1 addition & 1 deletion Documentation/topics/dpdk/vhost-user.rst
Expand Up @@ -539,4 +539,4 @@ shown with::

Further information can be found in the
`DPDK documentation
<https://doc.dpdk.org/guides-20.11/prog_guide/vhost_lib.html>`__
<https://doc.dpdk.org/guides-21.11/prog_guide/vhost_lib.html>`__
2 changes: 1 addition & 1 deletion Documentation/topics/testing.rst
Expand Up @@ -353,7 +353,7 @@ All tests are skipped if no hugepages are configured. User must look into the DP
manual to figure out how to `Configure hugepages`_.
The phy test will skip if no compatible physical device is available.

.. _Configure hugepages: https://doc.dpdk.org/guides-20.11/linux_gsg/sys_reqs.html
.. _Configure hugepages: https://doc.dpdk.org/guides-21.11/linux_gsg/sys_reqs.html

All the features documented under `Unit Tests`_ are available for the DPDK
datapath testsuite.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/topics/userspace-tso.rst
Expand Up @@ -46,7 +46,7 @@ datasheet for compatibility. Secondly, the NIC must have an associated DPDK
Poll Mode Driver (PMD) which supports `TSO`. For a list of features per PMD,
refer to the `DPDK documentation`__.

__ https://doc.dpdk.org/guides-20.11/nics/overview.html
__ https://doc.dpdk.org/guides-21.11/nics/overview.html

Enabling TSO
~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -10,6 +10,7 @@ Post-v2.16.0
limiting behavior.
* Add hardware offload support for matching IPv4/IPv6 frag types
(experimental).
* Add support for DPDK 21.11.
- Python:
* For SSL support, the use of the pyOpenSSL library has been replaced
with the native 'ssl' module.
Expand Down
26 changes: 14 additions & 12 deletions lib/dp-packet.h
Expand Up @@ -58,29 +58,31 @@ enum OVS_PACKED_ENUM dp_packet_source {
enum dp_packet_offload_mask {
/* Value 0 is not used. */
/* Is the 'rss_hash' valid? */
DEF_OL_FLAG(DP_PACKET_OL_RSS_HASH, PKT_RX_RSS_HASH, 0x1),
DEF_OL_FLAG(DP_PACKET_OL_RSS_HASH, RTE_MBUF_F_RX_RSS_HASH, 0x1),
/* Is the 'flow_mark' valid? */
DEF_OL_FLAG(DP_PACKET_OL_FLOW_MARK, PKT_RX_FDIR_ID, 0x2),
DEF_OL_FLAG(DP_PACKET_OL_FLOW_MARK, RTE_MBUF_F_RX_FDIR_ID, 0x2),
/* Bad L4 checksum in the packet. */
DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_BAD, PKT_RX_L4_CKSUM_BAD, 0x4),
DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_BAD, RTE_MBUF_F_RX_L4_CKSUM_BAD, 0x4),
/* Bad IP checksum in the packet. */
DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_BAD, PKT_RX_IP_CKSUM_BAD, 0x8),
DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_BAD, RTE_MBUF_F_RX_IP_CKSUM_BAD, 0x8),
/* Valid L4 checksum in the packet. */
DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_GOOD, PKT_RX_L4_CKSUM_GOOD, 0x10),
DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_GOOD, RTE_MBUF_F_RX_L4_CKSUM_GOOD,
0x10),
/* Valid IP checksum in the packet. */
DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_GOOD, PKT_RX_IP_CKSUM_GOOD, 0x20),
DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_GOOD, RTE_MBUF_F_RX_IP_CKSUM_GOOD,
0x20),
/* TCP Segmentation Offload. */
DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_SEG, PKT_TX_TCP_SEG, 0x40),
DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_SEG, RTE_MBUF_F_TX_TCP_SEG, 0x40),
/* Offloaded packet is IPv4. */
DEF_OL_FLAG(DP_PACKET_OL_TX_IPV4, PKT_TX_IPV4, 0x80),
DEF_OL_FLAG(DP_PACKET_OL_TX_IPV4, RTE_MBUF_F_TX_IPV4, 0x80),
/* Offloaded packet is IPv6. */
DEF_OL_FLAG(DP_PACKET_OL_TX_IPV6, PKT_TX_IPV6, 0x100),
DEF_OL_FLAG(DP_PACKET_OL_TX_IPV6, RTE_MBUF_F_TX_IPV6, 0x100),
/* Offload TCP checksum. */
DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_CKSUM, PKT_TX_TCP_CKSUM, 0x200),
DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_CKSUM, RTE_MBUF_F_TX_TCP_CKSUM, 0x200),
/* Offload UDP checksum. */
DEF_OL_FLAG(DP_PACKET_OL_TX_UDP_CKSUM, PKT_TX_UDP_CKSUM, 0x400),
DEF_OL_FLAG(DP_PACKET_OL_TX_UDP_CKSUM, RTE_MBUF_F_TX_UDP_CKSUM, 0x400),
/* Offload SCTP checksum. */
DEF_OL_FLAG(DP_PACKET_OL_TX_SCTP_CKSUM, PKT_TX_SCTP_CKSUM, 0x800),
DEF_OL_FLAG(DP_PACKET_OL_TX_SCTP_CKSUM, RTE_MBUF_F_TX_SCTP_CKSUM, 0x800),
/* Adding new field requires adding to DP_PACKET_OL_SUPPORTED_MASK. */
};

Expand Down

0 comments on commit 17346b3

Please sign in to comment.