From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3 3/3] examples/l3fwd: Handle SIGINT and SIGTERM in l3fwd Date: Wed, 30 Dec 2015 09:37:58 -0800 Message-ID: <20151230093758.1b700c1a@xeon-e3> References: <1451011032-83106-1-git-send-email-zhihong.wang@intel.com> <1451352032-105576-1-git-send-email-zhihong.wang@intel.com> <1451352032-105576-4-git-send-email-zhihong.wang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Zhihong Wang Return-path: Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by dpdk.org (Postfix) with ESMTP id 6637169C8 for ; Wed, 30 Dec 2015 18:37:49 +0100 (CET) Received: by mail-pf0-f179.google.com with SMTP id 78so144622763pfw.2 for ; Wed, 30 Dec 2015 09:37:49 -0800 (PST) In-Reply-To: <1451352032-105576-4-git-send-email-zhihong.wang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 28 Dec 2015 20:20:32 -0500 Zhihong Wang wrote: > Handle SIGINT and SIGTERM in l3fwd. > > Signed-off-by: Zhihong Wang > Acked-by: Michael Qiu > --- > examples/l3fwd/main.c | 129 +++++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 107 insertions(+), 22 deletions(-) > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c > index 5b0c2dd..c766cf5 100644 > --- a/examples/l3fwd/main.c > +++ b/examples/l3fwd/main.c > @@ -41,6 +41,9 @@ > #include > #include > #include > +#include > +#include > +#include > > #include > #include > @@ -75,6 +78,10 @@ > #include > #include > > +static volatile bool port_started; > +static volatile bool force_quit; > +static volatile int signo_quit; I don't think you need the port_started or signo_quit logic. The port_started logic is racy, and if you write the loops correctly, is unnecessary. The signo_quit logic is unnecessary, since exit code of interrupted program doesn't matter.