[spp] [PATCH v3] spp_vf: fix initializing bug of forwarder

Yasufumi Ogawa ogawa.yasufumi at lab.ntt.co.jp
Thu Aug 9 06:25:40 CEST 2018


> From: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>
> 
> 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 following refactoring
> - using local vars to be simple
> - replace clear_forward_info() by memset
Thanks!

Acked-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
> 
> Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>
> Signed-off-by: Naoki Takada <takada.naoki at lab.ntt.co.jp>
> ---
>   src/vf/spp_forward.c | 9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/src/vf/spp_forward.c b/src/vf/spp_forward.c
> index 0a43608..03bda10 100644
> --- a/src/vf/spp_forward.c
> +++ b/src/vf/spp_forward.c
> @@ -49,13 +49,6 @@ spp_forward_init(void)
>   	}
>   }
>   
> -/* Clear info for one element. */
> -static void
> -clear_forward_info(int id)
> -{
> -	memset(&g_forward_info[id].path, 0x00, sizeof(struct forward_path));
> -}
> -
>   /* Update forward info */
>   int
>   spp_forward_update(struct spp_component_info *component)
> @@ -84,7 +77,7 @@ spp_forward_update(struct spp_component_info *component)
>   		return -1;
>   	}
>   
> -	clear_forward_info(component->component_id);
> +	memset(path, 0x00, sizeof(struct forward_path));
>   
>   	RTE_LOG(INFO, FORWARD,
>   			"Component[%d] Start update component. (name = %s, type = %d)\n",
> 




More information about the spp mailing list