From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 546CE8E80 for ; Thu, 31 Dec 2015 03:21:00 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 30 Dec 2015 18:20:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,503,1444719600"; d="scan'208";a="872152054" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 30 Dec 2015 18:20:58 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 30 Dec 2015 18:20:56 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 30 Dec 2015 18:20:56 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.57]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.58]) with mapi id 14.03.0248.002; Thu, 31 Dec 2015 10:20:22 +0800 From: "Wang, Zhihong" To: Stephen Hemminger Thread-Topic: [PATCH v4 3/3] examples/l3fwd: Handle SIGINT and SIGTERM in l3fwd Thread-Index: AQHRQsuy2TDIgAnKN0u50QqUV1TYK57jAuMAgAFN3pD//4QFgIAAhjwA Date: Thu, 31 Dec 2015 02:20:22 +0000 Message-ID: <8F6C2BD409508844A0EFC19955BE09418647A6@SHSMSX103.ccr.corp.intel.com> References: <1451011032-83106-1-git-send-email-zhihong.wang@intel.com> <1451431644-98362-1-git-send-email-zhihong.wang@intel.com> <1451431644-98362-4-git-send-email-zhihong.wang@intel.com> <2601191342CEEE43887BDE71AB97725836ADF284@irsmsx105.ger.corp.intel.com> <8F6C2BD409508844A0EFC19955BE094186474F@SHSMSX103.ccr.corp.intel.com> <20151230180911.2a14218b@xeon-e3> In-Reply-To: <20151230180911.2a14218b@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2M4ZjEzMDgtNWRjZS00NDE0LWEzYTItYjc1Y2I5Y2Q5Mjk4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSVh2dG95SnhSTHJXekdPbHp6VTlWK3VGS1pUWFdZNTRBZ0JCWXljVlErRT0ifQ== x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v4 3/3] examples/l3fwd: Handle SIGINT and SIGTERM in l3fwd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2015 02:21:01 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, December 31, 2015 10:09 AM > To: Wang, Zhihong > Cc: Ananyev, Konstantin ; dev@dpdk.org; Qiu= , > Michael > Subject: Re: [PATCH v4 3/3] examples/l3fwd: Handle SIGINT and SIGTERM in > l3fwd >=20 > On Thu, 31 Dec 2015 01:44:20 +0000 > "Wang, Zhihong" wrote: >=20 > > > > +#define PORT_IDLE 0 > > > > +#define PORT_INIT 1 > > > > +#define PORT_WORK 2 > > > > +#define PORT_STOP 3 > > > > +#define PORT_QUIT 4 > > > > > > Seems ok, but over-complicated. > > > I think all you need is just IDLE, INIT, QUIT. > > > > Yes for l2/l3fwd 3 states are enough. > > I implement a full state machine so it can also serve as an example on = how to > do this in other cases, like where stop might be called before or during = init. >=20 > These are examples, it is better to have as little code as necessary to g= et the job > done. That makes the example clearer. Adding extra unnecessary complexit= y > just makes it harder to understand. Thanks for the suggestions! I'll send the v5 combining your comments and Konstantin's together to make = it simpler.