From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 2DEDF1B1EB for ; Wed, 6 Feb 2019 04:49:00 +0100 (CET) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x163mx2Y002665; Wed, 6 Feb 2019 12:48:59 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 7C7A66398FB; Wed, 6 Feb 2019 12:48:59 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 711B26398F8; Wed, 6 Feb 2019 12:48:59 +0900 (JST) Received: from [IPv6:::1] (watercress.nslab.ecl.ntt.co.jp [129.60.13.73]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 6C742400359; Wed, 6 Feb 2019 12:48:59 +0900 (JST) References: <20190205114742.24502-1-x-fn-spp@sl.ntt-tx.co.jp> <201902051147.x15Blg5C014220@imss03.silk.ntt-tx.co.jp> From: Yasufumi Ogawa Message-ID: Date: Wed, 6 Feb 2019 12:46:41 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201902051147.x15Blg5C014220@imss03.silk.ntt-tx.co.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: x-fn-spp@sl.ntt-tx.co.jp Cc: ferruh.yigit@intel.com, spp@dpdk.org X-TM-AS-MML: disable Subject: Re: [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: Wed, 06 Feb 2019 03:49:01 -0000 On 2019/02/05 20:47, x-fn-spp@sl.ntt-tx.co.jp wrote: > 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. I am not sure why this change is required for core sharing. Could explain in shortly? I think it is explained in added code. > > 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) == It should have a comment for the condition of core sharing. > + 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; It should have here too. > + } 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. " >