Re: [ovs-discuss] [ovs-dev] meter stats cleared when modify meter bands

2021-08-08 Thread Jean Tourrilhes
On Mon, Aug 02, 2021 at 03:41:25PM +0200, Ilya Maximets wrote:
> > 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?

When you modify bands, you may not have the same number of
bands before and after.
When you modify the bandwidth, you would expect that to
completely change the statistics of the band (if you double the
bandwidth, you expect twice the number of packets), so it does not
really make sense to continue.
At this point, we did not want to have a long and complex "if
you do this, and this. but not this, and not this, then...". Somebody
has to code and test those things.

> > 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.

Maybe I was entirely too cute when I did specify that. So far,
nobody complained, we are not looking at the most popular feature, so
my answer would be "why bother". Yes, I know, some people are
"completists"...

> Best regards, Ilya Maximets.

Have fun...

Jean
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] [ovs-dev] meter stats cleared when modify meter bands

2021-08-02 Thread Ilya Maximets
> 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"  wrote:
>>On Wed, Jul 28, 2021 at 10:57 AM ychen  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

___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] [ovs-dev] meter stats cleared when modify meter bands

2021-07-28 Thread ychen
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.

















At 2021-07-28 13:46:21, "Tonghao Zhang"  wrote:
>On Wed, Jul 28, 2021 at 10:57 AM ychen  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
>> d...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
>
>-- 
>Best regards, Tonghao
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] [ovs-dev] meter stats cleared when modify meter bands

2021-07-27 Thread Tonghao Zhang
On Wed, Jul 28, 2021 at 10:57 AM ychen  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
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev



-- 
Best regards, Tonghao
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss