From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <cristian.dumitrescu@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 9D6F91B05
 for <dev@dpdk.org>; Fri, 29 Mar 2019 21:16:37 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 29 Mar 2019 13:16:36 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,285,1549958400"; d="scan'208";a="145024768"
Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153])
 by FMSMGA003.fm.intel.com with ESMTP; 29 Mar 2019 13:16:35 -0700
Received: from irsmsx108.ger.corp.intel.com ([169.254.11.7]) by
 IRSMSX101.ger.corp.intel.com ([169.254.1.230]) with mapi id 14.03.0415.000;
 Fri, 29 Mar 2019 20:16:34 +0000
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Rao, Nikhil" <nikhil.rao@intel.com>, "Singh, Jasvinder"
 <jasvinder.singh@intel.com>
CC: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu, Jingjing"
 <jingjing.wu@intel.com>, "Iremonger, Bernard" <bernard.iremonger@intel.com>,
 "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2] ethdev: support double precision RED queue weight
Thread-Index: AQHUqQLP0bMcI3wpV062J4nN7ATwQ6YjhXEQ
Date: Fri, 29 Mar 2019 20:16:34 +0000
Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E85FDD0@IRSMSX108.ger.corp.intel.com>
References: <1543470882-145287-1-git-send-email-nikhil.rao@intel.com>
 <1547138133-54919-1-git-send-email-nikhil.rao@intel.com>
In-Reply-To: <1547138133-54919-1-git-send-email-nikhil.rao@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2ZlMGFkNTItY2VkOS00ZTE0LWEzNGEtMjA0NjVmZWVhNGYxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicXJSMWF5QXI3T3NIdEdUWTNxa05uN1RYSnJLeExuM0JMT2hjXC8zWDltK051dEZ1OWNoRVZTZWtIRUU1VE9FZjMifQ==
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.0.400.15
dlp-reaction: no-action
x-originating-ip: [163.33.239.180]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: support double precision RED
	queue weight
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Mar 2019 20:16:38 -0000



> -----Original Message-----
> From: Rao, Nikhil
> Sent: Thursday, January 10, 2019 4:36 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Singh, Jasvinde=
r
> <jasvinder.singh@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; dev@dpdk.org; Rao, Nikhil
> <nikhil.rao@intel.com>
> Subject: [PATCH v2] ethdev: support double precision RED queue weight
>=20
> RED queue weight is currently specified as a negated log of 2.
>=20
> Add support for RED queue weight to be specified in double precision
> and TM capability flags for double precision and negated log2
> RED queue weight support.
>=20
> Update the softnic PMD and testpmd for the new tm capability flags and
> the struct rte_tm_red_params::wq_is_log2 flag.
>=20
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
>  lib/librte_ethdev/rte_tm.h               | 40
> ++++++++++++++++++++++++++++++--
>  app/test-pmd/cmdline_tm.c                |  8 ++++++-
>  drivers/net/softnic/rte_eth_softnic_tm.c |  7 ++++--
>  3 files changed, 50 insertions(+), 5 deletions(-)
>=20
> v2:
> * added RTE_STD_C11 for anonymnous union
> * testpmd: added cman_wred_wq_log2/wq_dp_supported to "show port
> tm cap" cli command
> * testpmd: set wq_is_log2 for WRED profiles added on testpmd cli
>=20
> Cristian,
> I assume the testpmd changes will be upstreamed via the dpdk-next-qos
> tree.
>=20
> diff --git a/lib/librte_ethdev/rte_tm.h b/lib/librte_ethdev/rte_tm.h
> index c4a788b..4fad31b 100644
> --- a/lib/librte_ethdev/rte_tm.h
> +++ b/lib/librte_ethdev/rte_tm.h
> @@ -391,6 +391,22 @@ struct rte_tm_capabilities {
>  	 */
>  	int cman_wred_byte_mode_supported;
>=20
> +	/** Double precision RED queue weight support. When non-zero,
> this
> +	 * this parameter indicates that RED queue weight in double precision
> +	 * format is supported.
> +	 * @see struct rte_tm_red_params::wq_is_log2
> +	 * @see struct rte_tm_red_params::wq_dp
> +	 */
> +	int cman_wred_wq_dp_supported;
> +
> +	/** Negated log2 RED queue weight support. When non-zero, this
> +	 * parameter indicates that RED queue weight in negated log2 format
> +	 * is supported.
> +	 * @see struct rte_tm_red_params::wq_is_log2
> +	 * @see struct rte_tm_red_params::wq_log2
> +	 */
> +	int cman_wred_wq_log2_supported;
> +
>  	/** Head drop algorithm support. When non-zero, this parameter
>  	 * indicates that there is at least one leaf node that supports the
> head
>  	 * drop algorithm, which might not be true for all the leaf nodes.
> @@ -839,8 +855,28 @@ struct rte_tm_red_params {
>  	 */
>  	uint16_t maxp_inv;
>=20
> -	/** Negated log2 of queue weight (wq), i.e. wq =3D 1 / (2 ^ wq_log2)
> */
> -	uint16_t wq_log2;
> +	/** When non-zero, RED queue weight (wq) is negated log2 of
> queue
> +	 * weight
> +	 *
> +	 * @see struct rte_tm_capabilities::cman_wred_wq_dp_supported
> +	 * @see struct rte_tm_capabilities::cman_wred_wq_log2_supported
> +	 */
> +	int wq_is_log2;
> +
> +	RTE_STD_C11
> +	union {
> +		/** Double precision queue weight
> +		 *
> +		 * @see struct
> rte_tm_capabilities::cman_wred_wq_dp_supported
> +		 */
> +		double wq_dp;
> +		/** Negated log2 of queue weight (wq),
> +		 * i.e. wq =3D 1 / (2 ^ wq_log2)
> +		 *
> +		 * @see struct
> rte_tm_capabilities::cman_wred_wq_log2_supported
> +		 */
> +		uint16_t wq_log2;
> +	};
>  };
>=20
>  /**
> diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c
> index 1012084..afc1d63 100644
> --- a/app/test-pmd/cmdline_tm.c
> +++ b/app/test-pmd/cmdline_tm.c
> @@ -283,6 +283,10 @@ static void cmd_show_port_tm_cap_parsed(void
> *parsed_result,
>  		cap.sched_wfq_n_groups_max);
>  	printf("cap.sched_wfq_weight_max %" PRIu32 "\n",
>  		cap.sched_wfq_weight_max);
> +	printf("cap.cman_wred_wq_dp_supported %" PRId32 "\n",
> +		cap.cman_wred_wq_dp_supported);
> +	printf("cap.cman_wred_wq_log2_supported %" PRId32 "\n",
> +		cap.cman_wred_wq_log2_supported);
>  	printf("cap.cman_head_drop_supported %" PRId32 "\n",
>  		cap.cman_head_drop_supported);
>  	printf("cap.cman_wred_context_n_max %" PRIu32 "\n",
> @@ -1285,7 +1289,7 @@ static void
> cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,
>  	wp.red_params[color].max_th =3D res->max_th_g;
>  	wp.red_params[color].maxp_inv =3D res->maxp_inv_g;
>  	wp.red_params[color].wq_log2 =3D res->wq_log2_g;
> -
> +	wp.red_params[color].wq_is_log2 =3D 1;
>=20
>  	/* WRED Params  (Yellow Color)*/
>  	color =3D RTE_TM_YELLOW;
> @@ -1293,6 +1297,7 @@ static void
> cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,
>  	wp.red_params[color].max_th =3D res->max_th_y;
>  	wp.red_params[color].maxp_inv =3D res->maxp_inv_y;
>  	wp.red_params[color].wq_log2 =3D res->wq_log2_y;
> +	wp.red_params[color].wq_is_log2 =3D 1;
>=20
>  	/* WRED Params  (Red Color)*/
>  	color =3D RTE_TM_RED;
> @@ -1300,6 +1305,7 @@ static void
> cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,
>  	wp.red_params[color].max_th =3D res->max_th_r;
>  	wp.red_params[color].maxp_inv =3D res->maxp_inv_r;
>  	wp.red_params[color].wq_log2 =3D res->wq_log2_r;
> +	wp.red_params[color].wq_is_log2 =3D 1;
>=20
>  	ret =3D rte_tm_wred_profile_add(port_id, wred_profile_id, &wp,
> &error);
>  	if (ret !=3D 0) {
> diff --git a/drivers/net/softnic/rte_eth_softnic_tm.c
> b/drivers/net/softnic/rte_eth_softnic_tm.c
> index baaafbe..e96ea8e 100644
> --- a/drivers/net/softnic/rte_eth_softnic_tm.c
> +++ b/drivers/net/softnic/rte_eth_softnic_tm.c
> @@ -469,7 +469,8 @@ struct softnic_tmgr_port *
>  	.cman_wred_context_shared_n_max =3D 0,
>  	.cman_wred_context_shared_n_nodes_per_context_max =3D 0,
>  	.cman_wred_context_shared_n_contexts_per_node_max =3D 0,
> -
> +	.cman_wred_wq_dp_supported =3D 0,
> +	.cman_wred_wq_log2_supported =3D WRED_SUPPORTED,
>  	.mark_vlan_dei_supported =3D {0, 0, 0},
>  	.mark_ip_ecn_tcp_supported =3D {0, 0, 0},
>  	.mark_ip_ecn_sctp_supported =3D {0, 0, 0},
> @@ -1243,8 +1244,10 @@ struct softnic_tmgr_port *
>  	for (color =3D RTE_TM_GREEN; color < RTE_TM_COLORS; color++) {
>  		uint32_t min_th =3D profile->red_params[color].min_th;
>  		uint32_t max_th =3D profile->red_params[color].max_th;
> +		int wq_is_log2 =3D profile->red_params[color].wq_is_log2;
>=20
> -		if (min_th > max_th ||
> +		if (wq_is_log2 =3D=3D 0 ||
> +			min_th > max_th ||
>  			max_th =3D=3D 0 ||
>  			min_th > UINT16_MAX ||
>  			max_th > UINT16_MAX)
> --
> 1.8.3.1


Hi Nikhil,

Code looks good to me, but there is a problem: you are introducing new API =
without providing an implementation for it, and this is no longer allowed b=
y the DPDK Tech Board [1][2].

Would it be possible to provide an implementation for this new API? A SW im=
plementation in librte_sched/rte_red.[hc] or divers/net/softnic would be en=
ough to tick this box.

Thanks,
Cristian

[1] https://mails.dpdk.org/archives/dev/2018-December/122213.html
[2] https://mails.dpdk.org/archives/dev/2018-November/118697.html

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id C4E19A05D3
	for <public@inbox.dpdk.org>; Fri, 29 Mar 2019 21:16:39 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id ED6912BD3;
	Fri, 29 Mar 2019 21:16:38 +0100 (CET)
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 9D6F91B05
 for <dev@dpdk.org>; Fri, 29 Mar 2019 21:16:37 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 29 Mar 2019 13:16:36 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,285,1549958400"; d="scan'208";a="145024768"
Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153])
 by FMSMGA003.fm.intel.com with ESMTP; 29 Mar 2019 13:16:35 -0700
Received: from irsmsx108.ger.corp.intel.com ([169.254.11.7]) by
 IRSMSX101.ger.corp.intel.com ([169.254.1.230]) with mapi id 14.03.0415.000;
 Fri, 29 Mar 2019 20:16:34 +0000
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Rao, Nikhil" <nikhil.rao@intel.com>, "Singh, Jasvinder"
 <jasvinder.singh@intel.com>
CC: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu, Jingjing"
 <jingjing.wu@intel.com>, "Iremonger, Bernard" <bernard.iremonger@intel.com>,
 "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2] ethdev: support double precision RED queue weight
Thread-Index: AQHUqQLP0bMcI3wpV062J4nN7ATwQ6YjhXEQ
Date: Fri, 29 Mar 2019 20:16:34 +0000
Message-ID:
 <3EB4FA525960D640B5BDFFD6A3D891268E85FDD0@IRSMSX108.ger.corp.intel.com>
References: <1543470882-145287-1-git-send-email-nikhil.rao@intel.com>
 <1547138133-54919-1-git-send-email-nikhil.rao@intel.com>
In-Reply-To: <1547138133-54919-1-git-send-email-nikhil.rao@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2ZlMGFkNTItY2VkOS00ZTE0LWEzNGEtMjA0NjVmZWVhNGYxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicXJSMWF5QXI3T3NIdEdUWTNxa05uN1RYSnJLeExuM0JMT2hjXC8zWDltK051dEZ1OWNoRVZTZWtIRUU1VE9FZjMifQ==
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.0.400.15
dlp-reaction: no-action
x-originating-ip: [163.33.239.180]
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: support double precision RED
	queue weight
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190329201634.OMoPEH4MlzTLyTl6isI7F-3_hwGUOW9b4azs-Abcfm4@z>



> -----Original Message-----
> From: Rao, Nikhil
> Sent: Thursday, January 10, 2019 4:36 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Singh, Jasvinde=
r
> <jasvinder.singh@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; dev@dpdk.org; Rao, Nikhil
> <nikhil.rao@intel.com>
> Subject: [PATCH v2] ethdev: support double precision RED queue weight
>=20
> RED queue weight is currently specified as a negated log of 2.
>=20
> Add support for RED queue weight to be specified in double precision
> and TM capability flags for double precision and negated log2
> RED queue weight support.
>=20
> Update the softnic PMD and testpmd for the new tm capability flags and
> the struct rte_tm_red_params::wq_is_log2 flag.
>=20
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
>  lib/librte_ethdev/rte_tm.h               | 40
> ++++++++++++++++++++++++++++++--
>  app/test-pmd/cmdline_tm.c                |  8 ++++++-
>  drivers/net/softnic/rte_eth_softnic_tm.c |  7 ++++--
>  3 files changed, 50 insertions(+), 5 deletions(-)
>=20
> v2:
> * added RTE_STD_C11 for anonymnous union
> * testpmd: added cman_wred_wq_log2/wq_dp_supported to "show port
> tm cap" cli command
> * testpmd: set wq_is_log2 for WRED profiles added on testpmd cli
>=20
> Cristian,
> I assume the testpmd changes will be upstreamed via the dpdk-next-qos
> tree.
>=20
> diff --git a/lib/librte_ethdev/rte_tm.h b/lib/librte_ethdev/rte_tm.h
> index c4a788b..4fad31b 100644
> --- a/lib/librte_ethdev/rte_tm.h
> +++ b/lib/librte_ethdev/rte_tm.h
> @@ -391,6 +391,22 @@ struct rte_tm_capabilities {
>  	 */
>  	int cman_wred_byte_mode_supported;
>=20
> +	/** Double precision RED queue weight support. When non-zero,
> this
> +	 * this parameter indicates that RED queue weight in double precision
> +	 * format is supported.
> +	 * @see struct rte_tm_red_params::wq_is_log2
> +	 * @see struct rte_tm_red_params::wq_dp
> +	 */
> +	int cman_wred_wq_dp_supported;
> +
> +	/** Negated log2 RED queue weight support. When non-zero, this
> +	 * parameter indicates that RED queue weight in negated log2 format
> +	 * is supported.
> +	 * @see struct rte_tm_red_params::wq_is_log2
> +	 * @see struct rte_tm_red_params::wq_log2
> +	 */
> +	int cman_wred_wq_log2_supported;
> +
>  	/** Head drop algorithm support. When non-zero, this parameter
>  	 * indicates that there is at least one leaf node that supports the
> head
>  	 * drop algorithm, which might not be true for all the leaf nodes.
> @@ -839,8 +855,28 @@ struct rte_tm_red_params {
>  	 */
>  	uint16_t maxp_inv;
>=20
> -	/** Negated log2 of queue weight (wq), i.e. wq =3D 1 / (2 ^ wq_log2)
> */
> -	uint16_t wq_log2;
> +	/** When non-zero, RED queue weight (wq) is negated log2 of
> queue
> +	 * weight
> +	 *
> +	 * @see struct rte_tm_capabilities::cman_wred_wq_dp_supported
> +	 * @see struct rte_tm_capabilities::cman_wred_wq_log2_supported
> +	 */
> +	int wq_is_log2;
> +
> +	RTE_STD_C11
> +	union {
> +		/** Double precision queue weight
> +		 *
> +		 * @see struct
> rte_tm_capabilities::cman_wred_wq_dp_supported
> +		 */
> +		double wq_dp;
> +		/** Negated log2 of queue weight (wq),
> +		 * i.e. wq =3D 1 / (2 ^ wq_log2)
> +		 *
> +		 * @see struct
> rte_tm_capabilities::cman_wred_wq_log2_supported
> +		 */
> +		uint16_t wq_log2;
> +	};
>  };
>=20
>  /**
> diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c
> index 1012084..afc1d63 100644
> --- a/app/test-pmd/cmdline_tm.c
> +++ b/app/test-pmd/cmdline_tm.c
> @@ -283,6 +283,10 @@ static void cmd_show_port_tm_cap_parsed(void
> *parsed_result,
>  		cap.sched_wfq_n_groups_max);
>  	printf("cap.sched_wfq_weight_max %" PRIu32 "\n",
>  		cap.sched_wfq_weight_max);
> +	printf("cap.cman_wred_wq_dp_supported %" PRId32 "\n",
> +		cap.cman_wred_wq_dp_supported);
> +	printf("cap.cman_wred_wq_log2_supported %" PRId32 "\n",
> +		cap.cman_wred_wq_log2_supported);
>  	printf("cap.cman_head_drop_supported %" PRId32 "\n",
>  		cap.cman_head_drop_supported);
>  	printf("cap.cman_wred_context_n_max %" PRIu32 "\n",
> @@ -1285,7 +1289,7 @@ static void
> cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,
>  	wp.red_params[color].max_th =3D res->max_th_g;
>  	wp.red_params[color].maxp_inv =3D res->maxp_inv_g;
>  	wp.red_params[color].wq_log2 =3D res->wq_log2_g;
> -
> +	wp.red_params[color].wq_is_log2 =3D 1;
>=20
>  	/* WRED Params  (Yellow Color)*/
>  	color =3D RTE_TM_YELLOW;
> @@ -1293,6 +1297,7 @@ static void
> cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,
>  	wp.red_params[color].max_th =3D res->max_th_y;
>  	wp.red_params[color].maxp_inv =3D res->maxp_inv_y;
>  	wp.red_params[color].wq_log2 =3D res->wq_log2_y;
> +	wp.red_params[color].wq_is_log2 =3D 1;
>=20
>  	/* WRED Params  (Red Color)*/
>  	color =3D RTE_TM_RED;
> @@ -1300,6 +1305,7 @@ static void
> cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,
>  	wp.red_params[color].max_th =3D res->max_th_r;
>  	wp.red_params[color].maxp_inv =3D res->maxp_inv_r;
>  	wp.red_params[color].wq_log2 =3D res->wq_log2_r;
> +	wp.red_params[color].wq_is_log2 =3D 1;
>=20
>  	ret =3D rte_tm_wred_profile_add(port_id, wred_profile_id, &wp,
> &error);
>  	if (ret !=3D 0) {
> diff --git a/drivers/net/softnic/rte_eth_softnic_tm.c
> b/drivers/net/softnic/rte_eth_softnic_tm.c
> index baaafbe..e96ea8e 100644
> --- a/drivers/net/softnic/rte_eth_softnic_tm.c
> +++ b/drivers/net/softnic/rte_eth_softnic_tm.c
> @@ -469,7 +469,8 @@ struct softnic_tmgr_port *
>  	.cman_wred_context_shared_n_max =3D 0,
>  	.cman_wred_context_shared_n_nodes_per_context_max =3D 0,
>  	.cman_wred_context_shared_n_contexts_per_node_max =3D 0,
> -
> +	.cman_wred_wq_dp_supported =3D 0,
> +	.cman_wred_wq_log2_supported =3D WRED_SUPPORTED,
>  	.mark_vlan_dei_supported =3D {0, 0, 0},
>  	.mark_ip_ecn_tcp_supported =3D {0, 0, 0},
>  	.mark_ip_ecn_sctp_supported =3D {0, 0, 0},
> @@ -1243,8 +1244,10 @@ struct softnic_tmgr_port *
>  	for (color =3D RTE_TM_GREEN; color < RTE_TM_COLORS; color++) {
>  		uint32_t min_th =3D profile->red_params[color].min_th;
>  		uint32_t max_th =3D profile->red_params[color].max_th;
> +		int wq_is_log2 =3D profile->red_params[color].wq_is_log2;
>=20
> -		if (min_th > max_th ||
> +		if (wq_is_log2 =3D=3D 0 ||
> +			min_th > max_th ||
>  			max_th =3D=3D 0 ||
>  			min_th > UINT16_MAX ||
>  			max_th > UINT16_MAX)
> --
> 1.8.3.1


Hi Nikhil,

Code looks good to me, but there is a problem: you are introducing new API =
without providing an implementation for it, and this is no longer allowed b=
y the DPDK Tech Board [1][2].

Would it be possible to provide an implementation for this new API? A SW im=
plementation in librte_sched/rte_red.[hc] or divers/net/softnic would be en=
ough to tick this box.

Thanks,
Cristian

[1] https://mails.dpdk.org/archives/dev/2018-December/122213.html
[2] https://mails.dpdk.org/archives/dev/2018-November/118697.html