mbox series

[ovs-dev,v4,0/7] Improve linux QoS for exotic and fast links

Message ID 20230717080836.1456756-1-amorenoz@redhat.com
Headers show
Series Improve linux QoS for exotic and fast links | expand

Message

Adrian Moreno July 17, 2023, 8:08 a.m. UTC
There are currently two issues that limit our ability to configure QoS
on certain cards in linux:

1) Firstly, the maximum link speed (which is used as maximum rate in
some tc classes), is obtained from netdev feature bits.
This is quite problematic because netdev feature bits do not keep up
with the new feature bits being added to ethtool. Therefore, cards whose
speed is not supported by OpenFlow currently report an incorrect speed
and this can affect QoS configuration.

This series addresses this problem by adding a new netdev function that
gets the actual link speed so we don't rely on feature bits which are
difficult to keep in sync.

2) The tc layer uses 32bit Bps rates which means we cannot express rates
higher than ~34Gbps.

This series addresses this problem using 64-bit tc attributes when
needed.

---
v3 -> v4
- Fallback to netdev_get_features if netdev_get_speed is not
  implemented.

v2 -> v3
- Move some (non htb-related) from patch 4 to patch 3.
- Add a checkpatch.py warning if the old netdev_features_to_bps API is
  used.
- Change unit tests to avoid burst integer overflow.
- Use netdev_get_speed() instead of accessing current_speed directly in
  {hfsc,htb}parse_qdisc_details__() (patch 2).

v1 -> v2
- Fix style issues.
- Add a test that checks we can expose a 50Gbps speed using a tap
  interface.
- Add an implementation of get_speed for netdev-bsd.
- Expose both HAVE_TCA_HTB_RATE64 and HAVE_TCA_POLICE_PKTRATE64 as AC
  variables and skip tests if the running kernel does not support them.

Adrian Moreno (7):
  netdev: add netdev_get_speed() to nedev API
  netdev-linux: use speed as max rate in tc classes
  netdev-linux: use 64bit rtab and burst calculations
  netdev-linux: use 64-bit rates in htb tc classes
  netdev-linux: remove tc_matchall_fill_police
  netdev-linux: refactor nl_msg_put_act_police
  netdev-linux: support 64-bit rates in tc policing

 acinclude.m4                 |  20 ++++
 include/openvswitch/netdev.h |   1 +
 lib/dpif.h                   |   4 +-
 lib/netdev-bsd.c             |  22 ++++
 lib/netdev-dpdk.c            |  52 +++++++++
 lib/netdev-linux-private.h   |   1 +
 lib/netdev-linux.c           | 221 ++++++++++++++++++++---------------
 lib/netdev-linux.h           |   2 +-
 lib/netdev-provider.h        |   9 ++
 lib/netdev.c                 |  30 +++++
 lib/tc.c                     |   2 +
 ofproto/ofproto-dpif-sflow.c |  11 +-
 ofproto/ofproto.c            |   6 +-
 tests/atlocal.in             |   5 +
 tests/system-interface.at    |  30 +++++
 tests/system-traffic.at      |  49 ++++++++
 utilities/checkpatch.py      |  11 +-
 vswitchd/bridge.c            |  30 +++--
 18 files changed, 393 insertions(+), 113 deletions(-)

Comments

Ilya Maximets July 17, 2023, 6:11 p.m. UTC | #1
On 7/17/23 10:08, Adrian Moreno wrote:
> There are currently two issues that limit our ability to configure QoS
> on certain cards in linux:
> 
> 1) Firstly, the maximum link speed (which is used as maximum rate in
> some tc classes), is obtained from netdev feature bits.
> This is quite problematic because netdev feature bits do not keep up
> with the new feature bits being added to ethtool. Therefore, cards whose
> speed is not supported by OpenFlow currently report an incorrect speed
> and this can affect QoS configuration.
> 
> This series addresses this problem by adding a new netdev function that
> gets the actual link speed so we don't rely on feature bits which are
> difficult to keep in sync.
> 
> 2) The tc layer uses 32bit Bps rates which means we cannot express rates
> higher than ~34Gbps.
> 
> This series addresses this problem using 64-bit tc attributes when
> needed.
> 
> ---
> v3 -> v4
> - Fallback to netdev_get_features if netdev_get_speed is not
>   implemented.
> 
> v2 -> v3
> - Move some (non htb-related) from patch 4 to patch 3.
> - Add a checkpatch.py warning if the old netdev_features_to_bps API is
>   used.
> - Change unit tests to avoid burst integer overflow.
> - Use netdev_get_speed() instead of accessing current_speed directly in
>   {hfsc,htb}parse_qdisc_details__() (patch 2).
> 
> v1 -> v2
> - Fix style issues.
> - Add a test that checks we can expose a 50Gbps speed using a tap
>   interface.
> - Add an implementation of get_speed for netdev-bsd.
> - Expose both HAVE_TCA_HTB_RATE64 and HAVE_TCA_POLICE_PKTRATE64 as AC
>   variables and skip tests if the running kernel does not support them.
> 
> Adrian Moreno (7):
>   netdev: add netdev_get_speed() to nedev API
>   netdev-linux: use speed as max rate in tc classes
>   netdev-linux: use 64bit rtab and burst calculations
>   netdev-linux: use 64-bit rates in htb tc classes
>   netdev-linux: remove tc_matchall_fill_police
>   netdev-linux: refactor nl_msg_put_act_police
>   netdev-linux: support 64-bit rates in tc policing
> 
>  acinclude.m4                 |  20 ++++
>  include/openvswitch/netdev.h |   1 +
>  lib/dpif.h                   |   4 +-
>  lib/netdev-bsd.c             |  22 ++++
>  lib/netdev-dpdk.c            |  52 +++++++++
>  lib/netdev-linux-private.h   |   1 +
>  lib/netdev-linux.c           | 221 ++++++++++++++++++++---------------
>  lib/netdev-linux.h           |   2 +-
>  lib/netdev-provider.h        |   9 ++
>  lib/netdev.c                 |  30 +++++
>  lib/tc.c                     |   2 +
>  ofproto/ofproto-dpif-sflow.c |  11 +-
>  ofproto/ofproto.c            |   6 +-
>  tests/atlocal.in             |   5 +
>  tests/system-interface.at    |  30 +++++
>  tests/system-traffic.at      |  49 ++++++++
>  utilities/checkpatch.py      |  11 +-
>  vswitchd/bridge.c            |  30 +++--
>  18 files changed, 393 insertions(+), 113 deletions(-)
> 

Thanks, Adrian, Eelco and Simon!

I fixed a few typos and style issues throughout the set and added
a couple of NEWS entries.  With that, applied.

Best regards, Ilya Maximets.