netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jean.tourrilhes@hpe.com>
To: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Cc: Ilya Maximets <i.maximets@ovn.org>,
	Pravin B Shelar <pshelar@ovn.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Andy Zhou <azhou@ovn.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	ovs dev <dev@openvswitch.org>, William Tu <u9012063@gmail.com>
Subject: Re: [PATCH net] openvswitch: meter: remove rate from the bucket size calculation
Date: Tue, 27 Apr 2021 23:45:53 -0700	[thread overview]
Message-ID: <20210428064553.GA19023@labs.hpe.com> (raw)
In-Reply-To: <CAMDZJNVQ64NEhdfu3Z_EtnVkA2D1DshPzfur2541wA+jZgX+9Q@mail.gmail.com>

On Wed, Apr 28, 2021 at 02:24:10PM +0800, Tonghao Zhang wrote:
> Hi Ilya
> If we set the burst size too small, the meters of ovs don't work.

	Most likely, you need to set the burst size larger.
	A quick Google on finding a good burst size :
https://www.juniper.net/documentation/us/en/software/junos/routing-policy/topics/concept/policer-mx-m120-m320-burstsize-determining.html

	Now, the interesting question, is the behaviour of OVS
different from a standard token bucket, such as a kernel policer ?
	Here is how to set up a kernel policer :
----------------------------------------------------------
# Create a dummy classful discipline to attach filter
tc qdisc del dev eth6 root
tc qdisc add dev eth6 root handle 1: prio bands 2 priomap  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
tc qdisc add dev eth6 parent 1:1 handle 10: pfifo limit 1000
tc qdisc add dev eth6 parent 1:2 handle 20: pfifo limit 1000
tc -s qdisc show dev eth6
tc -s class show dev eth6

# Filter to do hard rate limiting
tc filter del dev eth6 parent 1: protocol all prio 1 handle 800::100 u32 
tc filter add dev eth6 parent 1: protocol all prio 1 handle 800::100 u32 match u32 0 0 police rate 200mbit burst 20K mtu 10000 drop
tc -s filter show dev eth6
tc filter change dev eth6 parent 1: protocol all prio 1 handle 800::100 u32 match u32 0 0 police rate 200mbit burst 50K mtu 10000 drop
----------------------------------------------------------

	Regards,

	Jean

  reply	other threads:[~2021-04-28  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 13:57 [PATCH net] openvswitch: meter: remove rate from the bucket size calculation Ilya Maximets
2021-04-23 20:10 ` patchwork-bot+netdevbpf
2021-04-28  6:24 ` Tonghao Zhang
2021-04-28  6:45   ` Jean Tourrilhes [this message]
2021-04-28 11:22     ` Ilya Maximets
2021-04-28 16:31       ` Jean Tourrilhes
2021-04-28 18:59         ` Ilya Maximets
2021-04-29 21:15           ` Ilya Maximets
2021-04-29 21:12       ` Ilya Maximets

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=20210428064553.GA19023@labs.hpe.com \
    --to=jean.tourrilhes@hpe.com \
    --cc=azhou@ovn.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=i.maximets@ovn.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.org \
    --cc=u9012063@gmail.com \
    --cc=xiangxia.m.yue@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 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).