DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Rao, Nikhil" <nikhil.rao@intel.com>,
	"Singh, Jasvinder" <jasvinder.singh@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] ethdev: support double precision RED queue weight
Date: Mon, 7 Jan 2019 16:39:51 +0000	[thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E826F02@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1543470882-145287-1-git-send-email-nikhil.rao@intel.com>

Hi Nikhil,

> -----Original Message-----
> From: Rao, Nikhil
> Sent: Thursday, November 29, 2018 5:55 AM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Singh, Jasvinder
> <jasvinder.singh@intel.com>
> Cc: dev@dpdk.org; Rao, Nikhil <nikhil.rao@intel.com>
> Subject: [PATCH] ethdev: support double precision RED queue weight
> 
> RED queue weight is currently specified as a negated log of 2.
> 
> 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.
> 
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
>  lib/librte_ethdev/rte_tm.h               | 41
> ++++++++++++++++++++++++++++++--
>  drivers/net/softnic/rte_eth_softnic_tm.c |  7 ++++--
>  2 files changed, 44 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/librte_ethdev/rte_tm.h b/lib/librte_ethdev/rte_tm.h
> index 646ef38..b13454d 100644
> --- a/lib/librte_ethdev/rte_tm.h
> +++ b/lib/librte_ethdev/rte_tm.h
> @@ -393,6 +393,22 @@ struct rte_tm_capabilities {
>  	 */
>  	int cman_wred_byte_mode_supported;
> 
> +	/** 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.
> @@ -841,8 +857,27 @@ struct rte_tm_red_params {
>  	 */
>  	uint16_t maxp_inv;
> 
> -	/** Negated log2 of queue weight (wq), i.e. wq = 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;
> +

Anonymous unions have to be declared with RTE_STD_C11:

RTE_STD_C11
union {
...
};

Look for some examples of anonymous unions in DPDK.

> +	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 = 1 / (2 ^ wq_log2)
> +		 *
> +		 * @see struct
> rte_tm_capabilities::cman_wred_wq_log2_supported
> +		 */
> +		uint16_t wq_log2;
> +	};
>  };
> 
>  /**
> @@ -858,6 +893,8 @@ struct rte_tm_red_params {
>   *
>   * @see struct rte_tm_capabilities::cman_wred_packet_mode_supported
>   * @see struct rte_tm_capabilities::cman_wred_byte_mode_supported
> + * @see struct rte_tm_capabilities::cman_wred_wq_dp_supported
> + * @see struct rte_tm_capabilities::cman_wred_wq_log2_supported
>   */
>  struct rte_tm_wred_params {
>  	/** One set of RED parameters per packet color */
> 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 = 0,
>  	.cman_wred_context_shared_n_nodes_per_context_max = 0,
>  	.cman_wred_context_shared_n_contexts_per_node_max = 0,
> -
> +	.cman_wred_wq_dp_supported = 0,
> +	.cman_wred_wq_log2_supported = WRED_SUPPORTED,
>  	.mark_vlan_dei_supported = {0, 0, 0},
>  	.mark_ip_ecn_tcp_supported = {0, 0, 0},
>  	.mark_ip_ecn_sctp_supported = {0, 0, 0},
> @@ -1243,8 +1244,10 @@ struct softnic_tmgr_port *
>  	for (color = RTE_TM_GREEN; color < RTE_TM_COLORS; color++) {
>  		uint32_t min_th = profile->red_params[color].min_th;
>  		uint32_t max_th = profile->red_params[color].max_th;
> +		int wq_is_log2 = profile->red_params[color].wq_is_log2;
> 
> -		if (min_th > max_th ||
> +		if (wq_is_log2 == 0 ||
> +			min_th > max_th ||
>  			max_th == 0 ||
>  			min_th > UINT16_MAX ||
>  			max_th > UINT16_MAX)
> --
> 1.8.3.1

Do we need changes in test-pmd as well?

Regards,
Cristian

  parent reply	other threads:[~2019-01-07 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29  5:54 Nikhil Rao
2018-11-29  6:12 ` Stephen Hemminger
2018-12-10  5:43   ` Rao, Nikhil
2018-12-10 16:01     ` Stephen Hemminger
2019-01-10  6:23       ` Rao, Nikhil
2018-12-10 15:57 ` Stephen Hemminger
2019-01-07 16:39 ` Dumitrescu, Cristian [this message]
2019-01-10 16:35 ` [dpdk-dev] [PATCH v2] " Nikhil Rao
2019-03-29 20:16   ` Dumitrescu, Cristian
2019-03-29 20:16     ` Dumitrescu, Cristian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EB4FA525960D640B5BDFFD6A3D891268E826F02@IRSMSX108.ger.corp.intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=nikhil.rao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).