From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id 2C649A48C for ; Fri, 16 Feb 2018 09:13:41 +0100 (CET) Received: by mail-lf0-f65.google.com with SMTP id q69so2932933lfi.10 for ; Fri, 16 Feb 2018 00:13:41 -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=AxUPooWUNcB40+19gdLXbWh66D8gV1zgT9frJT0Rzm4=; b=oM5T63n7u/wXg1oqcbyptkFWe5FIXIMCTggz3sLcNS1JEZvWlGqpLTGe6w6iddL1Co gcT3tSy0xBUVupbmMvpRUvO61tOZuFxnPQFPoaRX1iJ7UUOCc2Uu6g+y8/sMr8+QMGfb 1w2Ir2ibDdQlfHlxQp1aVGNTaukrSRnNSYmk86Fod9BRsri9fzvju2es9DgNimXRqVm/ JkPagIvK2f6ffXSkL/CrszylwP/cgosW3DD1zStAM1mTB4EbAmrbAY7Duf/j6OLCIote ohejRoj58PT19yl0SLspGyrbx/hI6YgqB7E/ooLi/mooRBuxENx62j59UK6+/xGZ+ieW gfsQ== 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=AxUPooWUNcB40+19gdLXbWh66D8gV1zgT9frJT0Rzm4=; b=WU5Nc5vCqybGQyN5eca14PFnMT5NyYdp8z+JlJfWQrzDoZSF1hNQhc3G9peWjYmALX GoRBK0W9jxemonuOICnXWyokvbMqmqG0e7xlasXA6I7z6IZ6EzBAYnTeTQ6CgPoz0zZ9 hDr03FXFN32VwJMfIt4U+UfWIJhuUHs/f/qhMdoMAnZ8vGSJcqCjK2QBpxc5C4JeG0CT oD8adBPWtzo/+pvW3gibJOkJatR68UGe4DdIEo5UlO0oZ4jbh7Dg1taQ8GR3P2GyqyUY C4bOvKH8FBrxqEWNmEplvNxrWmHXqp4QE3kpBnAbCbkLbIcsa+bVUVKrX3tP5UjGgKhd 9mtw== X-Gm-Message-State: APf1xPDMLaisxgZWDlyDKQXS7m7Zyya/kQFfpDg+K/vXKBp02ouPNvpi AkfYj3y5CJD7FFbwm00QSLUxNg5+wec= X-Google-Smtp-Source: AH8x226YqmgSQXCNkxU0D9cOmyfBQg/d0VWh72rVtVqTwO2N34zrRk96cTanBZlGn+v+16w8oVeWKg== X-Received: by 10.25.113.14 with SMTP id m14mr501632lfc.71.1518768820616; Fri, 16 Feb 2018 00:13:40 -0800 (PST) Received: from localhost (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id o6sm3579929lfo.76.2018.02.16.00.13.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 00:13:39 -0800 (PST) Date: Fri, 16 Feb 2018 09:13:39 +0100 From: Tomasz Duszynski To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com, Tomasz Duszynski Message-ID: <20180216081339.GB25327@sh> References: <1517297828-3111-1-git-send-email-tdu@semihalf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1517297828-3111-1-git-send-email-tdu@semihalf.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] app/testpmd: allow setting shaper profile id to none 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: Fri, 16 Feb 2018 08:13:41 -0000 On Tue, Jan 30, 2018 at 08:37:08AM +0100, Tomasz Duszynski wrote: > Private shaper profiles are attached to nodes defined > in traffic manager hierarchy. > > Since not every node must have a configured shaper > testpmd should allow setting shaper profile id to > invalid (RTE_TM_SHAPER_PROFILE_ID_NONE) easily. > > This patch follows same approach as in case of setting > parent id of the root node i.e passing a negative value > sets node id to RTE_TM_NODE_ID_NULL. > > In case of private shaper profile negative value will set > shaper profile id to RTE_TM_SHAPER_PROFILE_ID_NONE. > > Signed-off-by: Tomasz Duszynski > --- > app/test-pmd/cmdline_tm.c | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) > > diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c > index 35cad54..9859c3d 100644 > --- a/app/test-pmd/cmdline_tm.c > +++ b/app/test-pmd/cmdline_tm.c > @@ -1500,7 +1500,7 @@ struct cmd_add_port_tm_nonleaf_node_result { > uint32_t priority; > uint32_t weight; > uint32_t level_id; > - uint32_t shaper_profile_id; > + int32_t shaper_profile_id; > uint32_t n_sp_priorities; > uint64_t stats_mask; > cmdline_multi_string_t multi_shared_shaper_id; > @@ -1542,7 +1542,7 @@ cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_n= ode_level_id =3D > level_id, UINT32); > cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_shaper_profile_id= =3D > TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, > - shaper_profile_id, UINT32); > + shaper_profile_id, INT32); > cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_n_sp_priorities = =3D > TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, > n_sp_priorities, UINT32); > @@ -1593,7 +1593,11 @@ static void cmd_add_port_tm_nonleaf_node_parsed(vo= id *parsed_result, > return; > } > > - np.shaper_profile_id =3D res->shaper_profile_id; > + if (res->shaper_profile_id < 0) > + np.shaper_profile_id =3D UINT32_MAX; > + else > + np.shaper_profile_id =3D res->shaper_profile_id; > + > np.n_shared_shapers =3D n_shared_shapers; > if (np.n_shared_shapers) > np.shared_shaper_id =3D &shared_shaper_id[0]; > @@ -1651,7 +1655,7 @@ struct cmd_add_port_tm_leaf_node_result { > uint32_t priority; > uint32_t weight; > uint32_t level_id; > - uint32_t shaper_profile_id; > + int32_t shaper_profile_id; > uint32_t cman_mode; > uint32_t wred_profile_id; > uint64_t stats_mask; > @@ -1693,7 +1697,7 @@ cmdline_parse_token_num_t cmd_add_port_tm_leaf_node= _level_id =3D > level_id, UINT32); > cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_shaper_profile_id =3D > TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, > - shaper_profile_id, UINT32); > + shaper_profile_id, INT32); > cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_cman_mode =3D > TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, > cman_mode, UINT32); > @@ -1747,7 +1751,11 @@ static void cmd_add_port_tm_leaf_node_parsed(void = *parsed_result, > return; > } > > - np.shaper_profile_id =3D res->shaper_profile_id; > + if (res->shaper_profile_id < 0) > + np.shaper_profile_id =3D UINT32_MAX; > + else > + np.shaper_profile_id =3D res->shaper_profile_id; > + > np.n_shared_shapers =3D n_shared_shapers; > > if (np.n_shared_shapers) > -- > 2.7.4 > This has been here for a while already. Any comments? -- - Tomasz Duszy=C5=84ski