On 29.11.2018 19:37, Kevin Traynor wrote:
> DEV_RX_OFFLOAD_CRC_STRIP has been removed from
> DPDK 18.11. DEV_RX_OFFLOAD_KEEP_CRC can now be
> used to keep the CRC. Use the correct flag and
> check it is supported.
> 
> rte_eth_dev_attach/detach have been removed from
> DPDK 18.11. Replace them with rte_dev_probe/remove.
> 
> Update docs and travis to use DPDK18.11.
> 
> Signed-off-by: Kevin Traynor <[email protected]>
> ---

Works fine for me.

Acked-by: Ilya Maximets <[email protected]>

>  .travis/linux-build.sh                   |  8 ++++----
>  Documentation/intro/install/dpdk.rst     | 11 ++++++-----
>  Documentation/topics/dpdk/ring.rst       |  3 ++-
>  Documentation/topics/dpdk/vhost-user.rst |  8 ++++----
>  NEWS                                     |  1 +
>  lib/netdev-dpdk.c                        | 24 +++++++++++++-----------
>  6 files changed, 30 insertions(+), 25 deletions(-)
> 
> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> index 4c9e95201..5f4d838a9 100755
> --- a/.travis/linux-build.sh
> +++ b/.travis/linux-build.sh
> @@ -57,7 +57,7 @@ function install_dpdk()
>          git checkout tags/v$1
>      else
> -        wget http://fast.dpdk.org/rel/dpdk-$1.tar.gz
> -        tar xzvf dpdk-$1.tar.gz > /dev/null
> -        DIR_NAME=$(tar -tf dpdk-$1.tar.gz | head -1 | cut -f1 -d"/")
> +        wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz
> +        tar xvf dpdk-$1.tar.xz > /dev/null
> +        DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/")
>          if [ $DIR_NAME != "dpdk-$1"  ]; then mv $DIR_NAME dpdk-$1; fi
>          cd dpdk-$1
> @@ -84,5 +84,5 @@ fi
>  if [ "$DPDK" ]; then
>      if [ -z "$DPDK_VER" ]; then
> -        DPDK_VER="18.08"
> +        DPDK_VER="18.11"
>      fi
>      install_dpdk $DPDK_VER
> diff --git a/Documentation/intro/install/dpdk.rst 
> b/Documentation/intro/install/dpdk.rst
> index bab3560e7..61307cb7c 100644
> --- a/Documentation/intro/install/dpdk.rst
> +++ b/Documentation/intro/install/dpdk.rst
> @@ -43,5 +43,5 @@ In addition to the requirements described in 
> :doc:`general`, building Open
>  vSwitch with DPDK will require the following:
>  
> -- DPDK 18.08.0
> +- DPDK 18.11
>  
>  - A `DPDK supported NIC`_
> @@ -72,7 +72,7 @@ Install DPDK
>  
>         $ cd /usr/src/
> -       $ wget http://fast.dpdk.org/rel/dpdk-18.08.tar.xz
> -       $ tar xf dpdk-18.08.tar.xz
> -       $ export DPDK_DIR=/usr/src/dpdk-stable-18.08
> +       $ wget http://fast.dpdk.org/rel/dpdk-18.11.tar.xz
> +       $ tar xf dpdk-18.11.tar.xz
> +       $ export DPDK_DIR=/usr/src/dpdk-18.11
>         $ cd $DPDK_DIR
>  
> @@ -673,5 +673,6 @@ Limitations
>    release notes`_.
>  
> -.. _DPDK release notes: 
> http://dpdk.org/doc/guides/rel_notes/release_18_08.html
> +.. _DPDK release notes:
> +   https://doc.dpdk.org/guides/rel_notes/release_18_11.html
>  
>  - Upper bound MTU: DPDK device drivers differ in how the L2 frame for a
> diff --git a/Documentation/topics/dpdk/ring.rst 
> b/Documentation/topics/dpdk/ring.rst
> index 9ef1dc3a5..e48b44ce8 100644
> --- a/Documentation/topics/dpdk/ring.rst
> +++ b/Documentation/topics/dpdk/ring.rst
> @@ -83,3 +83,4 @@ DPDK. However, this functionality was removed because:
>    guests
>  
> -.. _DPDK documentation: 
> https://dpdk.readthedocs.io/en/v17.11/prog_guide/ring_lib.html
> +.. _DPDK documentation:
> +   https://doc.dpdk.org/guides-18.11/prog_guide/ring_lib.html
> diff --git a/Documentation/topics/dpdk/vhost-user.rst 
> b/Documentation/topics/dpdk/vhost-user.rst
> index 062605ced..993797de5 100644
> --- a/Documentation/topics/dpdk/vhost-user.rst
> +++ b/Documentation/topics/dpdk/vhost-user.rst
> @@ -321,7 +321,7 @@ DPDK sources to VM and build DPDK::
>  
>      $ cd /root/dpdk/
> -    $ wget http://fast.dpdk.org/rel/dpdk-18.08.tar.xz
> -    $ tar xf dpdk-18.08.tar.xz
> -    $ export DPDK_DIR=/root/dpdk/dpdk-stable-18.08
> +    $ wget http://fast.dpdk.org/rel/dpdk-18.11.tar.xz
> +    $ tar xf dpdk-18.11.tar.xz
> +    $ export DPDK_DIR=/root/dpdk/dpdk-18.11
>      $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
>      $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
> @@ -503,3 +503,3 @@ Because of this limitation, this feature is considered 
> 'experimental'.
>  Further information can be found in the
>  `DPDK documentation
> -<http://dpdk.readthedocs.io/en/v17.11/prog_guide/vhost_lib.html>`__
> +<https://doc.dpdk.org/guides-18.11/prog_guide/vhost_lib.html>`__
> diff --git a/NEWS b/NEWS
> index 02402d1a4..358c9b97e 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -13,4 +13,5 @@ Post-v2.10.0
>       * Add option for simple round-robin based Rxq to PMD assignment.
>         It can be set with pmd-rxq-assign.
> +     * Add support for DPDK 18.11
>     - Add 'symmetric_l3' hash function.
>     - OVS now honors 'updelay' and 'downdelay' for bonds with LACP configured.
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index db803ea5c..6b8e05e4f 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -930,6 +930,7 @@ dpdk_eth_dev_port_config(struct netdev_dpdk *dev, int 
> n_rxq, int n_txq)
>      }
>  
> -    if (dev->hw_ol_features & NETDEV_RX_HW_CRC_STRIP) {
> -        conf.rxmode.offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
> +    if (!(dev->hw_ol_features & NETDEV_RX_HW_CRC_STRIP)
> +        && info.rx_offload_capa & DEV_RX_OFFLOAD_KEEP_CRC) {
> +        conf.rxmode.offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
>      }
>  
> @@ -1351,5 +1352,5 @@ netdev_dpdk_destruct(struct netdev *netdev)
>  {
>      struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
> -    char devname[RTE_ETH_NAME_MAX_LEN];
> +    struct rte_eth_dev_info dev_info;
>  
>      ovs_mutex_lock(&dpdk_mutex);
> @@ -1360,8 +1361,9 @@ netdev_dpdk_destruct(struct netdev *netdev)
>      if (dev->attached) {
>          rte_eth_dev_close(dev->port_id);
> -        if (rte_eth_dev_detach(dev->port_id, devname) < 0) {
> +        rte_eth_dev_info_get(dev->port_id, &dev_info);
> +        if (dev_info.device && !rte_dev_remove(dev_info.device)) {
> +            VLOG_INFO("Device '%s' has been detached", dev->devargs);
> +        } else {
>              VLOG_ERR("Device '%s' can not be detached", dev->devargs);
> -        } else {
> -            VLOG_INFO("Device '%s' has been detached", devname);
>          }
>      }
> @@ -1653,5 +1655,6 @@ netdev_dpdk_process_devargs(struct netdev_dpdk *dev,
>                  || !rte_eth_dev_is_valid_port(new_port_id)) {
>              /* Device not found in DPDK, attempt to attach it */
> -            if (!rte_eth_dev_attach(devargs, &new_port_id)) {
> +            if (!rte_dev_probe(devargs)
> +                && !rte_eth_dev_get_port_by_name(name, &new_port_id)) {
>                  /* Attach successful */
>                  dev->attached = true;
> @@ -3229,9 +3232,8 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc 
> OVS_UNUSED,
>                     const char *argv[], void *aux OVS_UNUSED)
>  {
> -    int ret;
>      char *response;
>      dpdk_port_t port_id;
> -    char devname[RTE_ETH_NAME_MAX_LEN];
>      struct netdev_dpdk *dev;
> +    struct rte_eth_dev_info dev_info;
>  
>      ovs_mutex_lock(&dpdk_mutex);
> @@ -3252,6 +3254,6 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc 
> OVS_UNUSED,
>      rte_eth_dev_close(port_id);
>  
> -    ret = rte_eth_dev_detach(port_id, devname);
> -    if (ret < 0) {
> +    rte_eth_dev_info_get(port_id, &dev_info);
> +    if (!dev_info.device || rte_dev_remove(dev_info.device)) {
>          response = xasprintf("Device '%s' can not be detached", argv[1]);
>          goto error;
> 
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to