From: Stephen Hemminger <stephen@networkplumber.org>
To: Olivier Chirossel <olivier.chirossel@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2] lib/librte_sched: fix update tc_credits
Date: Thu, 29 Jun 2017 10:04:04 -0700 [thread overview]
Message-ID: <20170629100404.5fe3f5e6@xeon-e3> (raw)
In-Reply-To: <1498746942-1741-2-git-send-email-olivier.chirossel@gmail.com>
On Thu, 29 Jun 2017 16:35:42 +0200
Olivier Chirossel <olivier.chirossel@gmail.com> wrote:
> /* Subport TCs */
> if (unlikely(port->time >= subport->tc_time)) {
> - subport->tc_credits[0] = subport->tc_credits_per_period[0];
> - subport->tc_credits[1] = subport->tc_credits_per_period[1];
> - subport->tc_credits[2] = subport->tc_credits_per_period[2];
> - subport->tc_credits[3] = subport->tc_credits_per_period[3];
> + for (j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {
> + if ((subport->tc_credits[j] + subport->tc_credits_per_period[j]) < subport->tc_rate[j]) {
> + subport->tc_credits[j] += subport->tc_credits_per_period[j];
> + }
> + else {
> + subport->tc_credits[j] = subport->tc_rate[j];
> + }
> + }
The loop was manually unrolled for speed.
prev parent reply other threads:[~2017-06-29 17:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 14:35 [PATCH v2] lib/librte_sched: fix update tc_credits Olivier Chirossel
2017-06-29 14:35 ` Olivier Chirossel
2017-06-29 17:04 ` Stephen Hemminger [this message]
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=20170629100404.5fe3f5e6@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=olivier.chirossel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.