Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-06-06 Thread Anju Thomas
Hi,
Oh.. You are right I did send the wrong version. Let me send the latest version.

Regards
Anju

-Original Message-
From: Ilya Maximets  
Sent: Thursday, June 6, 2019 8:18 PM
To: Anju Thomas ; ovs-dev@openvswitch.org
Cc: Eelco Chaudron 
Subject: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

On 06.06.2019 17:28, Anju Thomas wrote:
> Hi Ilya,
> Yes, I have addressed those comments in v9.

That is really strange. Maybe you've sent the wrong version?

That is what I (and everyone else) received:
  https://mail.openvswitch.org/pipermail/ovs-dev/2019-February/356743.html
It's the same code as down below.

You may simply grep for following lines:

COVERAGE_DEFINE(dp_sample_error_drop);   <-- I asked to rename this.

if (tnl_process_ecn(flow)<-- Here started a big diff that
 that I suggested to replace with
 a smaller one.

packet_count = packets_->count;  <-- Here I suggested to use
 dp_packet_batch_size().

Please, re-check.
Here is my review for v8, just in case:
https://mail.openvswitch.org/pipermail/ovs-dev/2019-February/356153.html

Best regards, Ilya Maximets.


> 
> Regards  & Thanks
> Anju
> 
> -Original Message-
> From: Ilya Maximets 
> Sent: Tuesday, June 4, 2019 12:33 PM
> To: ovs-dev@openvswitch.org; Anju Thomas 
> Cc: Eelco Chaudron 
> Subject: Re: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics 
> in OVS
> 
>> Hi Eelco,
>> Apart from Ilya's comments I have not received any comments for v8. I have 
>> addressed those comment in v9.
> 
> Hi Anju.
> I wrote about my comments to v8 just because you didn't reply or address a 
> bunch of them in v9. There was comments about using dp_packet_batch_size(), 
> renaming suggestion for sample and nsh drop counters, suggested ecn handling 
> code snippet, maybe something else.
> 
> Best regards, Ilya Maximets.
> 
>>
>> Regards
>> Anju
>>
>> -Original Message-----
>> From: Eelco Chaudron 
>> Sent: Monday, June 3, 2019 6:23 PM
>> To: Anju Thomas 
>> Cc: dev at openvswitch.org
>> Subject: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in 
>> OVS
>>
>> Hi Anju,
>>
>> Wondering if you got the email below…
>>
>> Cheers,
>>
>> Eelco
>>
>>
>> On 24 May 2019, at 11:46, Eelco Chaudron wrote:
>>
>>> Hi Anju,
>>>
>>> Was there ever a follow up on this patch? I only see one response 
>>> from Ilya on this asking about his v8 comments.
>>>
>>> Thanks,
>>>
>>> Eelco
>>>
>>>
>>> On 27 Feb 2019, at 10:22, Anju Thomas wrote:
>>>
>>>> Currently OVS maintains explicit packet drop/error counters only on 
>>>> port level. Packets that are dropped as part of normal OpenFlow 
>>>> processing are counted in flow stats of “drop” flows or as table 
>>>> misses in table stats.
>>>> These can only be interpreted by controllers that know the 
>>>> semantics of the configured OpenFlow pipeline. Without that 
>>>> knowledge, it is impossible for an OVS user to obtain e.g. the 
>>>> total number of packets dropped due to OpenFlow rules.
>>>>
>>>> Furthermore, there are numerous other reasons for which packets can 
>>>> be dropped by OVS slow path that are not related to the OpenFlow 
>>>> pipeline.
>>>> The generated datapath flow entries include a drop action to avoid 
>>>> further expensive upcalls to the slow path, but subsequent packets 
>>>> dropped by the datapath are not accounted anywhere.
>>>>
>>>> Finally, the datapath itself drops packets in certain error 
>>>> situations.
>>>> Also, these drops are today not accounted for.
>>>>
>>>> This makes it difficult for OVS users to monitor packet drop in an 
>>>> OVS instance and to alert a management system in case of a 
>>>> unexpected increase of such drops. Also OVS trouble-shooters face 
>>>> difficulties in analysing packet drops.
>>>>
>>>> With this patch we implement following changes to address the 
>>>> issues mentioned above.
>>>>
>>>> 1. Identify and account all the silent packet drop scenarios
>>>>
>>>> 2. Display these drops in ovs-appctl coverage/show
>>>>
>>>> A detailed presentation on this was presented at OvS conference 
>>>> 2017 and link for the corresponding p

Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-06-06 Thread Ilya Maximets
On 06.06.2019 17:28, Anju Thomas wrote:
> Hi Ilya,
> Yes, I have addressed those comments in v9.

That is really strange. Maybe you've sent the wrong version?

That is what I (and everyone else) received:
  https://mail.openvswitch.org/pipermail/ovs-dev/2019-February/356743.html
It's the same code as down below.

You may simply grep for following lines:

COVERAGE_DEFINE(dp_sample_error_drop);   <-- I asked to rename this.

if (tnl_process_ecn(flow)<-- Here started a big diff that
 that I suggested to replace with
 a smaller one.

packet_count = packets_->count;  <-- Here I suggested to use
 dp_packet_batch_size().

Please, re-check.
Here is my review for v8, just in case:
https://mail.openvswitch.org/pipermail/ovs-dev/2019-February/356153.html

Best regards, Ilya Maximets.


> 
> Regards  & Thanks
> Anju
> 
> -Original Message-
> From: Ilya Maximets  
> Sent: Tuesday, June 4, 2019 12:33 PM
> To: ovs-dev@openvswitch.org; Anju Thomas 
> Cc: Eelco Chaudron 
> Subject: Re: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS
> 
>> Hi Eelco,
>> Apart from Ilya's comments I have not received any comments for v8. I have 
>> addressed those comment in v9.
> 
> Hi Anju.
> I wrote about my comments to v8 just because you didn't reply or address a 
> bunch of them in v9. There was comments about using dp_packet_batch_size(), 
> renaming suggestion for sample and nsh drop counters, suggested ecn handling 
> code snippet, maybe something else.
> 
> Best regards, Ilya Maximets.
> 
>>
>> Regards
>> Anju
>>
>> -Original Message-----
>> From: Eelco Chaudron 
>> Sent: Monday, June 3, 2019 6:23 PM
>> To: Anju Thomas 
>> Cc: dev at openvswitch.org
>> Subject: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in 
>> OVS
>>
>> Hi Anju,
>>
>> Wondering if you got the email below…
>>
>> Cheers,
>>
>> Eelco
>>
>>
>> On 24 May 2019, at 11:46, Eelco Chaudron wrote:
>>
>>> Hi Anju,
>>>
>>> Was there ever a follow up on this patch? I only see one response 
>>> from Ilya on this asking about his v8 comments.
>>>
>>> Thanks,
>>>
>>> Eelco
>>>
>>>
>>> On 27 Feb 2019, at 10:22, Anju Thomas wrote:
>>>
>>>> Currently OVS maintains explicit packet drop/error counters only on 
>>>> port level. Packets that are dropped as part of normal OpenFlow 
>>>> processing are counted in flow stats of “drop” flows or as table 
>>>> misses in table stats.
>>>> These can only be interpreted by controllers that know the semantics 
>>>> of the configured OpenFlow pipeline. Without that knowledge, it is 
>>>> impossible for an OVS user to obtain e.g. the total number of 
>>>> packets dropped due to OpenFlow rules.
>>>>
>>>> Furthermore, there are numerous other reasons for which packets can 
>>>> be dropped by OVS slow path that are not related to the OpenFlow 
>>>> pipeline.
>>>> The generated datapath flow entries include a drop action to avoid 
>>>> further expensive upcalls to the slow path, but subsequent packets 
>>>> dropped by the datapath are not accounted anywhere.
>>>>
>>>> Finally, the datapath itself drops packets in certain error 
>>>> situations.
>>>> Also, these drops are today not accounted for.
>>>>
>>>> This makes it difficult for OVS users to monitor packet drop in an 
>>>> OVS instance and to alert a management system in case of a 
>>>> unexpected increase of such drops. Also OVS trouble-shooters face 
>>>> difficulties in analysing packet drops.
>>>>
>>>> With this patch we implement following changes to address the issues 
>>>> mentioned above.
>>>>
>>>> 1. Identify and account all the silent packet drop scenarios
>>>>
>>>> 2. Display these drops in ovs-appctl coverage/show
>>>>
>>>> A detailed presentation on this was presented at OvS conference 2017 
>>>> and link for the corresponding presentation is available at:
>>>>
>>>> https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the
>>>> -
>>>> data-plane-in-ovs-82280329
>>>>
>>>> Co-authored-by: Rohith Basavaraja 
>>>> Co-authored-by: Keshav Gupta 
>>>>

Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-06-06 Thread Anju Thomas
Hi Ilya,
Yes, I have addressed those comments in v9.

Regards  & Thanks
Anju

-Original Message-
From: Ilya Maximets  
Sent: Tuesday, June 4, 2019 12:33 PM
To: ovs-dev@openvswitch.org; Anju Thomas 
Cc: Eelco Chaudron 
Subject: Re: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

> Hi Eelco,
> Apart from Ilya's comments I have not received any comments for v8. I have 
> addressed those comment in v9.

Hi Anju.
I wrote about my comments to v8 just because you didn't reply or address a 
bunch of them in v9. There was comments about using dp_packet_batch_size(), 
renaming suggestion for sample and nsh drop counters, suggested ecn handling 
code snippet, maybe something else.

Best regards, Ilya Maximets.

> 
> Regards
> Anju
> 
> -Original Message-
> From: Eelco Chaudron 
> Sent: Monday, June 3, 2019 6:23 PM
> To: Anju Thomas 
> Cc: dev at openvswitch.org
> Subject: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in 
> OVS
> 
> Hi Anju,
> 
> Wondering if you got the email below…
> 
> Cheers,
> 
> Eelco
> 
> 
> On 24 May 2019, at 11:46, Eelco Chaudron wrote:
> 
>> Hi Anju,
>>
>> Was there ever a follow up on this patch? I only see one response 
>> from Ilya on this asking about his v8 comments.
>>
>> Thanks,
>>
>> Eelco
>>
>>
>> On 27 Feb 2019, at 10:22, Anju Thomas wrote:
>>
>>> Currently OVS maintains explicit packet drop/error counters only on 
>>> port level. Packets that are dropped as part of normal OpenFlow 
>>> processing are counted in flow stats of “drop” flows or as table 
>>> misses in table stats.
>>> These can only be interpreted by controllers that know the semantics 
>>> of the configured OpenFlow pipeline. Without that knowledge, it is 
>>> impossible for an OVS user to obtain e.g. the total number of 
>>> packets dropped due to OpenFlow rules.
>>>
>>> Furthermore, there are numerous other reasons for which packets can 
>>> be dropped by OVS slow path that are not related to the OpenFlow 
>>> pipeline.
>>> The generated datapath flow entries include a drop action to avoid 
>>> further expensive upcalls to the slow path, but subsequent packets 
>>> dropped by the datapath are not accounted anywhere.
>>>
>>> Finally, the datapath itself drops packets in certain error 
>>> situations.
>>> Also, these drops are today not accounted for.
>>>
>>> This makes it difficult for OVS users to monitor packet drop in an 
>>> OVS instance and to alert a management system in case of a 
>>> unexpected increase of such drops. Also OVS trouble-shooters face 
>>> difficulties in analysing packet drops.
>>>
>>> With this patch we implement following changes to address the issues 
>>> mentioned above.
>>>
>>> 1. Identify and account all the silent packet drop scenarios
>>>
>>> 2. Display these drops in ovs-appctl coverage/show
>>>
>>> A detailed presentation on this was presented at OvS conference 2017 
>>> and link for the corresponding presentation is available at:
>>>
>>> https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the
>>> -
>>> data-plane-in-ovs-82280329
>>>
>>> Co-authored-by: Rohith Basavaraja 
>>> Co-authored-by: Keshav Gupta 
>>> Signed-off-by: Anju Thomas 
>>> Signed-off-by: Rohith Basavaraja 
>>> Signed-off-by: Keshav Gupta 
>>> ---
>>>  datapath/linux/compat/include/linux/openvswitch.h |   1 +
>>>  lib/dpif-netdev.c |  44 -
>>>  lib/dpif.c|   7 +
>>>  lib/dpif.h|   3 +
>>>  lib/odp-execute.c |  81 -
>>>  lib/odp-util.c|   9 +
>>>  ofproto/ofproto-dpif-ipfix.c  |   1 +
>>>  ofproto/ofproto-dpif-sflow.c  |   1 +
>>>  ofproto/ofproto-dpif-xlate.c  | 103 +++
>>>  ofproto/ofproto-dpif-xlate.h  |   3 +
>>>  ofproto/ofproto-dpif.c|   8 +
>>>  ofproto/ofproto-dpif.h|   7 +-
>>>  tests/automake.mk |   3 +-
>>>  tests/dpif-netdev.at  |   8 +
>>>  tests/drop-stats.at   | 197 
>>> ++
>>>  tests/ofproto-dpif.at

Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-06-04 Thread Ilya Maximets
> Hi Eelco,
> Apart from Ilya's comments I have not received any comments for v8. I have 
> addressed those comment in v9.

Hi Anju.
I wrote about my comments to v8 just because you didn't reply or address a bunch
of them in v9. There was comments about using dp_packet_batch_size(), renaming
suggestion for sample and nsh drop counters, suggested ecn handling code 
snippet,
maybe something else.

Best regards, Ilya Maximets.

> 
> Regards
> Anju
> 
> -Original Message-
> From: Eelco Chaudron  
> Sent: Monday, June 3, 2019 6:23 PM
> To: Anju Thomas 
> Cc: dev at openvswitch.org
> Subject: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS
> 
> Hi Anju,
> 
> Wondering if you got the email below…
> 
> Cheers,
> 
> Eelco
> 
> 
> On 24 May 2019, at 11:46, Eelco Chaudron wrote:
> 
>> Hi Anju,
>>
>> Was there ever a follow up on this patch? I only see one response from 
>> Ilya on this asking about his v8 comments.
>>
>> Thanks,
>>
>> Eelco
>>
>>
>> On 27 Feb 2019, at 10:22, Anju Thomas wrote:
>>
>>> Currently OVS maintains explicit packet drop/error counters only on 
>>> port level. Packets that are dropped as part of normal OpenFlow 
>>> processing are counted in flow stats of “drop” flows or as table 
>>> misses in table stats.
>>> These can only be interpreted by controllers that know the semantics 
>>> of the configured OpenFlow pipeline. Without that knowledge, it is 
>>> impossible for an OVS user to obtain e.g. the total number of packets 
>>> dropped due to OpenFlow rules.
>>>
>>> Furthermore, there are numerous other reasons for which packets can 
>>> be dropped by OVS slow path that are not related to the OpenFlow 
>>> pipeline.
>>> The generated datapath flow entries include a drop action to avoid 
>>> further expensive upcalls to the slow path, but subsequent packets 
>>> dropped by the datapath are not accounted anywhere.
>>>
>>> Finally, the datapath itself drops packets in certain error 
>>> situations.
>>> Also, these drops are today not accounted for.
>>>
>>> This makes it difficult for OVS users to monitor packet drop in an 
>>> OVS instance and to alert a management system in case of a unexpected 
>>> increase of such drops. Also OVS trouble-shooters face difficulties 
>>> in analysing packet drops.
>>>
>>> With this patch we implement following changes to address the issues 
>>> mentioned above.
>>>
>>> 1. Identify and account all the silent packet drop scenarios
>>>
>>> 2. Display these drops in ovs-appctl coverage/show
>>>
>>> A detailed presentation on this was presented at OvS conference 2017 
>>> and link for the corresponding presentation is available at:
>>>
>>> https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the-
>>> data-plane-in-ovs-82280329
>>>
>>> Co-authored-by: Rohith Basavaraja 
>>> Co-authored-by: Keshav Gupta 
>>> Signed-off-by: Anju Thomas 
>>> Signed-off-by: Rohith Basavaraja 
>>> Signed-off-by: Keshav Gupta 
>>> ---
>>>  datapath/linux/compat/include/linux/openvswitch.h |   1 +
>>>  lib/dpif-netdev.c |  44 -
>>>  lib/dpif.c|   7 +
>>>  lib/dpif.h|   3 +
>>>  lib/odp-execute.c |  81 -
>>>  lib/odp-util.c|   9 +
>>>  ofproto/ofproto-dpif-ipfix.c  |   1 +
>>>  ofproto/ofproto-dpif-sflow.c  |   1 +
>>>  ofproto/ofproto-dpif-xlate.c  | 103 +++
>>>  ofproto/ofproto-dpif-xlate.h  |   3 +
>>>  ofproto/ofproto-dpif.c|   8 +
>>>  ofproto/ofproto-dpif.h|   7 +-
>>>  tests/automake.mk |   3 +-
>>>  tests/dpif-netdev.at  |   8 +
>>>  tests/drop-stats.at   | 197 
>>> ++
>>>  tests/ofproto-dpif.at |   2 +-
>>>  tests/testsuite.at|   1 +
>>>  tests/tunnel-push-pop.at  |  28 ++-
>>>  tests/tunnel.at   |  14 +-
>>>  19 files changed, 475 insertions(+), 46 deletions(-)  create mod

Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-06-04 Thread Eelco Chaudron

Hi Anju,

Can you rebase this patch set on the latest master branch? If you do 
this I will review/test it.


Cheers,

Eelco



On 4 Jun 2019, at 5:42, Anju Thomas wrote:


Hi Eelco,
Apart from Ilya's comments I have not received any comments for v8. I 
have addressed those comment in v9.


Regards
Anju

-Original Message-
From: Eelco Chaudron 
Sent: Monday, June 3, 2019 6:23 PM
To: Anju Thomas 
Cc: d...@openvswitch.org
Subject: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in 
OVS


Hi Anju,

Wondering if you got the email below…

Cheers,

Eelco


On 24 May 2019, at 11:46, Eelco Chaudron wrote:


Hi Anju,

Was there ever a follow up on this patch? I only see one response 
from

Ilya on this asking about his v8 comments.

Thanks,

Eelco


On 27 Feb 2019, at 10:22, Anju Thomas wrote:


Currently OVS maintains explicit packet drop/error counters only on
port level. Packets that are dropped as part of normal OpenFlow
processing are counted in flow stats of “drop” flows or as table
misses in table stats.
These can only be interpreted by controllers that know the semantics
of the configured OpenFlow pipeline. Without that knowledge, it is
impossible for an OVS user to obtain e.g. the total number of 
packets

dropped due to OpenFlow rules.

Furthermore, there are numerous other reasons for which packets can
be dropped by OVS slow path that are not related to the OpenFlow
pipeline.
The generated datapath flow entries include a drop action to avoid
further expensive upcalls to the slow path, but subsequent packets
dropped by the datapath are not accounted anywhere.

Finally, the datapath itself drops packets in certain error
situations.
Also, these drops are today not accounted for.

This makes it difficult for OVS users to monitor packet drop in an
OVS instance and to alert a management system in case of a 
unexpected

increase of such drops. Also OVS trouble-shooters face difficulties
in analysing packet drops.

With this patch we implement following changes to address the issues
mentioned above.

1. Identify and account all the silent packet drop scenarios

2. Display these drops in ovs-appctl coverage/show

A detailed presentation on this was presented at OvS conference 2017
and link for the corresponding presentation is available at:

https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the-
data-plane-in-ovs-82280329

Co-authored-by: Rohith Basavaraja 
Co-authored-by: Keshav Gupta 
Signed-off-by: Anju Thomas 
Signed-off-by: Rohith Basavaraja 
Signed-off-by: Keshav Gupta 
---
 datapath/linux/compat/include/linux/openvswitch.h |   1 +
 lib/dpif-netdev.c |  44 -
 lib/dpif.c|   7 +
 lib/dpif.h|   3 +
 lib/odp-execute.c |  81 -
 lib/odp-util.c|   9 +
 ofproto/ofproto-dpif-ipfix.c  |   1 +
 ofproto/ofproto-dpif-sflow.c  |   1 +
 ofproto/ofproto-dpif-xlate.c  | 103 +++
 ofproto/ofproto-dpif-xlate.h  |   3 +
 ofproto/ofproto-dpif.c|   8 +
 ofproto/ofproto-dpif.h|   7 +-
 tests/automake.mk |   3 +-
 tests/dpif-netdev.at  |   8 +
 tests/drop-stats.at   | 197
++
 tests/ofproto-dpif.at |   2 +-
 tests/testsuite.at|   1 +
 tests/tunnel-push-pop.at  |  28 ++-
 tests/tunnel.at   |  14 +-
 19 files changed, 475 insertions(+), 46 deletions(-)  create mode
100644 tests/drop-stats.at

diff --git a/datapath/linux/compat/include/linux/openvswitch.h
b/datapath/linux/compat/include/linux/openvswitch.h
index d5aa09d..e77e9c8 100644
--- a/datapath/linux/compat/include/linux/openvswitch.h
+++ b/datapath/linux/compat/include/linux/openvswitch.h
@@ -946,6 +946,7 @@ enum ovs_action_attr {
OVS_ACTION_ATTR_POP_NSH,  /* No argument. */
OVS_ACTION_ATTR_METER,/* u32 meter number. */
OVS_ACTION_ATTR_CLONE,/* Nested OVS_CLONE_ATTR_*.  */
+   OVS_ACTION_ATTR_DROP, /* Drop action. */

 #ifndef __KERNEL__
OVS_ACTION_ATTR_TUNNEL_PUSH,   /* struct ovs_action_push_tnl*/
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index
77ac1d2..acc7913 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -101,6 +101,17 @@ enum { MAX_METERS = 65536 };/* Maximum
number of meters. */
 enum { MAX_BANDS = 8 }; /* Maximum number of bands / meter.
*/
 enum { N_METER_LOCKS = 64 };/* Maximum number of meters. */

+COVERAGE_DEFINE(datapath_drop_meter);
+COVERAGE_DEFINE(datapath_drop_upcall_error);
+COVERAGE_DEFINE(datapath_drop_lock_error);
+COVERAGE_DEFINE(datapath_drop_userspace_action_error

Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-06-03 Thread Anju Thomas
Hi Eelco,
Apart from Ilya's comments I have not received any comments for v8. I have 
addressed those comment in v9.

Regards
Anju

-Original Message-
From: Eelco Chaudron  
Sent: Monday, June 3, 2019 6:23 PM
To: Anju Thomas 
Cc: d...@openvswitch.org
Subject: Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

Hi Anju,

Wondering if you got the email below…

Cheers,

Eelco


On 24 May 2019, at 11:46, Eelco Chaudron wrote:

> Hi Anju,
>
> Was there ever a follow up on this patch? I only see one response from 
> Ilya on this asking about his v8 comments.
>
> Thanks,
>
> Eelco
>
>
> On 27 Feb 2019, at 10:22, Anju Thomas wrote:
>
>> Currently OVS maintains explicit packet drop/error counters only on 
>> port level. Packets that are dropped as part of normal OpenFlow 
>> processing are counted in flow stats of “drop” flows or as table 
>> misses in table stats.
>> These can only be interpreted by controllers that know the semantics 
>> of the configured OpenFlow pipeline. Without that knowledge, it is 
>> impossible for an OVS user to obtain e.g. the total number of packets 
>> dropped due to OpenFlow rules.
>>
>> Furthermore, there are numerous other reasons for which packets can 
>> be dropped by OVS slow path that are not related to the OpenFlow 
>> pipeline.
>> The generated datapath flow entries include a drop action to avoid 
>> further expensive upcalls to the slow path, but subsequent packets 
>> dropped by the datapath are not accounted anywhere.
>>
>> Finally, the datapath itself drops packets in certain error 
>> situations.
>> Also, these drops are today not accounted for.
>>
>> This makes it difficult for OVS users to monitor packet drop in an 
>> OVS instance and to alert a management system in case of a unexpected 
>> increase of such drops. Also OVS trouble-shooters face difficulties 
>> in analysing packet drops.
>>
>> With this patch we implement following changes to address the issues 
>> mentioned above.
>>
>> 1. Identify and account all the silent packet drop scenarios
>>
>> 2. Display these drops in ovs-appctl coverage/show
>>
>> A detailed presentation on this was presented at OvS conference 2017 
>> and link for the corresponding presentation is available at:
>>
>> https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the-
>> data-plane-in-ovs-82280329
>>
>> Co-authored-by: Rohith Basavaraja 
>> Co-authored-by: Keshav Gupta 
>> Signed-off-by: Anju Thomas 
>> Signed-off-by: Rohith Basavaraja 
>> Signed-off-by: Keshav Gupta 
>> ---
>>  datapath/linux/compat/include/linux/openvswitch.h |   1 +
>>  lib/dpif-netdev.c |  44 -
>>  lib/dpif.c|   7 +
>>  lib/dpif.h|   3 +
>>  lib/odp-execute.c |  81 -
>>  lib/odp-util.c|   9 +
>>  ofproto/ofproto-dpif-ipfix.c  |   1 +
>>  ofproto/ofproto-dpif-sflow.c  |   1 +
>>  ofproto/ofproto-dpif-xlate.c  | 103 +++
>>  ofproto/ofproto-dpif-xlate.h  |   3 +
>>  ofproto/ofproto-dpif.c|   8 +
>>  ofproto/ofproto-dpif.h|   7 +-
>>  tests/automake.mk |   3 +-
>>  tests/dpif-netdev.at  |   8 +
>>  tests/drop-stats.at   | 197 
>> ++
>>  tests/ofproto-dpif.at |   2 +-
>>  tests/testsuite.at|   1 +
>>  tests/tunnel-push-pop.at  |  28 ++-
>>  tests/tunnel.at   |  14 +-
>>  19 files changed, 475 insertions(+), 46 deletions(-)  create mode 
>> 100644 tests/drop-stats.at
>>
>> diff --git a/datapath/linux/compat/include/linux/openvswitch.h
>> b/datapath/linux/compat/include/linux/openvswitch.h
>> index d5aa09d..e77e9c8 100644
>> --- a/datapath/linux/compat/include/linux/openvswitch.h
>> +++ b/datapath/linux/compat/include/linux/openvswitch.h
>> @@ -946,6 +946,7 @@ enum ovs_action_attr {
>>  OVS_ACTION_ATTR_POP_NSH,  /* No argument. */
>>  OVS_ACTION_ATTR_METER,/* u32 meter number. */
>>  OVS_ACTION_ATTR_CLONE,/* Nested OVS_CLONE_ATTR_*.  */
>> +OVS_ACTION_ATTR_DROP, /* Drop action. */
>>
>>  #ifndef __KERNEL__
>>  OVS_ACTION_ATTR_TUN

Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-06-03 Thread Eelco Chaudron

Hi Anju,

Wondering if you got the email below…

Cheers,

Eelco


On 24 May 2019, at 11:46, Eelco Chaudron wrote:


Hi Anju,

Was there ever a follow up on this patch? I only see one response from 
Ilya on this asking about his v8 comments.


Thanks,

Eelco


On 27 Feb 2019, at 10:22, Anju Thomas wrote:

Currently OVS maintains explicit packet drop/error counters only on 
port
level. Packets that are dropped as part of normal OpenFlow processing 
are
counted in flow stats of “drop” flows or as table misses in table 
stats.
These can only be interpreted by controllers that know the semantics 
of
the configured OpenFlow pipeline. Without that knowledge, it is 
impossible
for an OVS user to obtain e.g. the total number of packets dropped 
due to

OpenFlow rules.

Furthermore, there are numerous other reasons for which packets can 
be
dropped by OVS slow path that are not related to the OpenFlow 
pipeline.
The generated datapath flow entries include a drop action to avoid 
further
expensive upcalls to the slow path, but subsequent packets dropped by 
the

datapath are not accounted anywhere.

Finally, the datapath itself drops packets in certain error 
situations.

Also, these drops are today not accounted for.

This makes it difficult for OVS users to monitor packet drop in an 
OVS
instance and to alert a management system in case of a unexpected 
increase
of such drops. Also OVS trouble-shooters face difficulties in 
analysing

packet drops.

With this patch we implement following changes to address the issues
mentioned above.

1. Identify and account all the silent packet drop scenarios

2. Display these drops in ovs-appctl coverage/show

A detailed presentation on this was presented at OvS conference 2017 
and

link for the corresponding presentation is available at:

https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the-data-plane-in-ovs-82280329

Co-authored-by: Rohith Basavaraja 
Co-authored-by: Keshav Gupta 
Signed-off-by: Anju Thomas 
Signed-off-by: Rohith Basavaraja 
Signed-off-by: Keshav Gupta 
---
 datapath/linux/compat/include/linux/openvswitch.h |   1 +
 lib/dpif-netdev.c |  44 -
 lib/dpif.c|   7 +
 lib/dpif.h|   3 +
 lib/odp-execute.c |  81 -
 lib/odp-util.c|   9 +
 ofproto/ofproto-dpif-ipfix.c  |   1 +
 ofproto/ofproto-dpif-sflow.c  |   1 +
 ofproto/ofproto-dpif-xlate.c  | 103 +++
 ofproto/ofproto-dpif-xlate.h  |   3 +
 ofproto/ofproto-dpif.c|   8 +
 ofproto/ofproto-dpif.h|   7 +-
 tests/automake.mk |   3 +-
 tests/dpif-netdev.at  |   8 +
 tests/drop-stats.at   | 197 
++

 tests/ofproto-dpif.at |   2 +-
 tests/testsuite.at|   1 +
 tests/tunnel-push-pop.at  |  28 ++-
 tests/tunnel.at   |  14 +-
 19 files changed, 475 insertions(+), 46 deletions(-)
 create mode 100644 tests/drop-stats.at

diff --git a/datapath/linux/compat/include/linux/openvswitch.h 
b/datapath/linux/compat/include/linux/openvswitch.h

index d5aa09d..e77e9c8 100644
--- a/datapath/linux/compat/include/linux/openvswitch.h
+++ b/datapath/linux/compat/include/linux/openvswitch.h
@@ -946,6 +946,7 @@ enum ovs_action_attr {
OVS_ACTION_ATTR_POP_NSH,  /* No argument. */
OVS_ACTION_ATTR_METER,/* u32 meter number. */
OVS_ACTION_ATTR_CLONE,/* Nested OVS_CLONE_ATTR_*.  */
+   OVS_ACTION_ATTR_DROP, /* Drop action. */

 #ifndef __KERNEL__
OVS_ACTION_ATTR_TUNNEL_PUSH,   /* struct ovs_action_push_tnl*/
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 77ac1d2..acc7913 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -101,6 +101,17 @@ enum { MAX_METERS = 65536 };/* Maximum 
number of meters. */
 enum { MAX_BANDS = 8 }; /* Maximum number of bands / meter. 
*/

 enum { N_METER_LOCKS = 64 };/* Maximum number of meters. */

+COVERAGE_DEFINE(datapath_drop_meter);
+COVERAGE_DEFINE(datapath_drop_upcall_error);
+COVERAGE_DEFINE(datapath_drop_lock_error);
+COVERAGE_DEFINE(datapath_drop_userspace_action_error);
+COVERAGE_DEFINE(datapath_drop_tunnel_push_error);
+COVERAGE_DEFINE(datapath_drop_tunnel_pop_error);
+COVERAGE_DEFINE(datapath_drop_recirc_error);
+COVERAGE_DEFINE(datapath_drop_invalid_port);
+COVERAGE_DEFINE(datapath_drop_invalid_tnl_port);
+COVERAGE_DEFINE(datapath_drop_rx_invalid_packet);
+
 /* Protects against changes to 'dp_netdevs'. */
 static struct ovs_mutex dp_netdev_mutex = OVS_MUTEX_INITIALIZER;

@@ -5647,6 +5658,7 @@ dp_netdev_run_meter(struct dp_netdev *dp, 
struct 

Re: [ovs-dev] [PATCH v9] Improved Packet Drop Statistics in OVS

2019-05-24 Thread Eelco Chaudron

Hi Anju,

Was there ever a follow up on this patch? I only see one response from 
Ilya on this asking about his v8 comments.


Thanks,

Eelco


On 27 Feb 2019, at 10:22, Anju Thomas wrote:

Currently OVS maintains explicit packet drop/error counters only on 
port
level. Packets that are dropped as part of normal OpenFlow processing 
are
counted in flow stats of “drop” flows or as table misses in table 
stats.
These can only be interpreted by controllers that know the semantics 
of
the configured OpenFlow pipeline. Without that knowledge, it is 
impossible
for an OVS user to obtain e.g. the total number of packets dropped due 
to

OpenFlow rules.

Furthermore, there are numerous other reasons for which packets can be
dropped by OVS slow path that are not related to the OpenFlow 
pipeline.
The generated datapath flow entries include a drop action to avoid 
further
expensive upcalls to the slow path, but subsequent packets dropped by 
the

datapath are not accounted anywhere.

Finally, the datapath itself drops packets in certain error 
situations.

Also, these drops are today not accounted for.

This makes it difficult for OVS users to monitor packet drop in an OVS
instance and to alert a management system in case of a unexpected 
increase
of such drops. Also OVS trouble-shooters face difficulties in 
analysing

packet drops.

With this patch we implement following changes to address the issues
mentioned above.

1. Identify and account all the silent packet drop scenarios

2. Display these drops in ovs-appctl coverage/show

A detailed presentation on this was presented at OvS conference 2017 
and

link for the corresponding presentation is available at:

https://www.slideshare.net/LF_OpenvSwitch/lfovs17troubleshooting-the-data-plane-in-ovs-82280329

Co-authored-by: Rohith Basavaraja 
Co-authored-by: Keshav Gupta 
Signed-off-by: Anju Thomas 
Signed-off-by: Rohith Basavaraja 
Signed-off-by: Keshav Gupta 
---
 datapath/linux/compat/include/linux/openvswitch.h |   1 +
 lib/dpif-netdev.c |  44 -
 lib/dpif.c|   7 +
 lib/dpif.h|   3 +
 lib/odp-execute.c |  81 -
 lib/odp-util.c|   9 +
 ofproto/ofproto-dpif-ipfix.c  |   1 +
 ofproto/ofproto-dpif-sflow.c  |   1 +
 ofproto/ofproto-dpif-xlate.c  | 103 +++
 ofproto/ofproto-dpif-xlate.h  |   3 +
 ofproto/ofproto-dpif.c|   8 +
 ofproto/ofproto-dpif.h|   7 +-
 tests/automake.mk |   3 +-
 tests/dpif-netdev.at  |   8 +
 tests/drop-stats.at   | 197 
++

 tests/ofproto-dpif.at |   2 +-
 tests/testsuite.at|   1 +
 tests/tunnel-push-pop.at  |  28 ++-
 tests/tunnel.at   |  14 +-
 19 files changed, 475 insertions(+), 46 deletions(-)
 create mode 100644 tests/drop-stats.at

diff --git a/datapath/linux/compat/include/linux/openvswitch.h 
b/datapath/linux/compat/include/linux/openvswitch.h

index d5aa09d..e77e9c8 100644
--- a/datapath/linux/compat/include/linux/openvswitch.h
+++ b/datapath/linux/compat/include/linux/openvswitch.h
@@ -946,6 +946,7 @@ enum ovs_action_attr {
OVS_ACTION_ATTR_POP_NSH,  /* No argument. */
OVS_ACTION_ATTR_METER,/* u32 meter number. */
OVS_ACTION_ATTR_CLONE,/* Nested OVS_CLONE_ATTR_*.  */
+   OVS_ACTION_ATTR_DROP, /* Drop action. */

 #ifndef __KERNEL__
OVS_ACTION_ATTR_TUNNEL_PUSH,   /* struct ovs_action_push_tnl*/
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 77ac1d2..acc7913 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -101,6 +101,17 @@ enum { MAX_METERS = 65536 };/* Maximum number 
of meters. */
 enum { MAX_BANDS = 8 }; /* Maximum number of bands / meter. 
*/

 enum { N_METER_LOCKS = 64 };/* Maximum number of meters. */

+COVERAGE_DEFINE(datapath_drop_meter);
+COVERAGE_DEFINE(datapath_drop_upcall_error);
+COVERAGE_DEFINE(datapath_drop_lock_error);
+COVERAGE_DEFINE(datapath_drop_userspace_action_error);
+COVERAGE_DEFINE(datapath_drop_tunnel_push_error);
+COVERAGE_DEFINE(datapath_drop_tunnel_pop_error);
+COVERAGE_DEFINE(datapath_drop_recirc_error);
+COVERAGE_DEFINE(datapath_drop_invalid_port);
+COVERAGE_DEFINE(datapath_drop_invalid_tnl_port);
+COVERAGE_DEFINE(datapath_drop_rx_invalid_packet);
+
 /* Protects against changes to 'dp_netdevs'. */
 static struct ovs_mutex dp_netdev_mutex = OVS_MUTEX_INITIALIZER;

@@ -5647,6 +5658,7 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct 
dp_packet_batch *packets_,

 band->packet_count += 1;
 band->byte_count += dp_packet_size(packet);

+