[ovs-dev,RFC,V2,1/2] netdev-dpdk: DPDK v17.11 upgrade

Message ID 1510142410-169357-2-git-send-email-mark.b.kavanagh@intel.com
State Superseded
Headers show
Series
  • DPDK v17.11 Support
Related show

Commit Message

Mark Kavanagh Nov. 8, 2017, noon
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

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>

---
 .travis/linux-build.sh                   |  2 +-
 Documentation/faq/releases.rst           |  1 +
 Documentation/intro/install/dpdk.rst     | 10 +++++-----
 Documentation/topics/dpdk/ring.rst       |  2 +-
 Documentation/topics/dpdk/vhost-user.rst |  8 ++++----
 NEWS                                     |  2 ++
 lib/netdev-dpdk.c                        |  7 ++++---
 7 files changed, 18 insertions(+), 14 deletions(-)

Comments

Christian Ehrhardt Nov. 20, 2017, 1:03 p.m. | #1
On Wed, Nov 8, 2017 at 1:00 PM, Mark Kavanagh <mark.b.kavanagh@intel.com> wrote:
> 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
>
> Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>


> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 76e79be..ed5bf62 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -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>
> @@ -150,8 +151,8 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
>
>  #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)
> @@ -2582,7 +2583,7 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED,
>  {
>      int ret;
>      char *response;
> -    uint8_t port_id;
> +    dpdk_port_t port_id;
>      char devname[RTE_ETH_NAME_MAX_LEN];
>      struct netdev_dpdk *dev;

Hi Mark,
I today independently came to exactly the same changes to get it
building until I saw this mail.
We discussed the option to handle things depending on the DPDK version
built against via config time checks, but then as OVS "defines" a DPDK
version that it matches you might not want/need that complexity.
That said it implies I reviewed and tested (well built) them, so
bumping the thread and feel free to add:
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Mark Kavanagh Nov. 22, 2017, 9:48 a.m. | #2
>From: Christian Ehrhardt [mailto:christian.ehrhardt@canonical.com]
>Sent: Monday, November 20, 2017 1:04 PM
>To: Kavanagh, Mark B <mark.b.kavanagh@intel.com>
>Cc: <dev@openvswitch.org> <dev@openvswitch.org>; maxime.coquelin@redhat.com
>Subject: Re: [ovs-dev] [RFC PATCH V2 1/2] netdev-dpdk: DPDK v17.11 upgrade
>
>On Wed, Nov 8, 2017 at 1:00 PM, Mark Kavanagh <mark.b.kavanagh@intel.com>
>wrote:
>> 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
>>
>> Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
>
>
>> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>> index 76e79be..ed5bf62 100644
>> --- a/lib/netdev-dpdk.c
>> +++ b/lib/netdev-dpdk.c
>> @@ -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>
>> @@ -150,8 +151,8 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF /
>ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
>>
>>  #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)
>> @@ -2582,7 +2583,7 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc
>OVS_UNUSED,
>>  {
>>      int ret;
>>      char *response;
>> -    uint8_t port_id;
>> +    dpdk_port_t port_id;
>>      char devname[RTE_ETH_NAME_MAX_LEN];
>>      struct netdev_dpdk *dev;
>
>Hi Mark,
>I today independently came to exactly the same changes to get it
>building until I saw this mail.
>We discussed the option to handle things depending on the DPDK version
>built against via config time checks, but then as OVS "defines" a DPDK
>version that it matches you might not want/need that complexity.

Hi Christian,

Thanks for the review/ack.

Can you provide some additional details regarding the config time checks that you mentioned?

Thanks in advance,
Mark



>That said it implies I reviewed and tested (well built) them, so
>bumping the thread and feel free to add:
>Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Stokes, Ian Nov. 22, 2017, 9:58 a.m. | #3
> >From: Christian Ehrhardt [mailto:christian.ehrhardt@canonical.com]
> >Sent: Monday, November 20, 2017 1:04 PM
> >To: Kavanagh, Mark B <mark.b.kavanagh@intel.com>
> >Cc: <dev@openvswitch.org> <dev@openvswitch.org>;
> >maxime.coquelin@redhat.com
> >Subject: Re: [ovs-dev] [RFC PATCH V2 1/2] netdev-dpdk: DPDK v17.11
> >upgrade
> >
> >On Wed, Nov 8, 2017 at 1:00 PM, Mark Kavanagh
> ><mark.b.kavanagh@intel.com>
> >wrote:
> >> 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
> >>
> >> Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
> >
> >
> >> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index
> >> 76e79be..ed5bf62 100644
> >> --- a/lib/netdev-dpdk.c
> >> +++ b/lib/netdev-dpdk.c
> >> @@ -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>
> >> @@ -150,8 +151,8 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF /
> >ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
> >>
> >>  #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) @@
> >> -2582,7 +2583,7 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int
> >> argc
> >OVS_UNUSED,
> >>  {
> >>      int ret;
> >>      char *response;
> >> -    uint8_t port_id;
> >> +    dpdk_port_t port_id;
> >>      char devname[RTE_ETH_NAME_MAX_LEN];
> >>      struct netdev_dpdk *dev;

As an FYI the change for the DPDK port ID above has been added to master already from a previous patch submitted by Mark as part of the latest pull request for OVS DPDK with commit 7ee94cbac874910174bd5e160482a5aaeb64f4e5.

Thanks
Ian

> >
> >Hi Mark,
> >I today independently came to exactly the same changes to get it
> >building until I saw this mail.
> >We discussed the option to handle things depending on the DPDK version
> >built against via config time checks, but then as OVS "defines" a DPDK
> >version that it matches you might not want/need that complexity.
> 
> Hi Christian,
> 
> Thanks for the review/ack.
> 
> Can you provide some additional details regarding the config time checks
> that you mentioned?
> 
> Thanks in advance,
> Mark
> 
> 
> 
> >That said it implies I reviewed and tested (well built) them, so
> >bumping the thread and feel free to add:
> >Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Patch

diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 4d6459f..ed28ee4 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -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
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index d903b06..62a1957 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -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:
diff --git a/Documentation/intro/install/dpdk.rst b/Documentation/intro/install/dpdk.rst
index bb69ae5..3fecb5c 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -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`_
 
@@ -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
@@ -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
 --------------
diff --git a/Documentation/topics/dpdk/ring.rst b/Documentation/topics/dpdk/ring.rst
index ad9d7a5..8d0ede8 100644
--- a/Documentation/topics/dpdk/ring.rst
+++ b/Documentation/topics/dpdk/ring.rst
@@ -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
diff --git a/Documentation/topics/dpdk/vhost-user.rst b/Documentation/topics/dpdk/vhost-user.rst
index 74ac06e..fdf6ae1 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -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-stable-17.11
     $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
     $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
     $ cd $DPDK_DIR
@@ -378,7 +378,7 @@  Sample XML
         </disk>
         <disk type='dir' device='disk'>
           <driver name='qemu' type='fat'/>
-          <source dir='/usr/src/dpdk-stable-17.05.2'/>
+          <source dir='/usr/src/dpdk-17.11'/>
           <target dev='vdb' bus='virtio'/>
           <readonly/>
         </disk>
diff --git a/NEWS b/NEWS
index 047f34b..6acd8bd 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@  Post-v2.8.0
          IPv6 packets.
    - Linux kernel 4.13
      * Add support for compiling OVS with the latest Linux 4.13 kernel
+   - DPDK:
+     * Add support for DPDK v17.11
 
 v2.8.0 - 31 Aug 2017
 --------------------
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 76e79be..ed5bf62 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -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>
@@ -150,8 +151,8 @@  BUILD_ASSERT_DECL((MAX_NB_MBUF / ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
 
 #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)
@@ -2582,7 +2583,7 @@  netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED,
 {
     int ret;
     char *response;
-    uint8_t port_id;
+    dpdk_port_t port_id;
     char devname[RTE_ETH_NAME_MAX_LEN];
     struct netdev_dpdk *dev;