[PATCHv2 2/6] virnetdevovs: Extract conversion parameters between virNetDevBandwidth and ovs

Michal Prívozník mprivozn at redhat.com
Thu Aug 19 14:50:50 UTC 2021


On 8/17/21 6:38 AM, jx8zjs wrote:
> From: Jinsheng Zhang <zhangjl02 at inspur.com>
> 
> Signed-off-by: zhangjl02 <zhangjl02 at inspur.com>
> ---
>  src/util/virnetdevopenvswitch.c | 12 +++++++-----
>  src/util/virnetdevopenvswitch.h |  7 +++++++
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 


> diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h
> index 2dcd1aec6b..33e52f57c7 100644
> --- a/src/util/virnetdevopenvswitch.h
> +++ b/src/util/virnetdevopenvswitch.h
> @@ -26,6 +26,13 @@
>  #include "virnetdevvlan.h"
>  
>  #define VIR_NETDEV_OVS_DEFAULT_TIMEOUT 5
> +/*
> + * Average, peak, floor and burst in virNetDevBandwidth are in kbytes.
> + * However other_config in ovs qos is in bit.
> + * ingress_policing_rate in ovs interface is in kbit.
> + */
> +#define VIR_NETDEV_TX_TO_OVS 8192
> +#define VIR_NETDEV_RX_TO_OVS 8
>  
>  void virNetDevOpenvswitchSetTimeout(unsigned int timeout);
>  
> 

These macros seem to be used only from corresponding .c file. I think
they can be defined there. That way we can avoid polluting header files.

Michal




More information about the libvir-list mailing list