From patchwork Thu Apr 30 11:00:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1280184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=J2Ml7SVx; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49CXWT1L5bz9sSM for ; Thu, 30 Apr 2020 21:01:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 10AEB25043; Thu, 30 Apr 2020 11:01:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UvHIu4cZuX2J; Thu, 30 Apr 2020 11:01:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 960BC24D41; Thu, 30 Apr 2020 11:01:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 82FA1C0864; Thu, 30 Apr 2020 11:01:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id EA86EC016F for ; Thu, 30 Apr 2020 11:01:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D9DF287E64 for ; Thu, 30 Apr 2020 11:01:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5D4-xHlikKse for ; Thu, 30 Apr 2020 11:01:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8750087E30 for ; Thu, 30 Apr 2020 11:01:22 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id x26so2577199pgc.10 for ; Thu, 30 Apr 2020 04:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/BbMwM6DoDMIHIyANT2lEA7iJvuivGDVRMxIIZhoKs8=; b=J2Ml7SVx+Rr7wAFB4RMu68e7aLyvpwi/dhmRFTOeDXIMe4j3dnU5VOR3Wd6T3BDI0N wDlt1/RGf2js6OpW2LK0WsK+ql3z0wdpjJOX0Ggz936q+MwzcQ3NuhG7Ges13uCqC4En Ka9oaYjdlp0p4CCgl7LnVzjaR0VrYvC6pb2kFcVd7JdkynL20PyINaSQ71tQe6ytGApD t4FJ+b7f56LAtj5IZ4VBozDvJoq2ubhP+Fg/9oXDeFiT5iaiDZwHIqjvNDkVXamd7keO zAdyjQLCZ7uu61U1oa/QJm/nBsP1eaxES+rRXpsCRN+y8Gmz0YTV1vIzHjYha07H49MB YELg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/BbMwM6DoDMIHIyANT2lEA7iJvuivGDVRMxIIZhoKs8=; b=HQlbePdGPxxnp1PxjDqvwEcJW7QkKQJ4WNbMMNDjLpwkBEFLF4BgAFlFYf/dW2QxXZ a0l9xr5Yu+AJJFfcJcTfM2kZnJHzF+NVFNF58XIzShNc/y1rqqan7ypsMW9sB67OQJuA D9+LQvig1ZDnl73hSkmLNQ3Tu+jaLgck3YAs0hdTe44rA2229VxkQEAj9ZTvdxeuFEkG YauuJwbJ1rL648COFpXEE0lhWwtf9A++T4P11hNIPs6ktwqi40+NlAkXoPJaZ2YXEz0n KbvrnEut9FcIUwSUhnj65TOwVEek+EbOCu8BE0V30a91jvax+3dMW1mQNXVMygAg/a2Y CW9Q== X-Gm-Message-State: AGi0Pubd34YbLl1A9B44WabHZ/u3XNgyS7eHGHHjHm0eomzAu0JMZftM ZglriM9a8FXsi5E9vNb4Wpw= X-Google-Smtp-Source: APiQypJh56Td40x+uG1lQUB6jdPbwQxCOQJTUn17BDMTwwBrmdsc/O9FQ1c2fLw14rkN5GSLjGK+UA== X-Received: by 2002:a63:6e81:: with SMTP id j123mr2870890pgc.333.1588244482223; Thu, 30 Apr 2020 04:01:22 -0700 (PDT) Received: from local.opencloud.tech.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id 7sm3032725pga.15.2020.04.30.04.01.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2020 04:01:21 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: i.maximets@ovn.org, blp@ovn.org, azhou@ovn.org, u9012063@gmail.com, jarno@ovn.org Date: Thu, 30 Apr 2020 19:00:37 +0800 Message-Id: <1588244439-58766-3-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1588244439-58766-1-git-send-email-xiangxia.m.yue@gmail.com> References: <1584180230-89020-1-git-send-email-xiangxia.m.yue@gmail.com> <1588244439-58766-1-git-send-email-xiangxia.m.yue@gmail.com> Cc: dev@openvswitch.org Subject: [ovs-dev] [PATCH OVS 2/4] dpif-netdev: Add burst size to buckets X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to buckets. This patch includes it now. Cc: Ilya Maximets Cc: William Tu Cc: Jarno Rajahalme Cc: Ben Pfaff Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 17c0241aa2e2..59546db6a2a2 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -6092,15 +6092,10 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, for (i = 0; i < config->n_bands; ++i) { uint32_t band_max_delta_t; - /* Set burst size to a workable value if none specified. */ - if (config->bands[i].burst_size == 0) { - config->bands[i].burst_size = config->bands[i].rate; - } - meter->bands[i].up = config->bands[i]; /* Convert burst size to the bucket units: */ /* pkts => 1/1000 packets, kilobits => bits. */ - meter->bands[i].up.burst_size *= 1000; + meter->bands[i].up.burst_size += config->bands[i].rate * 1000ULL; /* Initialize bucket to empty. */ meter->bands[i].bucket = 0;