From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 7F759DE0 for ; Mon, 1 Aug 2016 12:04:59 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id i5so236338108wmg.0 for ; Mon, 01 Aug 2016 03:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=w+F4aovZvueG3lGmCyxRK9BFVeSfgIesvvmQhjFE7gg=; b=Kj0HaL48K7xu+NkbhO89JVncHCLylMU4wBJJG4TCNlCm/3d4YtO35LXsWOjNleE75W czabrA6YCR9m/D7GhcDi/sgbc1rd2+vkoOPyBgEJM1DkpvhA7E4d/Pbi3/AgMxHVcT6B V4U3beuhqcu/GkPEe2chub5ZvhqqioK/NrG2TlMDrb0CUngQebKQLV4q+g1XCFl3uTgn jRLVDJNtFNFLwLJhPe1hDQHth55UKTfyKsWJ0/hBf7uxYf7KtcgZrhOlMVmjg4GasVY+ desORDWZch+Kb1Hnt/fQrDzmsXlwD4xzaisrFXZuiPfRwdn1H2GCO2bIs4xsagFxO/Ij Uafg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=w+F4aovZvueG3lGmCyxRK9BFVeSfgIesvvmQhjFE7gg=; b=Lov/A9DWUt4lZvVb9X1kCr+OSbCtau2ksFP3nJ7wHKUvkfvwkOjERxIQTkxUb7BqGW fCFOHF2haetpdBk63aEWFh69pe0d+F1hqpaaep2py8icwXJLSfl1xxIAuKHNbOgMz+ha 9EMKxXRNgHQvAbSYCys8X/yaC2A2q0Peph1NjMLfVyEkhgOtKadjPZC6iYELT2NXsAo4 wr3ir9vnIHJ2lwMHTHCusvsVvZt+UVXVl5cPnQs6+Kk6bPitTd4TGs60+woK3CSDl/7V dpw2XQOMqINT+xyhWFUiuS+bpjNcg+Yv/2kBTLg7tTkvQFjl5JM9oQWbdeNyv1cD5R0A Fiig== X-Gm-Message-State: AEkoouvbfy1X46KdKkvOcqhLpTRXxgoGiY8nePpZMlA4VYR1QhSG8vcZTdkrMuwhmwQjbivk X-Received: by 10.28.51.21 with SMTP id z21mr57440423wmz.24.1470045899178; Mon, 01 Aug 2016 03:04:59 -0700 (PDT) Received: from xps13.localnet (182.17.90.92.rev.sfr.net. [92.90.17.182]) by smtp.gmail.com with ESMTPSA id vr5sm29730021wjc.29.2016.08.01.03.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Aug 2016 03:04:58 -0700 (PDT) From: Thomas Monjalon To: Steffen.Bauch@rohde-schwarz.com Cc: dev@dpdk.org Date: Mon, 01 Aug 2016 12:04:56 +0200 Message-ID: <5220604.46iZ36VITK@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 10:04:59 -0000 Hi, Thanks for explaining your context. Your concerns are known under the term "usability enhancements". As they require some API changes, we won't make them in the release 16.11. But we must work on it now to be able to announce the API changes for 17.02 before the 16.11 release. 2016-08-01 10:18, Steffen.Bauch@rohde-schwarz.com: > Concerning the integration we try to cope with the circumstance that > DPDK is more comparable to an application framework and less to a > library. I think DPDK should be easier to use and considered as a normal library. [...] > Logging behavior > > Opening a connection to the system logger for our program is within the > responsibility of our specific logging module that is also used in the > proprietary parts of the application. For this reason openlog() should > not be called in our use case. In addition, using rte_openlog_stream() > is not usable before rte_eal_init() as logging init will overwrite the > used log stream. For this reason a large part of the init logs can not > be handled by a custom log stream. Btw, after removal of the log caching, > is there a fundamental difference between early log and normal logging? You're right. Now that the log history is removed, we can rework the log initialization and reconsider early logging. > A possible approach for the future could be to initialize rte_logs.file > to NULL (in fact it is, as it is static) and only set it during > initialization if it is NULL with the goal to be able to use > rte_openlog_stream() before rte_eal_init(). As the openlog() call is > only relevant when the default log stream is used (and architecture > dependent!) I introduced a specific entry point for calling openlog. The > main complexity to this changeset is added due to two reasons. First > reason is the circumstance that rte_eal_common_log_init() is used several > times during early logging and real logging initialization. Second > aspect is that a user might revert to the use of the default_log_stream > after a custom log stream has be used straight from the beginning (even > before rte_eal_init()). A dedicated changeset towards v16.07 for this > improvement is attached for review, feedback and possible inclusion. Before entering in the proposed design for a custom log handler, we should discuss the desired features in DPDK logging. Is there some developer who would like to see the logs improved to be dynamically tuned in run-time live? Or should we just allow a custom log handler and provide only a default minimal handler? > Process termination behavior > > As the DPDK functionality is only a small part of the whole application > ownership of the running process is not with DPDK and it is not allowed > to cancel the running process as a result of an error. For this reason, > the current changeset instead of calling rte_panic or rte_exit returns > an error code and handles it in the calling function. Unfortunately this > change was only implemented in rte_eal_init() and not in other places > (drivers, libs ...), so there is currently no safety that an unknown > code part terminates the whole application on the spot. Future changes > and patches could change the error handling in a more thorough approach, > but I would like to have some feedback and opinions before I start the > heavy-lifting work in over 700 code locations. Even some interfaces > might be affected, as lots of functions return void now, Yes, please let's remove every panic/exit calls from DPDK. The only reason it is still there is that nobody took the time to remove these traces from the early support of bare metal environment (now dropped). > Thread creation > > In our application thread creation and setting the affinity is already > handled in a proprietary module. Frames are polled and processed > in non-EAL pthreads. For this reason the lcore thread creation in > rte_eal_init() is completely removed as we do not want additional threads > to be assigned to processing CPUs. Unfortunately setting the coremask > to 0 is not feasible directly. For the non-EAL threads a custom function > within the application sets the per_thread _lcore variable to the right > value to try to enable mbuf cacheing. The changeset also disables the > interrupt handling thread as in our application it currently seems not > necessary (maybe make this optional?) > > In an experiment I removed the error check for the non-zero number of > lcores and quick-fixed certain locations where rte_lcore_count() is used > for memory size computations and at least got a running application. > > A possible approach could be to enhance enum rte_lcore_role_t with an > auxiliary thread type and introduce additional eal arguments to assign > lcores with these auxiliary role. My personal opinion is that DPDK (as a library) should not create some threads at all. The loops and workload strategy is the responsibility of the application.