From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71E62A0563; Wed, 15 Apr 2020 12:06:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A585C1D63A; Wed, 15 Apr 2020 12:06:29 +0200 (CEST) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by dpdk.org (Postfix) with ESMTP id 102F31D579 for ; Wed, 15 Apr 2020 12:06:28 +0200 (CEST) Received: by mail-qt1-f175.google.com with SMTP id s30so12731234qth.2 for ; Wed, 15 Apr 2020 03:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=z89mfceuNp+QnakzDdCGHDDdkDputWJoEm2VLUE6r6U=; b=qdiBl9aUPaBGMc5nRZTpgszN7wLwhRAOO1GyIDwh8JV5qO6QZqhbGiIUj+/d4AWqxB KiOrT3pH+6Y8fVQWr7TF3/qlwM8/wXltvbbmb6uvT5WzGhPTUV0CjkmugXMMGEZrKuPE OWGULriO/kMBUbalZuuxUfA9KvnJlJa7n+b/iiWWG/Jhy6wvNZaOxga/wnqaFFE8FLsZ D/tJXu1X9+t5NNUAP0xWAjKU1Clz3STaR+R3OinUvj323KcfdWks0X6irYRf8E3FdQ6C dXb6HbyvsVK27HLuzTAzqNz2NXD7MYRkHYnWwH543J/ZS3JmE/IAr2TOzC6f1yAabFbc XxNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=z89mfceuNp+QnakzDdCGHDDdkDputWJoEm2VLUE6r6U=; b=nbmMGDalr9Nb0c1xW+hcnY04ncfj0G4wieaPrqUGf44u3p+Pmg0d++BAQybyX/s/xF XLmPEaAk4G9OU4DlXoZsUARcPDwjtN0VbpfLYgMvcDDblx3fcUxUcnmwsaXq8373HlAk OyB37F4I7gZkA/VzuAxOPtTu9nwk5Szple0Ei+RTGwaIOGg4wg4xy6FcsHS2My9Arsak 4X6/gb5SN5TNLaXCfFwrAZ/1AG5Z6pvfqdJmmQqbSdim2KQMa5Yr7+N9i/QTi7Koo45y G2bXj1EBCsnscFIKvYUKM15eBJdRHv0aVO2AIbnt8g9JazVK0YPMd5Lj+VkI/6VILjOg WuFA== X-Gm-Message-State: AGi0PuYcfdAL1tmSRuYfhQcVWPFUvgeUflIHRHkP3xA1SGWSAD6gd0in 4ncxkI42appiylVejKGjwOybaXpYuTqSgI7LYreZJKxw X-Google-Smtp-Source: APiQypL4upb/KHf4Xkr8eagOgtxSP6TJQ9CN3RoOEzlNbQ6jXz+6zD5YlwiQsBw1uL6ChCNGzsJCptj/G68UDoISS4I= X-Received: by 2002:ac8:4e56:: with SMTP id e22mr20772735qtw.185.1586945187100; Wed, 15 Apr 2020 03:06:27 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?6ZmI5Lqa6L6JLeS6keadieeglOWPkemDqA==?= Date: Wed, 15 Apr 2020 18:06:14 +0800 Message-ID: To: dev@dpdk.org, jiping@yunshan.net, xiangyang@yunshan.net Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] eal: can not run secondary process on openstack environment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" dpdk version: 18.11 Ovs-dpdk runs as openvswitch account on the openstack environment. Use the root account to run another --proc-type=secondary program, such as dpdk-pdump or helloword with parameter --proc-type=secondary , and it will report an Err: Cannot open '/var/run/dpdk/rte/config' for rte_mem_config. Check the source code eal.c: int eal_create_runtime_dir(void) { const char *directory = default_runtime_dir; const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"); const char *fallback = "/tmp"; char tmp[PATH_MAX]; int ret; if (getuid() != 0) { /* try XDG path first, fall back to /tmp */ if (xdg_runtime_dir != NULL) directory = xdg_runtime_dir; else directory = fallback; } /* create DPDK subdirectory under runtime dir */ ret = snprintf(tmp, sizeof(tmp), "%s/dpdk", directory); if (ret < 0 || ret == sizeof(tmp)) { RTE_LOG(ERR, EAL, "Error creating DPDK runtime path name\n"); return -1; } /* create prefix-specific subdirectory under DPDK runtime dir */ ret = snprintf(runtime_dir, sizeof(runtime_dir), "%s/%s", tmp, eal_get_hugefile_prefix()); if (ret < 0 || ret == sizeof(runtime_dir)) { RTE_LOG(ERR, EAL, "Error creating prefix-specific runtime path name\n"); return -1; } The root account is corresponds to the directory /var/run/DPDK/rte, but openvswitch account is directory /var/run/openvswitch DPDK/rte. Then, I changed to the openvswitch account and run the process again, errors below were reported: EAL: Detected 40 lcore(s) EAL: Detected 2 NUMA nodes EAL: Multi-process socket /var/run/openvswitch/dpdk/rte/mp_socket_306857_7e76690dafe702 EAL: Probing VFIO support... EAL: VFIO support initialized EAL: Could not map memory from primary process EAL: FATAL: Cannot init memory EAL: Cannot init memory There seems to be insufficient permissions. So, I change the code blow and all the things get to be OK: int eal_create_runtime_dir(void) { const char *directory = default_runtime_dir; const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"); const char *fallback = "/tmp"; char tmp[PATH_MAX]; int ret; if (getuid() != 0) { /* try XDG path first, fall back to /tmp */ if (xdg_runtime_dir != NULL) directory = xdg_runtime_dir; else directory = fallback; } directory = "/var/run/openvswitch"; // added by my for test......... /* create DPDK subdirectory under runtime dir */ ret = snprintf(tmp, sizeof(tmp), "%s/dpdk", directory); if (ret < 0 || ret == sizeof(tmp)) { RTE_LOG(ERR, EAL, "Error creating DPDK runtime path name\n"); return -1; } This is supposed to be a DPDK BUG. Considering that the primary and secondary processes may not be the same account, process with parameter --proc-type=secondary should get the runtime directory from the primary process instead of generating a directory as it does now.