From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by dpdk.org (Postfix) with ESMTP id C4F471B1AB for ; Mon, 19 Feb 2018 08:17:16 +0100 (CET) Received: by mail-lf0-f66.google.com with SMTP id h78so11676946lfg.6 for ; Sun, 18 Feb 2018 23:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=tc3xcv8+3SDxDIzzFnqi+wJJ6qYCJoTl2aiGT9V+2eo=; b=jxkfr/X6QW1hGhJjWs5SI7eXulwRpzDVCa7b6xHTjODG0ACL4KflTOjUdYVtPawyDQ Mv6P92ZLts7svNJh3tlfkxE36/zExsty4BsJW6+gkbjwAu55h4po8pSVGEqcz80/lcbH vHMMWqT7U1Yzo+tpjFljdsZAcqGqmUCrFE+Xi1NgpCRc+pSi8FhEk3hNQdY37DeKiaPC 6AsZqZVOU91jaegAHB6NIPIn2cTzpEhrmGHyFXZYwSEljFGSHPpX1CRq+VXjFG2F272o zxzSkMqabZS+V66ddNiEU7x2MvjpnBxCnYxvYp0B/6OaeVdDtA+F4A+Rjn4x1rFVH3vm vfOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=tc3xcv8+3SDxDIzzFnqi+wJJ6qYCJoTl2aiGT9V+2eo=; b=PCiMSepN5fWvoTiGzuOP1bnMRksqEwdBC5yBg22imBUsDeU1Vl9TIMO1bSvPnrXe2G Ys20zzB2FMg+eapiNelz4Z3UGBqYxjbayn9oOFnSsyBHglBBo5VGr0ovrE7ViY1CcDYu UqvbdDF4tjC6uIXQRo6ZpIYBbQrTCEzcM+DzH7Yg9vUmn8rnbj1lOzns3MNEf7KBb4nq pa+0YFqMjtsGw4y5nJUrZlBBHVoxh4eB6weAuUbHwDshHIcjW0U97dHonJobdcEofK3q tqu+y0MFsnTmQ8eeH7IgPMu8FjOcGcBuVkzfVr5XNGKtqY9lHsJcVavPbyI+9h50ZyDC 16Wg== X-Gm-Message-State: APf1xPBSTgmUrqsDTyDjVh82DVD+OI/pI8pO8PeMEtcamo1sQb6YVsP1 WHlcOzYSvqYBERWfCTyEr7g1ytRKvqw= X-Google-Smtp-Source: AH8x227ZTbgoFkGlB02/HWjs2fUMESuhyIR8l1y3j2kkbAeima3Lz9ztp9s0qpqo+x+BElPrdWx0qg== X-Received: by 10.46.5.3 with SMTP id 3mr8695930ljf.135.1519024636259; Sun, 18 Feb 2018 23:17:16 -0800 (PST) Received: from localhost (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id o85sm2361419lfb.31.2018.02.18.23.17.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Feb 2018 23:17:15 -0800 (PST) Date: Mon, 19 Feb 2018 08:17:14 +0100 From: Tomasz Duszynski To: "Singh, Jasvinder" Cc: Tomasz Duszynski , "dev@dpdk.org" , "Lu, Wenzhuo" , "Wu, Jingjing" Message-ID: <20180219071714.GA5726@sh> References: <1517477799-18946-1-git-send-email-tdu@semihalf.com> <1517477799-18946-3-git-send-email-tdu@semihalf.com> <54CBAA185211B4429112C315DA58FF6D332FA949@IRSMSX103.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <54CBAA185211B4429112C315DA58FF6D332FA949@IRSMSX103.ger.corp.intel.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 2/2] app/testpmd: add command to resume a TM node 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: Mon, 19 Feb 2018 07:17:16 -0000 On Fri, Feb 16, 2018 at 01:10:39PM +0000, Singh, Jasvinder wrote: > > > > -----Original Message----- > > From: Tomasz Duszynski [mailto:tdu@semihalf.com] > > Sent: Thursday, February 1, 2018 9:37 AM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo ; Wu, Jingjing > > ; Singh, Jasvinder ; > > Tomasz Duszynski > > Subject: [PATCH 2/2] app/testpmd: add command to resume a TM node > > > > Traffic manager provides an API for resuming an arbitrary node in a > > hierarchy. > > > > This commit adds support for calling this API from testpmd. > > > > Signed-off-by: Tomasz Duszynski > > --- > > app/test-pmd/cmdline.c | 4 ++ > > app/test-pmd/cmdline_tm.c | 70 > > +++++++++++++++++++++++++++++ > > app/test-pmd/cmdline_tm.h | 1 + > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +++ > > 4 files changed, 80 insertions(+) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > 6bbd606..f9827f6 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -800,6 +800,9 @@ static void cmd_help_long_parsed(void > > *parsed_result, > > "suspend port tm node (port_id) (node_id)" > > " Suspend tm node.\n\n" > > > > + "resume port tm node (port_id) (node_id)" > > + " Resume tm node.\n\n" > > + > > "port tm hierarchy commit (port_id) > > (clean_on_fail)\n" > > " Commit tm hierarchy.\n\n" > > > > @@ -16251,6 +16254,7 @@ cmdline_parse_ctx_t main_ctx[] =3D { > > (cmdline_parse_inst_t *)&cmd_del_port_tm_node, > > (cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent, > > (cmdline_parse_inst_t *)&cmd_suspend_port_tm_node, > > + (cmdline_parse_inst_t *)&cmd_resume_port_tm_node, > > (cmdline_parse_inst_t *)&cmd_port_tm_hierarchy_commit, > > NULL, > > }; > > diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index > > c9a18dd..807e724 100644 > > --- a/app/test-pmd/cmdline_tm.c > > +++ b/app/test-pmd/cmdline_tm.c > > @@ -2036,6 +2036,76 @@ cmdline_parse_inst_t > > cmd_suspend_port_tm_node =3D { > > }, > > }; > > > > +/* *** Resume Port TM Node *** */ > > +struct cmd_resume_port_tm_node_result { > > + cmdline_fixed_string_t resume; > > + cmdline_fixed_string_t port; > > + cmdline_fixed_string_t tm; > > + cmdline_fixed_string_t node; > > + uint16_t port_id; > > + uint32_t node_id; > > +}; > > + > > +cmdline_parse_token_string_t cmd_resume_port_tm_node_resume =3D > > + TOKEN_STRING_INITIALIZER( > > + struct cmd_resume_port_tm_node_result, resume, > > "resume"); > > +cmdline_parse_token_string_t cmd_resume_port_tm_node_port =3D > > + TOKEN_STRING_INITIALIZER( > > + struct cmd_resume_port_tm_node_result, port, "port"); > > +cmdline_parse_token_string_t cmd_resume_port_tm_node_tm =3D > > + TOKEN_STRING_INITIALIZER( > > + struct cmd_resume_port_tm_node_result, tm, "tm"); > > +cmdline_parse_token_string_t cmd_resume_port_tm_node_node =3D > > + TOKEN_STRING_INITIALIZER( > > + struct cmd_resume_port_tm_node_result, node, "node"); > > +cmdline_parse_token_num_t cmd_resume_port_tm_node_port_id =3D > > + TOKEN_NUM_INITIALIZER( > > + struct cmd_resume_port_tm_node_result, port_id, UINT16); > > +cmdline_parse_token_num_t cmd_resume_port_tm_node_node_id =3D > > + TOKEN_NUM_INITIALIZER( > > + struct cmd_resume_port_tm_node_result, node_id, UINT32); > > + > > +static void cmd_resume_port_tm_node_parsed(void *parsed_result, > > + __attribute__((unused)) struct cmdline *cl, > > + __attribute__((unused)) void *data) > > +{ > > + struct cmd_resume_port_tm_node_result *res =3D parsed_result; > > + struct rte_tm_error error; > > + uint32_t node_id =3D res->node_id; > > + portid_t port_id =3D res->port_id; > > + int ret; > > + > > + if (port_id_is_invalid(port_id, ENABLED_WARN)) > > + return; > > + > > + /* Port status */ > > + if (!port_is_started(port_id)) { > > + printf(" Port %u not started (error)\n", port_id); > > + return; > > + } > > I suggest to remove the CLI layer restriction to check the port status fo= r node suspend/resume. > The device can check at the driver layer whether it is ok suspend/resume = node in started/stopped state depending upon the allowed configuration. Fair enough. Thanks for the review. > > Besides this, > Reviewed-by: Jasvinder Singh -- - Tomasz Duszy=C5=84ski