From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas@monjalon.net>
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 33EBE2C60;
 Wed, 25 Jul 2018 16:42:53 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id E835921AF1;
 Wed, 25 Jul 2018 10:42:49 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute1.internal (MEProxy); Wed, 25 Jul 2018 10:42:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:content-transfer-encoding:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc; s=mesmtp; bh=vhn5ml4Q6wT5C0t8LidRIKujMM
 zB+gjG6tc7X0rHPKM=; b=ZZFIi0xdXP3gyPdpVADhC2f32fH0uYbn7mVThY6y+N
 4a4H538prD5VFX64rdSDO0hOu1eBZnjS52zua7JSDKVEq2DzFYyX+OBPWKqfrqid
 iBXYhkyHD0/6/FRdtuFqfpkJZ97uthQ6eONNRWI8FvNpa9x6CVpnMAyojU9hxK1b
 w=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=vhn5ml
 4Q6wT5C0t8LidRIKujMMzB+gjG6tc7X0rHPKM=; b=KwbbRasnuZjVDM7G20jCEK
 IwLMCMePN7nBzGPZSkfxpsC2ivDDwZowGIMnfvYIMusEYgLDxLiUis3PGuUiaVQ8
 RSJ0CNydUOUVrRgTn3wrr7DvWtQZ5jAvQlKXcnVxZsIihrbfC5LjHwV2NYibwhAY
 bWpCBLFGauA+5qJfZkF7ifHFlzvo2wb4WFIYg3PokI7N1O8Jjk9xclIXZNKeVLuS
 Ve7xyVD0kdhMTLl/AkBYkFriN5rXRNctNJbZ7mw03Xum4neaqFZkYcqCYz0/G//v
 o+Q1gzl+5cRLKwRDtUuP7b6UGC4cdQ9rVOvoHCWq26f1gPJ0Y2GHVoiInaMHDNCQ
 ==
X-ME-Proxy: <xmx:aIxYW3DNnIczGbMyu-GpyOVTnY5H17Thq1qS1jMS5akdsVF4EhdoSA>
 <xmx:aIxYW3VgAZXiZkROG8RQtfKPFyMeqEC6YqMAJPrImX5Dg-mKcnw5Cw>
 <xmx:aIxYWxYbxBXNaWc7RZ8Dkb4u166nOpdGZDP70Uk6vJofJrP68BMElQ>
 <xmx:aIxYW1J2gh_E4aVxuWTQnTmBmWo99WjjME2ALDOo1cfYPbiYKp-kvA>
 <xmx:aIxYWzjXk5ibfSYDZuyrvVdLgEbMbzqeOCQSyb-raBzt-X7NoTg0og>
 <xmx:aYxYW66oGor8f8SSKRm-JZ5IYZpGT1tpaIkCrCyLUfe3r4VgniTluQ>
X-ME-Sender: <xms:aIxYW6lh4WDV70aIKlOWH1vVs1JVmAbl7tX_9gStWAvVxpvQv7BZiA>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id BB36110273;
 Wed, 25 Jul 2018 10:42:47 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Moti Haimovsky <motih@mellanox.com>
Cc: dev@dpdk.org, stable@dpdk.org, jasvinder.singh@intel.com,
 cristian.dumitrescu@intel.com, konstantin.ananyev@intel.com
Date: Wed, 25 Jul 2018 16:42:42 +0200
Message-ID: <5594003.g5WaFQLr3r@xps>
In-Reply-To: <1532529621-5171-1-git-send-email-motih@mellanox.com>
References: <1532529621-5171-1-git-send-email-motih@mellanox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-stable] [PATCH v2] app/testpmd: removed softnic CLI
	modifications
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Jul 2018 14:42:53 -0000

+Cc

25/07/2018 16:40, Moti Haimovsky:
> This patch reverts the testpmd CLI prompt routine modifications done
> in order to support softnic.
> The reason of doing so is due to testpmd abnormal exit observed on
> several setups caused by the softnic modifications to this routine,
> for example: When running testpmd with tap interface
> (/app/testpmd
>  -n 4 --vdev=net_tap0,iface=tap0,remote=eth1 -- --burst=64
>  --mbcache=512 -i --nb-cores=7 --rxq=2 --txq=2 --txd=512
>  --rxd=512 --port-topology=chained --forward-mode=rxonly)
> testpmd crashes seconds after presenting its prompt with the following
> error:
>   testpmd> PANIC in prompt():
>   CLI poll error (-1)
> 
>   Thread 1 "testpmd" received signal SIGABRT, Aborted.
>   0x00007ffff668e0d0 in raise () from /lib64/libc.so.6
>   (gdb) bt
>   #0  0x00007ffff668e0d0 in raise () from /lib64/libc.so.6
>   #1  0x00007ffff668f6b1 in abort () from /lib64/libc.so.6
>   #2  0x0000000000468027 in __rte_panic ()
>   #3  0x00000000004876ed in prompt ()
>   #4  0x000000000046dffc in main ()
> 
> When running testpmd with bare-metal device
> (app/testpmd -n 4 --socket-mem=1024,1024 -w 04:00.0  --
>  --burst=64 --mbcache=512 -i  --nb-cores=7
>  --rxq=64  --txq=4 --txd=16 --rxd=16)
> and pressing CTRL+D right after testpmd prompt is presented then
> the program crashes while presenting the same messages as above.
> 
> Needless to say that this behavior is not observed when using the
> previous CLI prompt routine.
> 
> Fixes: 0ad778b398c6 ("app/testpmd: rework softnic forward mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> ---
> v2:
> * Removed softnic modifications altogether.
> v1:
> * Wrapped softnic modifications with compilation switch.
> ---
>  app/test-pmd/cmdline.c | 39 ++-------------------------------------
>  1 file changed, 2 insertions(+), 37 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 2c32029..d058860 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -17896,50 +17896,15 @@ struct cmd_config_per_queue_tx_offload_result {
>  void
>  prompt(void)
>  {
> -	int status;
> -
>  	/* initialize non-constant commands */
>  	cmd_set_fwd_mode_init();
>  	cmd_set_fwd_retry_mode_init();
>  
> -#if defined RTE_LIBRTE_PMD_SOFTNIC
> -	portid_t softnic_portid, pid;
> -	uint8_t softnic_enable = 0;
> -
> -	if (strcmp(cur_fwd_eng->fwd_mode_name, "softnic") == 0) {
> -		RTE_ETH_FOREACH_DEV(pid) {
> -			struct rte_port *port = &ports[pid];
> -			const char *driver = port->dev_info.driver_name;
> -
> -			if (strcmp(driver, "net_softnic") == 0) {
> -				softnic_portid = pid;
> -				softnic_enable = 1;
> -				break;
> -			}
> -		}
> -	}
> -#endif
> -
>  	testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
>  	if (testpmd_cl == NULL)
>  		return;
> -
> -	for (;;) {
> -		status = cmdline_poll(testpmd_cl);
> -		if (status < 0)
> -			rte_panic("CLI poll error (%" PRId32 ")\n", status);
> -		else if (status == RDLINE_EXITED) {
> -			cmdline_stdin_exit(testpmd_cl);
> -			rte_exit(0, "\n");
> -		}
> -
> -#if defined RTE_LIBRTE_PMD_SOFTNIC
> -
> -	if ((softnic_enable == 1) &&
> -		(strcmp(cur_fwd_eng->fwd_mode_name, "softnic") == 0))
> -		rte_pmd_softnic_manage(softnic_portid);
> -#endif
> -	}
> +	cmdline_interact(testpmd_cl);
> +	cmdline_stdin_exit(testpmd_cl);
>  }
>  
>  void
>