From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.rohde-schwarz.com (mail02.rohde-schwarz.com [80.246.32.97]) by dpdk.org (Postfix) with ESMTP id A12D52C0C for ; Mon, 1 Aug 2016 11:22:47 +0200 (CEST) Received: from amu316.rsint.net ([10.0.26.65]) by mail02.rohde-schwarz.com with ESMTP id 2016080111224612-60542 ; Mon, 1 Aug 2016 11:22:46 +0200 Received: from rus19.rsint.net ([10.0.33.19]) by amu316.rsint.net (Totemo SMTP Server) with SMTP ID 378 for ; Mon, 1 Aug 2016 11:22:45 +0200 (CEST) To: dev@dpdk.org MIME-Version: 1.0 X-KeepSent: EE6BE32D:2E238373-C1258002:0033706F; type=4; flags=0; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1FP6 April 21, 2016 From: Steffen.Bauch@rohde-schwarz.com X-RUS_SENSITIVITY: 10 X-TNEFEvaluated: 1 Message-ID: Date: Mon, 1 Aug 2016 11:22:44 +0200 X-MIMETrack: Itemize by SMTP Server on RSSMTP02/RSSMTP at 01.08.2016 11:22:46, Serialize by Router on RSSMTP02/RSSMTP at 01.08.2016 11:22:46, Serialize complete at 01.08.2016 11:22:46 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" Subject: Re: [dpdk-dev] Application framework vs. library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 09:22:47 -0000 diff --git a/lib/librte_eal/linuxapp/eal/eal.c=20 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"); } =20 -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 =3D RTE_ATOMIC32_INIT(0); + int fctret; struct shared_driver *solib =3D NULL; const char *logid; - char cpuset[RTE_CPU_AFFINITY_STR_LEN]; - - if (!rte_atomic32_test_and_set(&run_once)) - return -1; =20 - logid =3D strrchr(argv[0], '/'); - logid =3D strdup(logid ? logid + 1: argv[0]); - - thread_id =3D pthread_self(); + logid =3D NULL; =20 if (rte_eal_log_early_init() < 0) - rte_panic("Cannot init early logs\n"); + return -1; =20 if (rte_eal_cpu_init() < 0) - rte_panic("Cannot detect lcores\n"); + return -1; =20 fctret =3D eal_parse_args(argc, argv); if (fctret < 0) @@ -731,7 +716,7 @@ rte_eal_init(int argc, char **argv) internal_config.process_type !=3D RTE_PROC_SECONDAR= Y=20 && internal_config.xen_dom0_support =3D=3D 0 && eal_hugepage_info_init() < 0) - rte_panic("Cannot get hugepage information\n"); + return -1; =20 if (internal_config.memory =3D=3D 0 && internal_config.force_socket= s=20 =3D=3D 0) { if (internal_config.no_hugetlbfs) @@ -756,41 +741,43 @@ rte_eal_init(int argc, char **argv) rte_config_init(); =20 if (rte_eal_pci_init() < 0) - rte_panic("Cannot init PCI\n"); + return -1; =20 #ifdef RTE_LIBRTE_IVSHMEM if (rte_eal_ivshmem_init() < 0) - rte_panic("Cannot init IVSHMEM\n"); + return -1; #endif =20 if (rte_eal_memory_init() < 0) - rte_panic("Cannot init memory\n"); + return -1; =20 /* the directories are locked during eal_hugepage_info_init */ eal_hugedirs_unlock(); =20 if (rte_eal_memzone_init() < 0) - rte_panic("Cannot init memzone\n"); + return -1; =20 if (rte_eal_tailqs_init() < 0) - rte_panic("Cannot init tail queues for objects\n"); + return -1; =20 #ifdef RTE_LIBRTE_IVSHMEM if (rte_eal_ivshmem_obj_init() < 0) - rte_panic("Cannot init IVSHMEM objects\n"); + return -1; #endif =20 if (rte_eal_log_init(logid, internal_config.syslog_facility) < 0) - rte_panic("Cannot init logs\n"); + return -1; =20 if (rte_eal_alarm_init() < 0) - rte_panic("Cannot init interrupt-handling thread\n"); + return -1; =20 + /* interrupt handling will be initialized but the thread is=20 patched to immediately exit */ if (rte_eal_intr_init() < 0) - rte_panic("Cannot init interrupt-handling thread\n"); + return -1; =20 + /* timer stuff is initialized but hpet should be disabled in=20 configuration */ if (rte_eal_timer_init() < 0) - rte_panic("Cannot init HPET or TSC timers\n"); + return -1; =20 eal_check_mem_on_local_socket(); =20 @@ -803,47 +790,12 @@ rte_eal_init(int argc, char **argv) RTE_LOG(WARNING, EAL, "%s\n", dlerror()); } =20 - eal_thread_init_master(rte_config.master_lcore); - - ret =3D eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN); - - RTE_LOG(DEBUG, EAL, "Master lcore %u is ready=20 (tid=3D%x;cpuset=3D[%s%s])\n", - rte_config.master_lcore, (int)thread_id, cpuset, - ret =3D=3D 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 =3D WAIT; - - /* create a thread for each lcore */ - ret =3D pthread_create(&lcore_config[i].thread_id, NULL, - eal_thread_loop, NULL); - if (ret !=3D 0) - rte_panic("Cannot create thread\n"); - } - - /* - * Launch a dummy function on all slave lcores, so that master=20 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; =20 /* Probe & Initialize PCI devices */ if (rte_eal_pci_probe()) - rte_panic("Cannot probe PCI\n"); + return -1; =20 return fctret; } diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c=20 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; =20 + /* we do not need the interrupt handling and do not want the extra= =20 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=20 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 =3D { * once memzones are available. */ int -rte_eal_log_init(const char *id, int facility) +rte_eal_log_init(__attribute__((unused)) const char *id,=20 __attribute__((unused)) int facility) { FILE *log_stream; =20 @@ -99,8 +99,6 @@ rte_eal_log_init(const char *id, int facility) if (log_stream =3D=3D NULL) return -1; =20 - openlog(id, LOG_NDELAY | LOG_PID, facility); - if (rte_eal_common_log_init(log_stream) < 0) return -1; =20 --=20 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=E4nkter Haftung (GmbH) Dirk Czepluch - Managing Director