[ovs-dev] meter stats cleared when modify meter bands

Ilya Maximets i.maximets at ovn.org
Mon Aug 2 13:41:25 UTC 2021


> I know  that in latest ovs versions, both kernel datapath and dpdk userspace datapath supports meter action.
> what I want to know is why we need to clear stats when modify meter bands? are there any considerations?
> I think it is easily to keep meter stats when only modify meter bands.

Hi.  I looked at the OFPMC_MODIFY definition in the OpenFlow specification
and I see the following for the OpenFlow 1.3 and 1.4:

"For modify requests (OFPMC_MODIFY), if a meter entry with the specified
meter identifier already exists, then that entry, including its bands, must
be removed, and the new meter entry added."

I think, this matches with the current implementation.  So, the meter is
completely removed and the new one added, hence no statistics is preserved.

What you're looking for seems to be defined in the OpenFlow 1.5:

"For modify requests (OFPMC_MODIFY), if a meter entry with the specified
meter identifier already exists, then the configuration of that meter entry,
including its flags and bands, must be removed (cleared), and the meter entry
must use the new configuration included in the request. For that entry, meter
top-level statistics are preserved (continued), meter band statistics are
reset (cleared)."

So, for OpenFlow 1.5 the top-level statistics should be preserved.
However, I don't think that OVS currently implements that.  It looks like
OVS always implements meters as OF13 meters, which is a bug(?).  In order to
support OF15 behavior we'll need to correctly implement it on all levels
starting form the distinguishing the OF version of the particular OFPMC_MODIFY
message and instruct the datapath to behave differently based on that.
The behavior for OF 1.3 and 1.4 should stay as it is now.

Maybe Ben or Jean can correct me if my understanding is not correct here.

Best regards, Ilya Maximets.

> 
> 
> At 2021-07-28 13:46:21, "Tonghao Zhang" <xiangxia.m.yue at gmail.com> wrote:
>>On Wed, Jul 28, 2021 at 10:57 AM ychen <ychen103103 at 163.com> wrote:
>>>
>>> Hi, all:
>>>     I have a question why meter stats need  cleared when just modify meter bands?
>>>     when call function handle_modify_meter(), it finally call function dpif_netdev_meter_set(), in this function new dp_meter will be allocated and attched, hence stats will be cleared.
>>>    if we just update dp_meter bands configuration, so the stats will be keeped when meter modify.
>>>    Is there any consideration about this meter modify action?
>>The commit 80738e5f93a70 supports the meter for kernel datapath.
>>and even though kernel modules support to set stats, but userspace
>>doesn't set them.
>>https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=96fbc13d7e770b542d2d1fcf700d0baadc6e8063
>>
>>If needed, we can support this.
>>
>>> _______________________________________________
>>> dev mailing list
>>> dev at openvswitch.org
>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>>
>>
>>-- 
>>Best regards, Tonghao



More information about the dev mailing list