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 A5ABA1B173 for ; Tue, 7 Aug 2018 08:33:06 +0200 (CEST) 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 w776X4nV025949; Tue, 7 Aug 2018 15:33:04 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id w776X42Z019828; Tue, 7 Aug 2018 15:33:04 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id RAA19827; Tue, 7 Aug 2018 15:33:04 +0900 Received: from imss05.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by ccmail04.silk.ntt-tx.co.jp (unknown) with ESMTP id w776X3nY011391; Tue, 7 Aug 2018 15:33:03 +0900 Received: from imss05.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss05.silk.ntt-tx.co.jp (unknown) with ESMTP id w776X3Aw013462; Tue, 7 Aug 2018 15:33:03 +0900 Received: from ccmail04 (smtp03.silk.ntt-tx.co.jp [10.107.0.135]) by imss05.silk.ntt-tx.co.jp (unknown) with SMTP id w776X3sZ013459; Tue, 7 Aug 2018 15:33:03 +0900 Date: Tue, 07 Aug 2018 15:31:10 +0900 From: Hideyuki Yamashita In-Reply-To: <37658b11-a1ca-e1c3-7aab-84b7731b4350@lab.ntt.co.jp> References: <201808020831.w728V9N5031675@imss03.silk.ntt-tx.co.jp> <37658b11-a1ca-e1c3-7aab-84b7731b4350@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.74 [ja] X-CCMail7: CC-Mail-V7.0.2-Client-Relayed Message-Id: <201808070632.w776WOIF010903@ccmail04.silk.ntt-tx.co.jp> X-TM-AS-MML: No X-CC-Mail-RelayStamp: CC-Mail-V5.14-Server To: Yasufumi Ogawa Cc: x-fn-spp@sl.ntt-tx.co.jp, ferruh.yigit@intel.com, spp@dpdk.org Subject: Re: [spp] [spp 03176] Re: [PATCH] spp_vf: fix initializing bug of forwarder 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, 07 Aug 2018 06:33:07 -0000 Hello Yasufumi-san, Thanks for your comments. About your first point, I agree that there is only one point which calls this function. But I still believe it is good to keep this as a function to keep readability of calling side function. So, I will change function name from clear_forward_info() to clear_forward_path(). What do you think? BR, Hideyuki Yamashita > On 2018/08/02 17:31, x-fn-spp@sl.ntt-tx.co.jp wrote: > > From: Hideyuki Yamashita > > > > clear_forward_info() always initializes path[0] of g_forward_info[id]. > > It is a bug and causes stopping forwarding accidentally if path[0] is > > referenced by spp_forward(). > > > > This patch changes initializing as path[info->upd_index] instead of 0. > > It also includes refactoring to be simple by using local vars. > Hideyuki, > > I do not know why claer_forward_info() is requierd because it is called only one time and simply just doing memset(). I think it is not needed to be a function without called from several points. In addition, the name of function is not so good. It does not clear 'forward_info' but 'forward_path'. I think clear_forward_path() is appropriate if you want to make it as a function. > > Thanks, > Yasufumi > > > > Signed-off-by: Hideyuki Yamashita > > Signed-off-by: Naoki Takada > > --- > > src/vf/spp_forward.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/src/vf/spp_forward.c b/src/vf/spp_forward.c > > index 0a43608..ee1254c 100644 > > --- a/src/vf/spp_forward.c > > +++ b/src/vf/spp_forward.c > > @@ -51,9 +51,9 @@ spp_forward_init(void) > > > /* Clear info for one element. */ > > static void > > -clear_forward_info(int id) > > +clear_forward_info(struct forward_path *path) > > { > > - memset(&g_forward_info[id].path, 0x00, sizeof(struct forward_path)); > > + memset(path, 0x00, sizeof(struct forward_path)); > > } > > > /* Update forward info */ > > @@ -84,7 +84,7 @@ spp_forward_update(struct spp_component_info *component) > > return -1; > > } > > > - clear_forward_info(component->component_id); > > + clear_forward_info(path); > > > RTE_LOG(INFO, FORWARD, > > "Component[%d] Start update component. (name = %s, type = %d)\n", > > >