From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.ics.ntt-tx.co.jp (mail05.ics.ntt-tx.co.jp [210.232.35.69]) by dpdk.org (Postfix) with ESMTP id 4D3DE69D4 for ; Tue, 5 Feb 2019 12:48:53 +0100 (CET) Received: from gwchk03.silk.ntt-tx.co.jp (gwchk03.silk.ntt-tx.co.jp [10.107.0.111]) by mail04.ics.ntt-tx.co.jp (unknown) with ESMTP id x15BmqUi015469; Tue, 5 Feb 2019 20:48:52 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id x15BmqJc031014; Tue, 5 Feb 2019 20:48:52 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id WAA30819; Tue, 5 Feb 2019 20:47:43 +0900 Received: from imss03.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id x15BlgHj014226; Tue, 5 Feb 2019 20:47:42 +0900 Received: from mgate02.silk.ntt-tx.co.jp (smtp02.silk.ntt-tx.co.jp [10.107.0.37]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id x15Blg5C014220; Tue, 5 Feb 2019 20:47:42 +0900 Message-Id: <201902051147.x15Blg5C014220@imss03.silk.ntt-tx.co.jp> Received: from localhost by mgate02.silk.ntt-tx.co.jp (unknown) id x15BlgJX025667 ; Tue, 5 Feb 2019 20:47:42 +0900 From: x-fn-spp@sl.ntt-tx.co.jp To: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Cc: spp@dpdk.org Date: Tue, 5 Feb 2019 20:47:38 +0900 X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190205114742.24502-1-x-fn-spp@sl.ntt-tx.co.jp> References: <20190205114742.24502-1-x-fn-spp@sl.ntt-tx.co.jp> X-TM-AS-MML: No Subject: [spp] [PATCH 1/5] spp_vf: remove while loop in classifier_mac X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2019 11:48:54 -0000 From: Hideyuki Yamashita So far, spp_classifier_mac_do() has while loop and it does not return until the classifier component is requested to stop and thus the worker thread can not execute packet processing for forwarder/merger. To introduce core-sharing, this patch removes the while loop. Signed-off-by: Hideyuki Yamashita Signed-off-by: Naoki Takada --- src/vf/spp_vf.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c index b98444d..bdc4c10 100644 --- a/src/vf/spp_vf.c +++ b/src/vf/spp_vf.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation + * Copyright(c) 2017-2019 Nippon Telegraph and Telephone Corporation */ #include @@ -209,21 +209,18 @@ slave_main(void *arg __attribute__ ((unused))) core = get_core_info(lcore_id); } + /* It is for processing multiple components. */ for (cnt = 0; cnt < core->num; cnt++) { - if (spp_get_component_type(lcore_id) == + if (spp_get_component_type(core->id[cnt]) == SPP_COMPONENT_CLASSIFIER_MAC) { - /* Classifier loops inside the function. */ ret = spp_classifier_mac_do(core->id[cnt]); - break; + if (unlikely(ret != 0)) + break; + } else { + ret = spp_forward(core->id[cnt]); + if (unlikely(ret != 0)) + break; } - - /* - * Forward / Merge returns at once. - * It is for processing multiple components. - */ - ret = spp_forward(core->id[cnt]); - if (unlikely(ret != 0)) - break; } if (unlikely(ret != 0)) { RTE_LOG(ERR, APP, "Core[%d] Component Error. " -- 2.17.1