[ovs-git] [openvswitch/ovs] 759aaa: dpif-netdev: Fix the meter buckets overflow.

Ilya Maximets noreply at github.com
Tue Mar 30 20:50:59 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 759aaa8513093ef768ab9ffe1a7cce0e0fa4a409
      https://github.com/openvswitch/ovs/commit/759aaa8513093ef768ab9ffe1a7cce0e0fa4a409
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2021-03-30 (Tue, 30 Mar 2021)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Fix the meter buckets overflow.

When setting the meter rate to 4.3+Gbps, there is an overflow, the
meters don't work as expected.

$ ovs-ofctl -O OpenFlow13 add-meter br-int "meter=1 kbps stats bands=type=drop rate=4294968"

It was overflow when we set the rate to 4294968, because "burst_size" in
the ofputil_meter_band is uint32_t type. This patch remove the "up"
in the dp_meter_band struction, and introduce "rate", "burst_size" and
"bucket" (uint64_t) to userspace datapath's meter band. This patch don't
change the public API and structure.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: c3690ccbce3e6ac009ff7695099fdd47705145db
      https://github.com/openvswitch/ovs/commit/c3690ccbce3e6ac009ff7695099fdd47705145db
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2021-03-30 (Tue, 30 Mar 2021)

  Changed paths:
    M lib/dpif-netdev.c
    M tests/dpif-netdev.at
    M tests/ofproto-dpif.at

  Log Message:
  -----------
  dpif-netdev: Refactor and fix the buckets calculation.

The way that "burst_size" was used as total buckets is
very strange. If user set the "burst_size" too smaller while
"rate" larger, that may affect the meter normal work.
This patch refactor the buckets calculation, and start
with a full buckets. It also makes the calculation equal
to what kernel datapath does.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 9801d7c4b8e71df56c439c06f8bab8b74cab5248
      https://github.com/openvswitch/ovs/commit/9801d7c4b8e71df56c439c06f8bab8b74cab5248
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-03-30 (Tue, 30 Mar 2021)

  Changed paths:
    M .ci/linux-prepare.sh
    M .github/workflows/build-and-test.yml

  Log Message:
  -----------
  github: Fix handling of python packages.

GitHub Actions doesn't have python locations in PATH and different
runners might have different configuration for default python
location and versions.  For example, on some runners python2 might
be installed or not.

Missing PATH causes weird situations on older branches where during
one run our scripts can locate just installed flake8 and can't do
that on a different run.  But this might also create other
unpredictable issues on all branches.

It's required to use actions/setup-python at v2 in order to have
predictable version of python installed and paths correctly configured.
Due to some bugs in GHA itself it doesn't set $HOME/.local/bin into
PATH, so we have to do that manually for now in order to use '--user'.
This might be fixed later in actions/setup-python or in base runners.
We already setting it for DPDK 20.11 (I think the issue was spotted
but not fully investigated).  Moving PATH updates to a separate step
to make them more explicit and available for all steps of the job.

Unfortunately actions/setup-python at v2 also makes invisible python
packages installed from Ubuntu repositories.  Switching them to
'pip3 install'.

Fixes: 6cb2f5a630e3 ("github: Add GitHub Actions workflow.")
Reported-by: Numan Siddique <numans at ovn.org>
Acked-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/af0ce3866658...9801d7c4b8e7


More information about the git mailing list