From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8BDC02904 for ; Thu, 29 Jun 2017 09:01:01 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2017 00:01:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,279,1496127600"; d="scan'208";a="1188382181" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by fmsmga002.fm.intel.com with ESMTP; 29 Jun 2017 00:00:56 -0700 Received: from kmsmsx153.gar.corp.intel.com ([169.254.5.24]) by KMSMSX151.gar.corp.intel.com ([169.254.10.60]) with mapi id 14.03.0319.002; Thu, 29 Jun 2017 15:00:55 +0800 From: "Dai, Wei" To: "Wu, Jingjing" , "thomas@monjalon.net" , "Lu, Wenzhuo" , "Ananyev, Konstantin" , "Zhang, Helin" CC: "dev@dpdk.org" Thread-Topic: [PATCH v2 4/5] app/testpmd: add command to test NIC reset Thread-Index: AQHS71ArogSEAVD1zEGvjWE+IQL9VaI5eCIAgAH0FVA= Date: Thu, 29 Jun 2017 07:00:55 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D650B4A83F@KMSMSX153.gar.corp.intel.com> References: <1495873329-43303-1-git-send-email-wei.dai@intel.com> <1498572438-25125-1-git-send-email-wei.dai@intel.com> <1498572438-25125-5-git-send-email-wei.dai@intel.com> <9BB6961774997848B5B42BEC655768F810DB3522@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810DB3522@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTQ0ZDdlMzYtNTVhZS00YzkzLWJjYTgtMjA4MTE2NjU2ZGZiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik92dFY2ZlZVQ3ZsSGdHMm41ZGk3eE8zaEZmMUw4bSs5WmlzcTVGc0V3Smc9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 4/5] app/testpmd: add command to test NIC reset 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: Thu, 29 Jun 2017 07:01:02 -0000 > -----Original Message----- > From: Wu, Jingjing > Sent: Wednesday, June 28, 2017 5:11 PM > To: Dai, Wei ; thomas@monjalon.net; Lu, Wenzhuo > ; Ananyev, Konstantin > ; Zhang, Helin > Cc: dev@dpdk.org > Subject: RE: [PATCH v2 4/5] app/testpmd: add command to test NIC reset >=20 >=20 >=20 > > -----Original Message----- > > From: Dai, Wei > > Sent: Tuesday, June 27, 2017 10:07 PM > > To: thomas@monjalon.net; Lu, Wenzhuo ; Ananyev, > > Konstantin ; Zhang, Helin > > ; Wu, Jingjing > > Cc: dev@dpdk.org; Dai, Wei > > Subject: [PATCH v2 4/5] app/testpmd: add command to test NIC reset > > > > When a NIC is reset, a message will show it. > > And then user can run the command "reset_port port_id" > > to process it. > > > > Signed-off-by: Wei Dai > > --- > > app/test-pmd/cmdline.c | 31 +++++++++++++++++++++++++++++++ > > app/test- pmd/config.c | 13 +++++++++++++ app/test-pmd/testpmd.h | > > 1 + > > 3 files changed, 45 insertions(+) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > ff8ffd2..90f6bde 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -2588,6 +2588,36 @@ cmdline_parse_inst_t cmd_stop =3D { > > }, > > }; > > > > +/* *** reset a port *** */ > > +struct cmd_reset_port_result { > > + cmdline_fixed_string_t command; > > + uint8_t port_id; > > +}; > > + > > +static void cmd_reset_port_parsed(__attribute__((unused)) void > > *parsed_result, > > + __attribute__((unused)) struct cmdline *cl, > > + __attribute__((unused)) void *data) { > > + struct cmd_reset_port_result *res =3D parsed_result; > > + reset_port(res->port_id); > > +} > > + > > +cmdline_parse_token_string_t cmd_reset_port_cmd =3D > > + TOKEN_STRING_INITIALIZER(struct cmd_reset_port_result, command, > > +"reset_port"); cmdline_parse_token_num_t cmd_reset_port_id =3D > > + TOKEN_NUM_INITIALIZER(struct cmd_reset_port_result, port_id, > > UINT8); > > + > > +cmdline_parse_inst_t cmd_reset_port =3D { > > + .f =3D cmd_reset_port_parsed, > > + .data =3D NULL, > > + .help_str =3D "reset_port ", >=20 > You can just add one more option in the commands "port start|stop|close > " and " port start|stop|close all" > To "port start|stop|close|reset " and " port start|stop|close|re= set > all" instead of defining a new one. Thanks for your feedback. V3 patch set will follow your guide.