]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/dpdk: replacing rte_exit with ceph_assert to avoid exit failure 44277/head
authorChunsong Feng <fengchunsong@huawei.com>
Fri, 10 Dec 2021 03:39:33 +0000 (03:39 +0000)
committerChunsong Feng <fengchunsong@huawei.com>
Fri, 10 Dec 2021 13:12:03 +0000 (13:12 +0000)
In the DPDK example program,rte_exit is invoked only in the master thread.
The DPDK worker thread cannot invoke rte_exit to avoid waiting forever.

Fixes: https://tracker.ceph.com/issues/53481
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Reviewed-by: luo rixin <luorixin@huawei.com>
Reviewed-by: Han Fengzhe <hanfengzhe@hisilicon.com>
src/msg/async/dpdk/DPDK.cc
src/msg/async/dpdk/DPDK.h

index a17e1788e5474754aca0518d0c10bd4723decc49..a5e5c6d1207232146f11d28eb0e23681f350f303 100644 (file)
@@ -232,9 +232,11 @@ int DPDKDevice::init_port_start()
     } else if (_dev_info.hash_key_size == 52) {
       _rss_key = default_rsskey_52bytes;
     } else if (_dev_info.hash_key_size != 0) {
-      rte_exit(EXIT_FAILURE,
-               "Port %d: We support only 40 or 52 bytes RSS hash keys, %d bytes key requested",
-               _port_idx, _dev_info.hash_key_size);
+      lderr(cct) << "Port " << int(_port_idx)
+                << ": We support only 40 or 52 bytes RSS hash keys, "
+                << int(_dev_info.hash_key_size) << " bytes key requested"
+                << dendl;
+      return -EINVAL;
     } else {
       _rss_key = default_rsskey_40bytes;
       _dev_info.hash_key_size = 40;
@@ -1250,7 +1252,7 @@ std::unique_ptr<DPDKDevice> create_dpdk_net_device(
 {
   // Check that we have at least one DPDK-able port
   if (rte_eth_dev_count_avail() == 0) {
-    rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
+    ceph_assert(false && "No Ethernet ports - bye\n");
   } else {
     ldout(cct, 10) << __func__ << " ports number: " << int(rte_eth_dev_count_avail()) << dendl;
   }
index 47c09340d63e485d25a6e55b0e0a444246eaa629..13923c728714285efb6fb87fd106d893bc0450c1 100644 (file)
@@ -811,7 +811,7 @@ class DPDKDevice {
     /* now initialise the port we will use */
     int ret = init_port_start();
     if (ret != 0) {
-      rte_exit(EXIT_FAILURE, "Cannot initialise port %u\n", _port_idx);
+      ceph_assert(false && "Cannot initialise port\n");
     }
     std::string name(std::string("port") + std::to_string(port_idx));
     PerfCountersBuilder plb(cct, name, l_dpdk_dev_first, l_dpdk_dev_last);