Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1769497pxy; Thu, 29 Apr 2021 14:16:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVj6atgUiKUPdo3M5j8saBSwRnHdKn+aFwb0MEcxxiF5ngisl2ZNN3ZHukRfuJ7FzvdxkR X-Received: by 2002:a17:906:f2d9:: with SMTP id gz25mr554107ejb.260.1619730991681; Thu, 29 Apr 2021 14:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619730991; cv=none; d=google.com; s=arc-20160816; b=s9gFMdGIzCaBo3KisD0c7am8G6hQqGfEvF4QtyyCbkUAmEF1p/yj7zYseVv72VzFU2 TepTpI8/YIjYbWucqzLUTXDYaKUCVCh+shcC7v6yoiaRZRJ+3u8vw9vIAHoDL+IHtb1w /cqp9iBqhRD01H7C0KGi1DX7zDPDNv1LhE9nqJlZUBX2Ipq6LcxMS1vtRt0m1cgCTE8Y 9CvDCPDoenffXs11D56Px9hkveHw9Fbygi+AL28iSgn+BLWCh0JsDfvGzdl6s5QLwGrj cod1W5oWVdH5NPGkAv+Kaf4ANyuy8eRl4r8whBMNq0NVgrrWpd0pF2CBiFnjPTpv5M0U 7AZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=QGDO4wRjgVl1pP0GLmtYxuuOM/9xrR+ep7vYsq3jZrQ=; b=FURIZ5hx8f1hwL8eN5bcP5qbAxmtJlv6hSOuLrevz3nJEC8HDs8CG2cIOr/P3D2Ja3 33MJW3otm5Uahv38KVNsSidy9pxnWNCwc/s/lDExBE66yUHGsvRQeox7FmCQv3g/8KwK cl3xYmx5r49UeUdl6eb+TwjpNmn8abQ3O0lkf1ABi4LJQG5mcPs8tBUbogRe+DpxHWm2 CfUvQIv8zBXEXoNKOPcIvPKL1R9rZ6WdOW6GnacLxnBPa+GIxJxW58vq/lGNZGbWzGWP PcA+G1dfB8mFY6U+SQLkJhhUfB07E+Hz4IvpJHxJVKm2SDotY+t41edlYl8fvDQDA+ZZ JKgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si4109235edx.492.2021.04.29.14.16.06; Thu, 29 Apr 2021 14:16:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233348AbhD2VP6 (ORCPT + 99 others); Thu, 29 Apr 2021 17:15:58 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:53573 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232246AbhD2VP5 (ORCPT ); Thu, 29 Apr 2021 17:15:57 -0400 Received: from [192.168.1.23] (ip-78-45-89-65.net.upcbroadband.cz [78.45.89.65]) (Authenticated sender: i.maximets@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id BABC3240007; Thu, 29 Apr 2021 21:15:06 +0000 (UTC) Subject: Re: [PATCH net] openvswitch: meter: remove rate from the bucket size calculation To: Ilya Maximets , jean.tourrilhes@hpe.com Cc: Tonghao Zhang , Pravin B Shelar , "David S. Miller" , Jakub Kicinski , Andy Zhou , Linux Kernel Network Developers , LKML , ovs dev , William Tu , Cong Wang , Davide Caratti References: <20210421135747.312095-1-i.maximets@ovn.org> <20210428064553.GA19023@labs.hpe.com> <04bd0073-6eb7-6747-a0b1-3c25cca7873a@ovn.org> <20210428163124.GA28950@labs.hpe.com> <22e48984-e0f3-b7d7-9f65-68e93c846c73@ovn.org> From: Ilya Maximets Message-ID: <94576ef8-76b3-67bc-7b55-c1d9513ec31c@ovn.org> Date: Thu, 29 Apr 2021 23:15:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <22e48984-e0f3-b7d7-9f65-68e93c846c73@ovn.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/28/21 8:59 PM, Ilya Maximets wrote: > On 4/28/21 6:31 PM, Jean Tourrilhes wrote: >> On Wed, Apr 28, 2021 at 01:22:12PM +0200, Ilya Maximets wrote: >>> >>> I didn't test it, but I looked at the implementation in >>> net/sched/act_police.c and net/sched/sch_tbf.c, and they should work >>> in a same way as this patch, i.e. it's a classic token bucket where >>> burst is a burst and nothing else. >> >> Actually, act_police.c and sch_tbf.c will behave completely >> differently, even if they are both based on the token bucket >> algorithm. >> The reason is that sch_tbf.c is applied to a queue, and the >> queue will smooth out traffic and avoid drops. The token bucket is >> used to dequeue the queue, this is sometime called leaky bucket. I've >> personally used sch_tbf.c with burst size barely bigger than the MTU, >> and it works fine. > > Makes sense. Thanks for the clarification! > >> This is why I was suggesting to compare to act_police.c, which >> does not have a queue to smooth out traffic and can only drop >> packets. > > I see. Unfortunately, due to the fact that act_police.c uses time > instead of bytes as a measure for tokens, we will still see a difference > in behavior. Probably, not so big, but it will be there and it will > depend on a line rate. I found my mistake in calculations (see another reply). So, there should not be significant difference with OVS meters, indeed. > >> I believe OVS meters are similar to policers, so that's why >> they are suprising for people used to queues such as TBF and HTB. >> >> Regards, >> >> Jean >>