[ovs-dev] [v5 dpdk-latest 1/1] dpdk: Update to use DPDK 18.11-rc4.

Kevin Traynor ktraynor at redhat.com
Thu Nov 22 15:49:24 UTC 2018


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 travis to use DPDK18.11-rc4 (tarball only).

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
---
 .travis/linux-build.sh |  8 ++++----
 lib/netdev-dpdk.c      | 24 +++++++++++++-----------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 4c9e95201..aa2acff83 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://git.dpdk.org/dpdk/snapshot/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="d82e5db6f6561356990000cac40e78b59ba0c65f"
     fi
     install_dpdk $DPDK_VER
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 1480bf8d1..af310b06b 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;
@@ -3209,9 +3212,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);
@@ -3232,6 +3234,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;
-- 
2.19.0



More information about the dev mailing list