From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 79B835323 for ; Thu, 29 Jun 2017 19:04:07 +0200 (CEST) Received: by mail-pf0-f178.google.com with SMTP id e7so53523749pfk.0 for ; Thu, 29 Jun 2017 10:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C9ozcYu/XLg7yMoJItSJr4ADJMlqY7IgE+08kfpjNXQ=; b=BldOXK08+cd4KHp2yFu7FFYSLPTBFFlagKX1lgha76qOsCGgKQsObrUoJR3Llg47Ft w2sJBYO8OQTUUOt0vHPryfPZ6IxTbSjwe6pSLkjAR3JTvnYtOOCCrqJwmOnB0Anl5Mm6 DHq8uKI+aUe6gn2DgZ2jxOepoT9dZ7HVstuUYRM6VToXBuyA4uKVEWY7sXc00JzXoO6U jboK4PCSA0Daxah/B1oe3FrzPxTVXQw9wr1BGtciSkf3cu+5PykAC56+2ANMeuO0Jfqv c5DG5UtkoxaCXDpY3N5kGy0Chsh0TW/ffjeSGThV7lGHaVn6q4QlSj8I7DtDkoIa58jS Wk5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C9ozcYu/XLg7yMoJItSJr4ADJMlqY7IgE+08kfpjNXQ=; b=iAiBuGV3L8J7P/1WQhf7V+pkuVC0YIofm7qAfGKMZRuyk6+cOj0woK7snJ6lb8yGBY BbE7dUgxy/PGWhFgaK9UVJZUVI9PDB+ONNL/1oLxzw6UZPWX3v8OnUFvRvN9Ufyz6ycA YgiRouBGwSNg9lqCNoGG7iHl3J3Y8PowW3GrW2ObDnVnPglZLjXxch1jJeGLRYdxhU3k jNpB82Vy0ZhcaIWtKd+mGHHy8f+0LYixufrg92biI4PjFaccD+jXNquUKW6Eo4zevAoe WQEZkmko+0/lJknbZeAKlPCW3rPb0NYcr5qVmB4FJR60q+kWS7Iyel21NqCjDYdfgi0+ pijg== X-Gm-Message-State: AKS2vOzperevCVGhQqvQSlDR9vDhJ+zRyeBHrlxdqLXrIyPDbC8RMdip 1WQ2rgNnq2w7h5P13oGAQQ== X-Received: by 10.99.149.83 with SMTP id t19mr16231714pgn.247.1498755846663; Thu, 29 Jun 2017 10:04:06 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id d71sm14884664pfe.106.2017.06.29.10.04.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jun 2017 10:04:06 -0700 (PDT) Date: Thu, 29 Jun 2017 10:04:04 -0700 From: Stephen Hemminger To: Olivier Chirossel Cc: dev@dpdk.org Message-ID: <20170629100404.5fe3f5e6@xeon-e3> In-Reply-To: <1498746942-1741-2-git-send-email-olivier.chirossel@gmail.com> References: <1498746942-1741-1-git-send-email-olivier.chirossel@gmail.com> <1498746942-1741-2-git-send-email-olivier.chirossel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] lib/librte_sched: fix update tc_credits X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 17:04:07 -0000 On Thu, 29 Jun 2017 16:35:42 +0200 Olivier Chirossel 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.