DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Ajmera, Megha" <megha.ajmera@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Singh, Jasvinder" <jasvinder.singh@intel.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>
Subject: RE: [PATCH v2 3/4] sched: Always enable best effort TC oversubscription in HQoS library.
Date: Fri, 18 Feb 2022 11:02:12 +0000	[thread overview]
Message-ID: <DM8PR11MB56703C823920FBDE67621C43EB379@DM8PR11MB5670.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220218093650.2549927-4-megha.ajmera@intel.com>



> -----Original Message-----
> From: Ajmera, Megha <megha.ajmera@intel.com>
> Sent: Friday, February 18, 2022 9:37 AM
> To: dev@dpdk.org; Singh, Jasvinder <jasvinder.singh@intel.com>;
> Dumitrescu, Cristian <cristian.dumitrescu@intel.com>;
> thomas@monjalon.net; david.marchand@redhat.com
> Subject: [PATCH v2 3/4] sched: Always enable best effort TC oversubscription
> in HQoS library.
> 
> Removed "RTE_SCHED_SUBPORT_TC_OV" flag from HQoS.
> 
> Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
> ---
>  lib/sched/rte_sched.c | 91 -------------------------------------------
>  1 file changed, 91 deletions(-)
> 
> diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c
> index 6f2d85edc0..807134b48d 100644
> --- a/lib/sched/rte_sched.c
> +++ b/lib/sched/rte_sched.c
> @@ -1329,14 +1329,12 @@ rte_sched_subport_config(struct
> rte_sched_port *port,
>  		for (i = 0; i < RTE_SCHED_PORT_N_GRINDERS; i++)
>  			s->grinder_base_bmp_pos[i] =
> RTE_SCHED_PIPE_INVALID;
> 
> -#ifdef RTE_SCHED_SUBPORT_TC_OV
>  		/* TC oversubscription */
>  		s->tc_ov_wm_min = port->mtu;
>  		s->tc_ov_period_id = 0;
>  		s->tc_ov = 0;
>  		s->tc_ov_n = 0;
>  		s->tc_ov_rate = 0;
> -#endif
>  	}
> 
>  	{
> @@ -1356,11 +1354,9 @@ rte_sched_subport_config(struct rte_sched_port
> *port,
>  			else
>  				profile->tc_credits_per_period[i] = 0;
> 
> -#ifdef RTE_SCHED_SUBPORT_TC_OV
>  		s->tc_ov_wm_max = rte_sched_time_ms_to_bytes(profile-
> >tc_period,
>  							s-
> >pipe_tc_be_rate_max);
>  		s->tc_ov_wm = s->tc_ov_wm_max;
> -#endif
>  		s->profile = subport_profile_id;
> 
>  	}
> @@ -2267,50 +2263,6 @@ rte_sched_port_enqueue(struct rte_sched_port
> *port, struct rte_mbuf **pkts,
>  	return result;
>  }
> 
> -#ifndef RTE_SCHED_SUBPORT_TC_OV
> -
> -static inline void
> -grinder_credits_update(struct rte_sched_port *port,
> -	struct rte_sched_subport *subport, uint32_t pos)
> -{
> -	struct rte_sched_grinder *grinder = subport->grinder + pos;
> -	struct rte_sched_pipe *pipe = grinder->pipe;
> -	struct rte_sched_pipe_profile *params = grinder->pipe_params;
> -	struct rte_sched_subport_profile *sp = grinder->subport_params;
> -	uint64_t n_periods;
> -	uint32_t i;
> -
> -	/* Subport TB */
> -	n_periods = (port->time - subport->tb_time) / sp->tb_period;
> -	subport->tb_credits += n_periods * sp->tb_credits_per_period;
> -	subport->tb_credits = RTE_MIN(subport->tb_credits, sp->tb_size);
> -	subport->tb_time += n_periods * sp->tb_period;
> -
> -	/* Pipe TB */
> -	n_periods = (port->time - pipe->tb_time) / params->tb_period;
> -	pipe->tb_credits += n_periods * params->tb_credits_per_period;
> -	pipe->tb_credits = RTE_MIN(pipe->tb_credits, params->tb_size);
> -	pipe->tb_time += n_periods * params->tb_period;
> -
> -	/* Subport TCs */
> -	if (unlikely(port->time >= subport->tc_time)) {
> -		for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
> -			subport->tc_credits[i] = sp-
> >tc_credits_per_period[i];
> -
> -		subport->tc_time = port->time + sp->tc_period;
> -	}
> -
> -	/* Pipe TCs */
> -	if (unlikely(port->time >= pipe->tc_time)) {
> -		for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
> -			pipe->tc_credits[i] = params-
> >tc_credits_per_period[i];
> -
> -		pipe->tc_time = port->time + params->tc_period;
> -	}
> -}
> -
> -#else
> -
>  static inline uint64_t
>  grinder_tc_ov_credits_update(struct rte_sched_port *port,
>  	struct rte_sched_subport *subport, uint32_t pos)
> @@ -2405,46 +2357,6 @@ grinder_credits_update(struct rte_sched_port
> *port,
>  	}
>  }
> 
> -#endif /* RTE_SCHED_TS_CREDITS_UPDATE, RTE_SCHED_SUBPORT_TC_OV
> */
> -
> -
> -#ifndef RTE_SCHED_SUBPORT_TC_OV
> -
> -static inline int
> -grinder_credits_check(struct rte_sched_port *port,
> -	struct rte_sched_subport *subport, uint32_t pos)
> -{
> -	struct rte_sched_grinder *grinder = subport->grinder + pos;
> -	struct rte_sched_pipe *pipe = grinder->pipe;
> -	struct rte_mbuf *pkt = grinder->pkt;
> -	uint32_t tc_index = grinder->tc_index;
> -	uint64_t pkt_len = pkt->pkt_len + port->frame_overhead;
> -	uint64_t subport_tb_credits = subport->tb_credits;
> -	uint64_t subport_tc_credits = subport->tc_credits[tc_index];
> -	uint64_t pipe_tb_credits = pipe->tb_credits;
> -	uint64_t pipe_tc_credits = pipe->tc_credits[tc_index];
> -	int enough_credits;
> -
> -	/* Check queue credits */
> -	enough_credits = (pkt_len <= subport_tb_credits) &&
> -		(pkt_len <= subport_tc_credits) &&
> -		(pkt_len <= pipe_tb_credits) &&
> -		(pkt_len <= pipe_tc_credits);
> -
> -	if (!enough_credits)
> -		return 0;
> -
> -	/* Update port credits */
> -	subport->tb_credits -= pkt_len;
> -	subport->tc_credits[tc_index] -= pkt_len;
> -	pipe->tb_credits -= pkt_len;
> -	pipe->tc_credits[tc_index] -= pkt_len;
> -
> -	return 1;
> -}
> -
> -#else
> -
>  static inline int
>  grinder_credits_check(struct rte_sched_port *port,
>  	struct rte_sched_subport *subport, uint32_t pos)
> @@ -2491,9 +2403,6 @@ grinder_credits_check(struct rte_sched_port
> *port,
>  	return 1;
>  }
> 
> -#endif /* RTE_SCHED_SUBPORT_TC_OV */
> -
> -
>  static inline int
>  grinder_schedule(struct rte_sched_port *port,
>  	struct rte_sched_subport *subport, uint32_t pos)
> --
> 2.25.1

Same comments on the title:
	sched: enable traffic class oversubscription unconditionally

  reply	other threads:[~2022-02-18 11:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18  9:36 [PATCH v2 0/4] sched: HQoS Library cleanup Megha Ajmera
2022-02-18  9:36 ` [PATCH v2 1/4] sched: Cleanup qos scheduler defines from rte_config Megha Ajmera
2022-02-18 10:52   ` Thomas Monjalon
2022-02-18 11:14     ` Dumitrescu, Cristian
2022-02-18 11:17     ` Dumitrescu, Cristian
2022-02-18 11:04   ` Dumitrescu, Cristian
2022-02-18  9:36 ` [PATCH v2 2/4] sched: Always enable stats in HQoS library Megha Ajmera
2022-02-18 11:01   ` Dumitrescu, Cristian
2022-02-18  9:36 ` [PATCH v2 3/4] sched: Always enable best effort TC oversubscription " Megha Ajmera
2022-02-18 11:02   ` Dumitrescu, Cristian [this message]
2022-02-18  9:36 ` [PATCH v2 4/4] sched: Removed code defined under VECTOR Defines Megha Ajmera
2022-02-18 11:03   ` Dumitrescu, Cristian
2022-02-18 10:58 ` [PATCH v2 0/4] sched: HQoS Library cleanup Dumitrescu, Cristian
2022-02-18 11:49   ` Thomas Monjalon
2022-02-22 12:57 ` [PATCH v3 0/4] sched: cleanup of sched library Megha Ajmera
2022-02-22 12:57   ` [PATCH v3 1/4] sched: remove code no longer needed Megha Ajmera
2022-02-22 12:57   ` [PATCH v3 2/4] sched: move grinder configuration flag Megha Ajmera
2022-02-22 12:57   ` [PATCH v3 3/4] sched: enable statistics unconditionally Megha Ajmera
2022-02-22 12:57   ` [PATCH v3 4/4] sched: enable traffic class oversubscription unconditionally Megha Ajmera
2022-02-22 15:27   ` [PATCH v3 0/4] sched: cleanup of sched library Dumitrescu, Cristian
2022-02-24 22:44     ` Thomas Monjalon

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=DM8PR11MB56703C823920FBDE67621C43EB379@DM8PR11MB5670.namprd11.prod.outlook.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=megha.ajmera@intel.com \
    --cc=thomas@monjalon.net \
    /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).