Re: [dpdk-dev] [PATCH v2] app/testpmd: avoid exit without terminal restore

2021-01-26 Thread Li, Xiaoyun
Acked-by: Xiaoyun Li > -Original Message- > From: Yu, DapengX > Sent: Tuesday, January 26, 2021 15:44 > To: Li, Xiaoyun ; Xing, Beilei ; > Lu, > Wenzhuo ; Iremonger, Bernard > ; step...@networkplumber.org > Cc: dev@dpdk.org; sta...@dpdk.org > Subject: RE: [PATCH v2] app/testpmd: avoid e

Re: [dpdk-dev] [PATCH v2] app/testpmd: avoid exit without terminal restore

2021-01-25 Thread Yu, DapengX
@Xiaoyun, Add one more explanation. even if registers prompt_exit failed, when users type "quit" and then break from cmdline_interact(), the ret check will not prevent cmdline_stdin_exit() to be called to restore terminal settings in this patch. @Beilei Can you give comment on this patch v2, so

Re: [dpdk-dev] [PATCH v2] app/testpmd: avoid exit without terminal restore

2021-01-25 Thread Yu, DapengX
Hi Xiaoyun, For this situation: registering prompt_exit succeed, and user type "quit" command to exit testpmd. If the second call to cmdline_stdin_exit is not excluded from the code conditionally, the cmdline_stdin_exit will be called twice; 1. the first time: in prompt() #0 cmdline_stdi

Re: [dpdk-dev] [PATCH v2] app/testpmd: avoid exit without terminal restore

2021-01-25 Thread Li, Xiaoyun
Hi > -Original Message- > From: dapengx...@intel.com > Sent: Monday, January 25, 2021 11:30 > To: Xing, Beilei ; Li, Xiaoyun ; > Lu, > Wenzhuo ; Iremonger, Bernard > ; step...@networkplumber.org > Cc: dev@dpdk.org; Yu, DapengX ; sta...@dpdk.org > Subject: [PATCH v2] app/testpmd: avoid ex

[dpdk-dev] [PATCH v2] app/testpmd: avoid exit without terminal restore

2021-01-24 Thread dapengx . yu
From: Dapeng Yu In interactive mode, if testpmd exit by calling rte_exit without restore terminal attributes, terminal will not echo keyboard input. register a function with atexit() in prompt(), when exit() in rte_exit() is called, the registered function restores terminal attributes. Fixes: 5