DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: ray.kinsella@intel.com, kuralamudhan.ramakrishnan@intel.com,
	louise.m.daly@intel.com, bruce.richardson@intel.com,
	ferruh.yigit@intel.com, konstantin.ananyev@intel.com
Subject: [dpdk-dev] [RFC 06/10] ipc: add support for no-shared-files mode
Date: Thu, 31 May 2018 15:32:29 +0100	[thread overview]
Message-ID: <2cfeba2f688f7c431a80559d370c421704bd64f1.1527776837.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <cover.1527776837.git.anatoly.burakov@intel.com>
In-Reply-To: <cover.1527776837.git.anatoly.burakov@intel.com>

IPC is an inter-process communication mechanism. Since no secondaries
can ever be expected to run in no shared files mode, IPC will be
useless, so do not enable it in the first place. In the interests of
API usage convenience, we will still allow registering callbacks, but
obviously they won't ever be triggered.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_proc.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index 707d8ab30..6cce4e925 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -626,6 +626,14 @@ rte_mp_channel_init(void)
 	int dir_fd;
 	pthread_t mp_handle_tid, async_reply_handle_tid;
 
+	/* in no shared files mode, we do not have secondary processes support,
+	 * so no need to initialize IPC.
+	 */
+	if (internal_config.no_shared_files) {
+		RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC will be disabled\n");
+		return 0;
+	}
+
 	/* create filter path */
 	create_socket_path("*", path, sizeof(path));
 	strlcpy(mp_filter, basename(path), sizeof(mp_filter));
@@ -988,6 +996,12 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,
 
 	if (check_input(req) == false)
 		return -1;
+
+	if (internal_config.no_shared_files) {
+		RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC is disabled\n");
+		return 0;
+	}
+
 	if (gettimeofday(&now, NULL) < 0) {
 		RTE_LOG(ERR, EAL, "Faile to get current time\n");
 		rte_errno = errno;
@@ -1072,6 +1086,12 @@ rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
 
 	if (check_input(req) == false)
 		return -1;
+
+	if (internal_config.no_shared_files) {
+		RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC is disabled\n");
+		return 0;
+	}
+
 	if (gettimeofday(&now, NULL) < 0) {
 		RTE_LOG(ERR, EAL, "Faile to get current time\n");
 		rte_errno = errno;
@@ -1213,5 +1233,10 @@ rte_mp_reply(struct rte_mp_msg *msg, const char *peer)
 		return -1;
 	}
 
+	if (internal_config.no_shared_files) {
+		RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC is disabled\n");
+		return 0;
+	}
+
 	return mp_send(msg, peer, MP_REP);
 }
-- 
2.17.0

  parent reply	other threads:[~2018-05-31 14:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 14:32 [dpdk-dev] [RFC 00/10] Support running DPDK without hugetlbfs mountpoint Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 01/10] eal: add --no-shared-files option Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 02/10] eal: make --no-shconf an alias for --no-shared-files Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 03/10] eal: make --huge-unlink " Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 04/10] fbarray: support no-shared-files mode Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 05/10] mem: add support for " Anatoly Burakov
2018-05-31 14:32 ` Anatoly Burakov [this message]
2018-05-31 14:32 ` [dpdk-dev] [RFC 07/10] eal: add support for no-shared-files for hugepage info Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 08/10] eal: add support for no-shared-files in hugepage data file Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 09/10] eal: do not create runtime dir in no-shared-files mode Anatoly Burakov
2018-05-31 14:32 ` [dpdk-dev] [RFC 10/10] mem: enable memfd-based hugepage allocation Anatoly Burakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cfeba2f688f7c431a80559d370c421704bd64f1.1527776837.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=kuralamudhan.ramakrishnan@intel.com \
    --cc=louise.m.daly@intel.com \
    --cc=ray.kinsella@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).