[PATCHv2 0/4] Add qemu support setting qos via ovs on ovs interface

zhangjl02 posted 4 patches 2 years, 10 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210701084206.621-1-jx8zjs@126.com
There is a newer version of this series
src/conf/domain_conf.c          |   8 +
src/conf/domain_conf.h          |   2 +
src/libvirt_private.syms        |   3 +
src/qemu/qemu_command.c         |  10 +-
src/qemu/qemu_domain.c          |   3 +-
src/qemu/qemu_driver.c          |  22 ++-
src/qemu/qemu_hotplug.c         |  39 +++--
src/qemu/qemu_process.c         |  10 +-
src/util/virnetdevopenvswitch.c | 271 ++++++++++++++++++++++++++++++++
src/util/virnetdevopenvswitch.h |  11 ++
10 files changed, 362 insertions(+), 17 deletions(-)
[PATCHv2 0/4] Add qemu support setting qos via ovs on ovs interface
Posted by zhangjl02 2 years, 10 months ago
---

diff to v1:
  - move qemuDomainDefIsOvsport from src/qemu/qemu_domain.c to
  src/conf/domain_conf.c
  - call virCommandFree(cmd)free cmd before reusing it.
  - add g_autofree to variables.
  - reduce usage of virReportError(), and coupled it with return -1. 
  - fix remove port qos error.
  - optimise code structure.

Thanks to Michal Privoznik for helping reviewing these patches.


Now libvirt use tc rules to manage interface's qos. But when an interface
is created by ovs, there is no qos setting result in ovs database. Therefore,
qos of ovs port should be set via ovs management command. 
We add a function to tell whether a port definition is an ovs managed virtual
port. Change default qdisc rules, which return 0 directly if the port is ovs 
managed(When the ovs port is set noqueue, qos config on this port will not 
work). Add ovs management function of setting and cleaning qos. Then check if
the port is an ovs managed port during its life cycle, and call the ovs 
management function to set or clean qos settings.

zhangjl02 (4):
  virDomain: interface: add virDomainNetDefIsOvsport
  virDomain: interface: add virNetDevOpenvswitchInterfaceSetQos and
    virNetDevOpenvswitchInterfaceClearQos
  qemu: interface: remove setting noqueue for ovs port
  qemu: interface: check and use ovs command to set qos of ovs managed
    port

 src/conf/domain_conf.c          |   8 +
 src/conf/domain_conf.h          |   2 +
 src/libvirt_private.syms        |   3 +
 src/qemu/qemu_command.c         |  10 +-
 src/qemu/qemu_domain.c          |   3 +-
 src/qemu/qemu_driver.c          |  22 ++-
 src/qemu/qemu_hotplug.c         |  39 +++--
 src/qemu/qemu_process.c         |  10 +-
 src/util/virnetdevopenvswitch.c | 271 ++++++++++++++++++++++++++++++++
 src/util/virnetdevopenvswitch.h |  11 ++
 10 files changed, 362 insertions(+), 17 deletions(-)

-- 
2.30.2.windows.1

Re: [PATCHv2 0/4] Add qemu support setting qos via ovs on ovs interface
Posted by Michal Prívozník 2 years, 10 months ago
On 7/1/21 10:42 AM, zhangjl02 wrote:
> ---
> 
> diff to v1:
>   - move qemuDomainDefIsOvsport from src/qemu/qemu_domain.c to
>   src/conf/domain_conf.c

You can also post a follow up patch that replaces check from the
function with the function call :-) I mean, we have couple of places
that do look exactly as the function body.

>   - call virCommandFree(cmd)free cmd before reusing it.
>   - add g_autofree to variables.
>   - reduce usage of virReportError(), and coupled it with return -1. 
>   - fix remove port qos error.
>   - optimise code structure.
> 
> Thanks to Michal Privoznik for helping reviewing these patches.
> 
> 
> Now libvirt use tc rules to manage interface's qos. But when an interface
> is created by ovs, there is no qos setting result in ovs database. Therefore,
> qos of ovs port should be set via ovs management command. 
> We add a function to tell whether a port definition is an ovs managed virtual
> port. Change default qdisc rules, which return 0 directly if the port is ovs 
> managed(When the ovs port is set noqueue, qos config on this port will not 
> work). Add ovs management function of setting and cleaning qos. Then check if
> the port is an ovs managed port during its life cycle, and call the ovs 
> management function to set or clean qos settings.
> 
> zhangjl02 (4):
>   virDomain: interface: add virDomainNetDefIsOvsport
>   virDomain: interface: add virNetDevOpenvswitchInterfaceSetQos and
>     virNetDevOpenvswitchInterfaceClearQos
>   qemu: interface: remove setting noqueue for ovs port
>   qemu: interface: check and use ovs command to set qos of ovs managed
>     port
> 
>  src/conf/domain_conf.c          |   8 +
>  src/conf/domain_conf.h          |   2 +
>  src/libvirt_private.syms        |   3 +
>  src/qemu/qemu_command.c         |  10 +-
>  src/qemu/qemu_domain.c          |   3 +-
>  src/qemu/qemu_driver.c          |  22 ++-
>  src/qemu/qemu_hotplug.c         |  39 +++--
>  src/qemu/qemu_process.c         |  10 +-
>  src/util/virnetdevopenvswitch.c | 271 ++++++++++++++++++++++++++++++++
>  src/util/virnetdevopenvswitch.h |  11 ++
>  10 files changed, 362 insertions(+), 17 deletions(-)
> 

I've suggested what should be squashed in for each patch. Please let me
know if you agree and if so I'll squash it and merge.

Michal