DPDK patches and discussions
 help / color / mirror / Atom feed
From: Steffen.Bauch@rohde-schwarz.com
To: dev@dpdk.org
Subject: Re: [dpdk-dev] Application framework vs. library
Date: Mon, 1 Aug 2016 11:22:44 +0200	[thread overview]
Message-ID: <OFEE6BE32D.2E238373-ONC1258002.0033706F-C1258002.00338528@rohde-schwarz.com> (raw)

diff --git a/lib/librte_eal/linuxapp/eal/eal.c 
b/lib/librte_eal/linuxapp/eal/eal.c
index bd770cf..f63f2f8 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -664,12 +664,6 @@ eal_check_mem_on_local_socket(void)
                        "memory on local socket!\n");
 }
 
-static int
-sync_func(__attribute__((unused)) void *arg)
-{
-       return 0;
-}
-
 inline static void
 rte_eal_mcfg_complete(void)
 {
@@ -699,26 +693,17 @@ rte_eal_iopl_init(void)
 int
 rte_eal_init(int argc, char **argv)
 {
-       int i, fctret, ret;
-       pthread_t thread_id;
-       static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
+       int fctret;
        struct shared_driver *solib = NULL;
        const char *logid;
-       char cpuset[RTE_CPU_AFFINITY_STR_LEN];
-
-       if (!rte_atomic32_test_and_set(&run_once))
-               return -1;
 
-       logid = strrchr(argv[0], '/');
-       logid = strdup(logid ? logid + 1: argv[0]);
-
-       thread_id = pthread_self();
+       logid = NULL;
 
        if (rte_eal_log_early_init() < 0)
-               rte_panic("Cannot init early logs\n");
+               return -1;
 
        if (rte_eal_cpu_init() < 0)
-               rte_panic("Cannot detect lcores\n");
+               return -1;
 
        fctret = eal_parse_args(argc, argv);
        if (fctret < 0)
@@ -731,7 +716,7 @@ rte_eal_init(int argc, char **argv)
                        internal_config.process_type != RTE_PROC_SECONDARY 
&&
                        internal_config.xen_dom0_support == 0 &&
                        eal_hugepage_info_init() < 0)
-               rte_panic("Cannot get hugepage information\n");
+               return -1;
 
        if (internal_config.memory == 0 && internal_config.force_sockets 
== 0) {
                if (internal_config.no_hugetlbfs)
@@ -756,41 +741,43 @@ rte_eal_init(int argc, char **argv)
        rte_config_init();
 
        if (rte_eal_pci_init() < 0)
-               rte_panic("Cannot init PCI\n");
+               return -1;
 
 #ifdef RTE_LIBRTE_IVSHMEM
        if (rte_eal_ivshmem_init() < 0)
-               rte_panic("Cannot init IVSHMEM\n");
+               return -1;
 #endif
 
        if (rte_eal_memory_init() < 0)
-               rte_panic("Cannot init memory\n");
+               return -1;
 
        /* the directories are locked during eal_hugepage_info_init */
        eal_hugedirs_unlock();
 
        if (rte_eal_memzone_init() < 0)
-               rte_panic("Cannot init memzone\n");
+               return -1;
 
        if (rte_eal_tailqs_init() < 0)
-               rte_panic("Cannot init tail queues for objects\n");
+               return -1;
 
 #ifdef RTE_LIBRTE_IVSHMEM
        if (rte_eal_ivshmem_obj_init() < 0)
-               rte_panic("Cannot init IVSHMEM objects\n");
+               return -1;
 #endif
 
        if (rte_eal_log_init(logid, internal_config.syslog_facility) < 0)
-               rte_panic("Cannot init logs\n");
+               return -1;
 
        if (rte_eal_alarm_init() < 0)
-               rte_panic("Cannot init interrupt-handling thread\n");
+               return -1;
 
+       /* interrupt handling will be initialized but the thread is 
patched to immediately exit */
        if (rte_eal_intr_init() < 0)
-               rte_panic("Cannot init interrupt-handling thread\n");
+               return -1;
 
+       /* timer stuff is initialized but hpet should be disabled in 
configuration */
        if (rte_eal_timer_init() < 0)
-               rte_panic("Cannot init HPET or TSC timers\n");
+               return -1;
 
        eal_check_mem_on_local_socket();
 
@@ -803,47 +790,12 @@ rte_eal_init(int argc, char **argv)
                        RTE_LOG(WARNING, EAL, "%s\n", dlerror());
        }
 
-       eal_thread_init_master(rte_config.master_lcore);
-
-       ret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN);
-
-       RTE_LOG(DEBUG, EAL, "Master lcore %u is ready 
(tid=%x;cpuset=[%s%s])\n",
-               rte_config.master_lcore, (int)thread_id, cpuset,
-               ret == 0 ? "" : "...");
-
        if (rte_eal_dev_init() < 0)
-               rte_panic("Cannot init pmd devices\n");
-
-       RTE_LCORE_FOREACH_SLAVE(i) {
-
-               /*
-                * create communication pipes between master thread
-                * and children
-                */
-               if (pipe(lcore_config[i].pipe_master2slave) < 0)
-                       rte_panic("Cannot create pipe\n");
-               if (pipe(lcore_config[i].pipe_slave2master) < 0)
-                       rte_panic("Cannot create pipe\n");
-
-               lcore_config[i].state = WAIT;
-
-               /* create a thread for each lcore */
-               ret = pthread_create(&lcore_config[i].thread_id, NULL,
-                                    eal_thread_loop, NULL);
-               if (ret != 0)
-                       rte_panic("Cannot create thread\n");
-       }
-
-       /*
-        * Launch a dummy function on all slave lcores, so that master 
lcore
-        * knows they are all ready when this function returns.
-        */
-       rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
-       rte_eal_mp_wait_lcore();
+               return -1;
 
        /* Probe & Initialize PCI devices */
        if (rte_eal_pci_probe())
-               rte_panic("Cannot probe PCI\n");
+               return -1;
 
        return fctret;
 }
diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c 
b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index 66deda2..886e5e0 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -774,6 +774,9 @@ eal_intr_thread_main(__rte_unused void *arg)
 {
        struct epoll_event ev;
 
+       /* we do not need the interrupt handling and do not want the extra 
thread */
+       pthread_exit((void*)0);
+
        /* host thread, never break out */
        for (;;) {
                /* build up the epoll fd with all descriptors we are to
diff --git a/lib/librte_eal/linuxapp/eal/eal_log.c 
b/lib/librte_eal/linuxapp/eal/eal_log.c
index 0b133c3..7c4d569 100644
--- a/lib/librte_eal/linuxapp/eal/eal_log.c
+++ b/lib/librte_eal/linuxapp/eal/eal_log.c
@@ -91,7 +91,7 @@ static cookie_io_functions_t console_log_func = {
  * once memzones are available.
  */
 int
-rte_eal_log_init(const char *id, int facility)
+rte_eal_log_init(__attribute__((unused)) const char *id, 
__attribute__((unused)) int facility)
 {
        FILE *log_stream;
 
@@ -99,8 +99,6 @@ rte_eal_log_init(const char *id, int facility)
        if (log_stream == NULL)
                return -1;
 
-       openlog(id, LOG_NDELAY | LOG_PID, facility);
-
        if (rte_eal_common_log_init(log_stream) < 0)
                return -1;
 
-- 

Steffen Bauch
Senior Software Engineer Platform & Technology

R&S Cybersecurity ipoque GmbH
Augustusplatz 9, D-04109 Leipzig
Phone: + 49 341 59403 0
Email: steffen.bauch@rohde-schwarz.com
Internet: www.ipoque.com

Trade register Amtsgericht Leipzig HRB21462
Gesellschaft mit beschränkter Haftung (GmbH)
Dirk Czepluch - Managing Director

             reply	other threads:[~2016-08-01  9:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01  9:22 Steffen.Bauch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-08-01  9:21 Steffen.Bauch
2016-08-01  8:18 Steffen.Bauch
2016-08-01 10:04 ` Thomas Monjalon
2016-08-01 15:27   ` Wiles, Keith

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=OFEE6BE32D.2E238373-ONC1258002.0033706F-C1258002.00338528@rohde-schwarz.com \
    --to=steffen.bauch@rohde-schwarz.com \
    --cc=dev@dpdk.org \
    /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).