From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Danilewicz, MarcinX" <marcinx.danilewicz@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Singh, Jasvinder" <jasvinder.singh@intel.com>
Cc: "Ajmera, Megha" <megha.ajmera@intel.com>,
"Liu, Yu Y" <yu.y.liu@intel.com>
Subject: RE: [PATCH v6] sched: enable traffic class oversubscription conditionally
Date: Mon, 30 May 2022 10:54:14 +0000 [thread overview]
Message-ID: <DM8PR11MB56702CD30F05A408594DA268EBDD9@DM8PR11MB5670.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220530084520.827724-1-marcinx.danilewicz@intel.com>
Hi Marcin,
Comments inline below.
<snip>
> @@ -2403,8 +2481,16 @@ grinder_schedule(struct rte_sched_port *port,
> uint32_t pkt_len = pkt->pkt_len + port->frame_overhead;
> uint32_t be_tc_active;
>
> - if (!grinder_credits_check(port, subport, pos))
> - return 0;
> + switch (subport->tc_ov_enabled) {
> + case 1:
> + if (!grinder_credits_check_with_tc_ov(port, subport, pos))
> + return 0;
> + break;
> + case 0:
> + if (!grinder_credits_check(port, subport, pos))
> + return 0;
> + break;
> + }
>
Using a switch statement for a binary condition instead of if-else does not make sense to me. I know you mention you saw better performance with the switch, but I am pretty sure it is not the switch providing the performance increase. You are using if-else for testing the new subport->tc_ov_enabled throughout the code (an example is just below in your patch), so I suggest you do the same here:
if (subport->tc_ov_enabled) {
if (!grinder_credits_check_with_tc_ov(port, subport, pos))
return 0;
} else {
if (!grinder_credits_check(port, subport, pos))
return 0;
}
> /* Advance port time */
> port->time += pkt_len;
> @@ -2770,7 +2856,11 @@ grinder_handle(struct rte_sched_port *port,
> subport->profile;
>
> grinder_prefetch_tc_queue_arrays(subport, pos);
> - grinder_credits_update(port, subport, pos);
> +
> + if (subport->tc_ov_enabled)
> + grinder_credits_update_with_tc_ov(port, subport,
> pos);
> + else
> + grinder_credits_update(port, subport, pos);
>
> grinder->state = e_GRINDER_PREFETCH_MBUF;
> return 0;
> --
> 2.25.1
Regards,
Cristian
next prev parent reply other threads:[~2022-05-30 10:54 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 14:51 [dpdk][PATCH 1/2] sched: enable/disable TC OV at runtime Marcin Danilewicz
2022-04-07 14:51 ` [dpdk][PATCH 2/2] sched: fix to manage " Marcin Danilewicz
2022-04-14 9:53 ` Thomas Monjalon
2022-04-27 9:23 ` [PATCH v3] sched: enable/disable " Marcin Danilewicz
2022-04-27 15:48 ` Singh, Jasvinder
2022-05-09 20:05 ` Dumitrescu, Cristian
2022-05-10 6:40 ` Ajmera, Megha
2022-05-10 9:09 ` Dumitrescu, Cristian
2022-05-24 13:33 ` Marcin Danilewicz
2022-05-24 14:52 ` Stephen Hemminger
2022-05-26 23:12 ` Danilewicz, MarcinX
2022-05-24 13:38 ` [PATCH v4] sched: enable traffic class oversubscription conditionally Marcin Danilewicz
2022-05-24 13:43 ` Marcin Danilewicz
2022-05-24 14:30 ` Dumitrescu, Cristian
2022-05-25 14:18 ` Danilewicz, MarcinX
2022-05-27 0:09 ` Danilewicz, MarcinX
2022-05-27 0:09 ` [PATCH v5] " Marcin Danilewicz
2022-05-30 8:45 ` [PATCH v6] " Marcin Danilewicz
2022-05-30 10:35 ` Dumitrescu, Cristian
2022-05-30 11:59 ` Danilewicz, MarcinX
2022-05-30 10:54 ` Dumitrescu, Cristian [this message]
2022-05-30 12:02 ` Danilewicz, MarcinX
2022-05-30 10:58 ` Dumitrescu, Cristian
2022-05-30 12:04 ` Danilewicz, MarcinX
2022-05-30 11:55 ` [PATCH v7] " Marcin Danilewicz
2022-05-30 12:14 ` Dumitrescu, Cristian
2022-05-30 13:34 ` Danilewicz, MarcinX
2022-05-30 13:55 ` Dumitrescu, Cristian
2022-05-30 14:05 ` Danilewicz, MarcinX
2022-05-30 13:38 ` [PATCH v8] " Marcin Danilewicz
2022-05-30 18:47 ` [PATCH v9] " Marcin Danilewicz
2022-05-30 21:13 ` Dumitrescu, Cristian
2022-05-31 9:49 ` [PATCH v10] " Marcin Danilewicz
2022-05-31 13:09 ` Dumitrescu, Cristian
2022-05-31 16:42 ` Thomas Monjalon
2022-05-31 18:45 ` Danilewicz, MarcinX
2022-04-08 12:50 ` [dpdk][PATCH 1/2] sched: enable/disable TC OV at runtime Singh, Jasvinder
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=DM8PR11MB56702CD30F05A408594DA268EBDD9@DM8PR11MB5670.namprd11.prod.outlook.com \
--to=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
--cc=marcinx.danilewicz@intel.com \
--cc=megha.ajmera@intel.com \
--cc=yu.y.liu@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).