From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id E5181235 for ; Tue, 24 Jul 2018 11:25:17 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 02:25:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,397,1526367600"; d="scan'208";a="58993699" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga007.jf.intel.com with ESMTP; 24 Jul 2018 02:25:16 -0700 Received: from irsmsx107.ger.corp.intel.com ([169.254.10.193]) by irsmsx105.ger.corp.intel.com ([169.254.7.195]) with mapi id 14.03.0319.002; Tue, 24 Jul 2018 10:25:15 +0100 From: "Iremonger, Bernard" To: "Singh, Jasvinder" , "dev@dpdk.org" CC: "Pattan, Reshma" Thread-Topic: [PATCH] app/testpmd: fix testpmd exit using ctrl+d Thread-Index: AQHUInI33Sz2THmWPE+WbTizGY8086SeGxbw Date: Tue, 24 Jul 2018 09:25:14 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260CCEC9D@IRSMSX107.ger.corp.intel.com> References: <20180723104425.10090-1-jasvinder.singh@intel.com> In-Reply-To: <20180723104425.10090-1-jasvinder.singh@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzVmZGNlMGQtNDk4Mi00NGFmLWFmODctZjg3YTJkMmJlNDY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiejJKYituTWpPUUNqZXlPXC91bHkrTVlYNFl0UmdDaVhBdHhXMHRlZWhlRWJBY0pZNExZc3NXR3d3NHJRaStwZlcifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix testpmd exit using ctrl+d X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 09:25:19 -0000 Hi Jasvider, > -----Original Message----- > From: Singh, Jasvinder > Sent: Monday, July 23, 2018 11:44 AM > To: dev@dpdk.org > Cc: Iremonger, Bernard ; Pattan, Reshma > > Subject: [PATCH] app/testpmd: fix testpmd exit using ctrl+d >=20 > Fix testpmd app exit by pressing ctrl+d, End-of-Transmission character (E= OT) > on the empty command line. >=20 > Fixes: 0ad778b398c6 ("app/testpmd: rework softnic forward mode") >=20 > Reported-by: Mordechay Haimovsky > Signed-off-by: Jasvinder Singh > --- > app/test-pmd/cmdline.c | 10 ++++++---- > lib/librte_cmdline/cmdline.c | 2 +- > 2 files changed, 7 insertions(+), 5 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 5885289..edaf0e6 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -17581,12 +17581,14 @@ prompt(void) >=20 > for (;;) { > status =3D cmdline_poll(testpmd_cl); > - if (status < 0) > - rte_panic("CLI poll error (%" PRId32 ")\n", status); > - else if (status =3D=3D RDLINE_EXITED) { > + if (status =3D=3D RDLINE_EXITED || status =3D=3D RDLINE_RES_EOF) { > + if (status =3D=3D RDLINE_RES_EOF) > + pmd_test_exit(); > + > cmdline_stdin_exit(testpmd_cl); > rte_exit(0, "\n"); > - } > + } else if (status < 0) > + rte_panic("CLI poll error (%" PRId32 ")\n", status); >=20 > #if defined RTE_LIBRTE_PMD_SOFTNIC >=20 > diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c = index > 591b78b..47b0f6a 100644 > --- a/lib/librte_cmdline/cmdline.c > +++ b/lib/librte_cmdline/cmdline.c > @@ -187,7 +187,7 @@ cmdline_in(struct cmdline *cl, const char *buf, int > size) > rdline_newline(&cl->rdl, cl->prompt); > } > else if (ret =3D=3D RDLINE_RES_EOF) > - return -1; > + return RDLINE_RES_EOF; > else if (ret =3D=3D RDLINE_RES_EXITED) > return -1; > } > -- > 2.9.3 The check-git-log script is showing the following error: ./devtools/check-git-log.sh -1 Line too long: Fix testpmd app exit by pressing ctrl+d, End-of-Transmission charac= ter (EOT) Regards, Bernard.