[ovs-dev] Port Link Down Error while ruining Dpdk ipsec-secgw application

2020-09-26 Thread satyavalli rama
Hi Anoob and DPDK Dev Team,

Please guide us resolve the issue..

While running the ipsec-secgw application the ports are getting down and it
is throwing

-->Port Link Down Error

We are doing the below steps:

Since we don't have IXGBE driver in the virtual machines. we used SRIOV to
import the IXGBE NIC's (Virtual function) from host(Physical function).
We refered the below link for SRIOV:
https://software.intel.com/content/www/us/en/develop/articles/configure-sr-iov-network-virtual-functions-in-linux-kvm.html

This the info after importing IXGBE NIC's into virtual machine:
---> ip link show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode
DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens8:  mtu 1500 qdisc pfifo_fast state
UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:bd:f7:ce brd ff:ff:ff:ff:ff:ff
3: ens9:  mtu 1500 qdisc pfifo_fast state
UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:e5:35:b5 brd ff:ff:ff:ff:ff:ff
4: ens12:  mtu 1500 qdisc pfifo_fast state
UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:14:ce:7c brd ff:ff:ff:ff:ff:ff
5: ens13:  mtu 1500 qdisc pfifo_fast state
UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:d0:73:4c brd ff:ff:ff:ff:ff:ff

6: ens3:  mtu 1500 qdisc mq state DOWN
mode DEFAULT group default qlen 1000
link/ether 96:42:49:cd:9c:61 brd ff:ff:ff:ff:ff:ff
 <<
7: ens11:  mtu 1500 qdisc mq state DOWN
mode DEFAULT group default qlen 1000
link/ether 3e:f5:92:ef:9e:16 brd ff:ff:ff:ff:ff:ff
 <<


8: ens10:  mtu 1500 qdisc pfifo_fast state
UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:51:ee:74 brd ff:ff:ff:ff:ff:ff
9: ens14:  mtu 1500 qdisc pfifo_fast state
UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:da:08:cb brd ff:ff:ff:ff:ff:ff
10: ens15:  mtu 1500 qdisc pfifo_fast
state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:31:7c:6f brd ff:ff:ff:ff:ff:ff

-->While we are running the ipsec-secgw application. We are getting
following error:

IPSEC: No IPv6 SP Inbound rule specified
IPSEC: No IPv6 SP Outbound rule specified
Creating IPv4 Routing Table (RT) context with 1024 max routes
LPM: Adding route 192.168.122.0/24 (1)

Checking link
status..done
Port 0 Link Down
<<<
Port 1 Link Down
<<<
IPSEC: entering main loop on lcore 0
IPSEC:  -- lcoreid=0 portid=0 rxqueueid=0
IPSEC:  -- lcoreid=0 portid=1 rxqueueid=0

Please find the attachment which contain console logs.

Thanks and Regards
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] dev Digest, Vol 103, Issue 179

2018-03-28 Thread Satyavalli Rama

Hi Ben 




Colud you plese provide  your valuable inputs.


Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty. IT Services
Business Solutions
Consulting




-ovs-dev-boun...@openvswitch.org wrote: -

To: ovs-dev@openvswitch.org
From: ovs-dev-requ...@openvswitch.org
Sent by: ovs-dev-boun...@openvswitch.org
Date: 02/28/2018 08:07PM
Subject: dev Digest, Vol 103, Issue 179


Send dev mailing list submissions to
ovs-dev@openvswitch.org

To subscribe or unsubscribe via the World Wide Web, visit
https://mail.openvswitch.org/mailman/listinfo/ovs-dev
or, via email, send a message with subject or body 'help' to
ovs-dev-requ...@openvswitch.org

You can reach the person managing the list at
ovs-dev-ow...@openvswitch.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dev digest..."


Today's Topics:

   1. [PATCH] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics
  Support (SatyaValli)


--

Message: 1
Date: Wed, 28 Feb 2018 20:05:56 +0530
From: SatyaValli 
To: d...@openvswitch.org
Cc: Manasa Cherukupally , Surya
Muttamsetty , Pavani Panthagada
, Satya Valli , Lavanya
Harivelam 
Subject: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow Entry
Statistics Support
Message-ID: <1519828556-3535-1-git-send-email-satyavalli.r...@tcs.com>

From: SatyaValli 

This Patch provides implementation Existing flow entry statistics are
redefined as standard OXS(OpenFlow Extensible Statistics) fields for
displaying the arbitrary flow stats.The existing Flow Stats were renamed
as Flow Description.

To support this implementation below messages are newly added

OFPRAW_OFPT15_FLOW_REMOVED,
OFPRAW_OFPST15_FLOW_REQUEST,
OFPRAW_OFPST15_FLOW_DESC_REQUEST,
OFPRAW_OFPST15_AGGREGATE_REQUEST,
OFPRAW_OFPST15_FLOW_REPLY,
OFPRAW_OFPST15_FLOW_DESC_REPLY,
OFPRAW_OFPST15_AGGREGATE_REPLY,

The current commit adds support for the new feature in flow statistics
multipart messages,aggregate multipart messages and OXS support for flow
removal message, individual flow description messages.

"ovs-ofctl dump-flows" & "ovs-ofctl dump-aggregate" now accepts a new option
"--oxs-stats" provided with the arbitrary OXS fields for displaying the
desired flow stats.

Below are Commands to display OXS stats field wise

Flow Statistics Multipart
ovs-ofctl dump-flows -O OpenFlow15  --oxs-stats=idle_time
ovs-ofctl dump-flows -O OpenFlow15  --oxs-stats=packet_count
ovs-ofctl dump-flows -O OpenFlow15  --oxs-stats=byte_count
ovs-ofctl dump-flows -O OpenFlow15  --oxs-stats=duration

Aggregate Flow Statistics Multipart
ovs-ofctl dump-aggregate -O OpenFlow15  --oxs-stats=packet_count
ovs-ofctl dump-aggregate -O OpenFlow15  --oxs-stats=byte_count
ovs-ofctl dump-aggregate -O OpenFlow15  --oxs-stats=flow_count

Signed-off-by: Satya Valli 
Co-authored-by: Lavanya Harivelam 
Signed-off-by: Lavanya Harivelam 
Co-authored-by: Surya Muttamsetty 
Signed-off-by: Surya Muttamsetty 
Co-authored-by: Manasa Cherukupally 
Signed-off-by: Manasa Cherukupally 
Co-authored-by: Pavani Panthagada 
Signed-off-by: Pavani Panthagada 

---
 NEWS|7 +
 include/openflow/openflow-1.5.h |   81 +++
 include/openvswitch/ofp-msgs.h  |   31 +-
 include/openvswitch/ofp-print.h |9 +-
 lib/automake.mk |2 +
 lib/ofp-bundle.c|2 +
 lib/ofp-flow.c  |  198 +++-
 lib/ofp-monitor.c   |   46 +-
 lib/ofp-parse.c |1 +
 lib/ofp-print.c |   52 ++
 lib/ox-stat.c   | 1040 +++
 lib/ox-stat.h   |   60 +++
 lib/rconn.c |2 +
 lib/vconn.c |7 +-
 ofproto/ofproto.c   |3 +-
 tests/ofp-print.at  |   80 +++
 tests/ofproto-dpif.at   |   85 
 tests/ofproto.at|3 +-
 utilities/ovs-ofctl.8.in|   31 +-
 utilities/ovs-ofctl.c   |  123 -
 20 files changed, 1815 insertions(+), 48 deletions(-)
 create mode 100644 lib/ox-stat.c
 create mode 100644 lib/ox-stat.h

diff --git a/NEWS b/NEWS
index 4230189..0704960 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,13 @@ Post-v2.9.0
"table#".  These are not helpful names for the purpose of accepting
  

Re: [ovs-dev] [PATCH v3] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics CLI Changes

2018-02-26 Thread Satyavalli Rama
Hi Ben and Jan,

Below are the logs of the changed OXS Commands please have a look on them once 
and provide your valuable inputs if any...

# ovs-ofctl -O OpenFlow15 dump-flows br0 
 cookie=0x0, duration=9407.750s, table=0, n_packets=61, n_bytes=7320, 
idle_age=94, ip actions=NORMAL 
 cookie=0x0, duration=14615.659s, table=0, n_packets=354, n_bytes=36862, 
idle_age=9547, priority=0 actions=NORMAL 

  
# ovs-ofctl -O OpenFlow15 dump-flows br0 --oxs-stats=duration 
 duration=9391.712s   
 duration=14599.621s   

  
# ovs-ofctl -O OpenFlow15 dump-flows br0 --oxs-stats=duration,packet_count 
 duration=9401.845s  n_packets=61   
 duration=14609.754s  n_packets=354   

  

  
# ovs-ofctl -O OpenFlow14 dump-flows br0 --oxs-stats=duration,packet_count 
ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow14)  supports oxs 
(OXM-OpenFlow15,OXM-OpenFlow16).(Use -O to enable  additional OpenFlow 
versions) 

  
---
  
# ovs-ofctl -O OpenFlow15 dump-aggregate br0 --oxs-stats=byte,packet_count 
 n_packets=415 n_bytes=44182   

# ovs-ofctl -O OpenFlow15 dump-aggregate br0 
OFPST_AGGREGATE reply (OF1.5) (xid=0x2): packet_count=415 byte_count=44182 
flow_count=2 

  

  
#ovs-ofctl -O OpenFlow14 dump-aggregate br0 --oxs-stats=packet_count,byte_count 
ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow14)  supports oxs 
(OXM-OpenFlow15,OXM-OpenFlow16).(Use -O to enable  additional OpenFlow versions)
  


 
We will send this patch in a day or two.
 
Thanks & Regards
 Satya Valli
 Tata Consultancy Services
 Mailto: satyavalli.r...@tcs.com
 Website: http://www.tcs.com
 
 Experience certainty.  IT Services
Business Solutions
Consulting
 
 

-Ben Pfaff <b...@ovn.org> wrote: -
To: Satyavalli Rama <satyavalli.r...@tcs.com>
From: Ben Pfaff <b...@ovn.org>
Date: 02/23/2018 11:55PM
Cc: Jan Scheurich <jan.scheur...@ericsson.com>, "d...@openvswitch.org" 
<d...@openvswitch.org>, SatyaValli <satyavalli.r...@gmail.com>, 
manasa.cherukupa...@tcs.com, muttamsetty.su...@tcs.com, p.pava...@tcs.com, 
Harivelam Lavanya <harivelam.lava...@tcs.com>
Subject: Re: [ovs-dev] [PATCH v3] OF1.5/EXT-334 OXS/Extensible Flow Entry 
Statistics Support

On Thu, Feb 22, 2018 at 08:29:11PM +0530, Satyavalli Rama wrote:
> Jan and Ben we requesting you both kindly provide your valuable inputs with 
> respect new enhancement i.e  adding  --oxs-stats option to the existing 
> commands. 
> If everything mentioned above is fine then we will share the updated patch 
> soon.

Seems reasonable, please send the revised patch.
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support

2018-02-22 Thread Satyavalli Rama
Hi Ben and Jan,

Much Thanks to both of your for you valuable inputs, we've addressed almost all 
the modifications you both mentioned.
Consolidating all the Inputs below are the quick updates and clarifications 
required.

 >> JAN and BEN Comment - 1) ovs-ofctl dump-flows" should provide similar 
 >> results for all versions of OpenFlow.
In OpenFlow 1.5, that means that it should use a "flow desc" requestrather than 
a "flow stats" request.

We've modified our patch as per the above comment i.e as per OF 1.5+  the 
OFPMP_FLOW_DESC request is used instead of the earlier OFPMP_FLOW.

>> JAN Comment - 2) I suggest to introduce a new command or add an option to 
>> dump-flows to force use of this particular MP message. The output would be 
>> limited to flow match and stats in that case. 

As per Jan's suggestion we've added an option to the dump-flows for the OF 1.5 
which will give an output which will show only flow stats for the requested OXS 
fields.

Like below:
  dump-flows switch [flows]
 
  By default, ovs-ofctl prints flow entries in the same order that 
the switch sends them along with the flow description flags
  Use  --oxs-stats[=field]
  Which displays the output with the requested OXS field/fields 
(packet-count, byte-count etc.,)
>> Jan Comment - 3 ) The new command to dump aggregate flow stats is of course 
>> a welcome addition.

This requirement will also get fulfilled with the addition of --oxs-stats 
option to the existing dump-aggregate command.

Like Below

 dump-aggregate switch [flows] 
 Use  --oxs-stats[=field]
Prints to the console aggregate statistics for flows with the 
requested OXS field/fields (packet-count, byte-count etc.,) 
  
Jan and Ben we requesting you both kindly provide your valuable inputs with 
respect new enhancement i.e  adding  --oxs-stats option to the existing 
commands. 
If everything mentioned above is fine then we will share the updated patch soon.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting



-Ben Pfaff  wrote: -
To: SatyaValli 
From: Ben Pfaff 
Date: 02/09/2018 11:23PM
Cc: d...@openvswitch.org, Manasa Cherukupally , 
Surya Muttamsetty , Pavani Panthagada 
, Satya Valli , Lavanya Harivelam 

Subject: Re: [ovs-dev] [PATCH v3] OF1.5/EXT-334 OXS/Extensible Flow Entry 
Statistics Support

On Tue, Feb 06, 2018 at 05:17:19PM +0530, SatyaValli wrote:
> From: SatyaValli 
> 
> This Patch provides implementation Existing flow entry statistics are
> redefined as standard OXS(OpenFlow Extensible Statistics) fields for
> displaying the arbitrary flow stats.The existing Flow Stats were renamed
> as Flow Description.

Thanks for the updated patch.

After a small amount of reading, I agree with Jan Scheurich.  "ovs-ofctl
dump-flows" should provide similar results for all versions of OpenFlow.
In OpenFlow 1.5, that means that it should use a "flow desc" request
rather than a "flow stats" request.

Thanks,

Ben.
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support

2018-02-02 Thread Satyavalli Rama
Hi Ben,

We didn't observed any test case breaks and we've updated the same with logs in 
our previous conversations.
Could you please provide your inputs regarding the Jan's comments about command 
syntax modifications.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting



-Ben Pfaff <b...@ovn.org> wrote: -
To: Satyavalli Rama <satyavalli.r...@tcs.com>
From: Ben Pfaff <b...@ovn.org>
Date: 02/02/2018 03:43AM
Cc: SatyaValli <satyavalli.r...@gmail.com>, "d...@openvswitch.org" 
<d...@openvswitch.org>, manasa.cherukupa...@tcs.com, p.pava...@tcs.com, 
Harivelam Lavanya <harivelam.lava...@tcs.com>, muttamsetty.su...@tcs.com, Jan 
Scheurich <jan.scheur...@ericsson.com>
Subject: Re: [ovs-dev] [PATCH V2] OF1.5/EXT-334 OXS/Extensible Flow Entry 
Statistics Support

At the very minimum I can't review a patch that breaks tests.

On Wed, Jan 31, 2018 at 05:29:12PM +0530, Satyavalli Rama wrote:
> Hi Ben,
> 
> Are you also agreeing with the Jan's comments.
> 
> Thanks & Regards
> Satya Valli
> Tata Consultancy Services
> Mailto: satyavalli.r...@tcs.com
> Website: http://www.tcs.com
> 
> Experience certainty. IT Services
> Business Solutions
> Consulting
> ________
> 
> 
> -Jan Scheurich <jan.scheur...@ericsson.com> wrote: -
> To: Satyavalli Rama <satyavalli.r...@tcs.com>, Ben Pfaff <b...@ovn.org>
> From: Jan Scheurich <jan.scheur...@ericsson.com>
> Date: 01/08/2018 06:31PM
> Cc: SatyaValli <satyavalli.r...@gmail.com>, "d...@openvswitch.org" 
> <d...@openvswitch.org>, "manasa.cherukupa...@tcs.com" 
> <manasa.cherukupa...@tcs.com>, "p.pava...@tcs.com" <p.pava...@tcs.com>, 
> Harivelam Lavanya <harivelam.lava...@tcs.com>, "muttamsetty.su...@tcs.com" 
> <muttamsetty.su...@tcs.com>
> Subject: RE: [ovs-dev] [PATCH V2] OF1.5/EXT-334 OXS/Extensible Flow Entry 
> Statistics Support
> 
> Hi Satyavalli,
>  
> Please find my responses below.
>  
> Regards, Jan
>  
> From: Satyavalli Rama [mailto:satyavalli.r...@tcs.com] 
> Sent: Friday, 05 January, 2018 12:25
> To: Ben Pfaff <b...@ovn.org>; Jan Scheurich <jan.scheur...@ericsson.com>
> Cc: SatyaValli <satyavalli.r...@gmail.com>; d...@openvswitch.org; 
> manasa.cherukupa...@tcs.com; p.pava...@tcs.com; Harivelam Lavanya 
> <harivelam.lava...@tcs.com>; muttamsetty.su...@tcs.com
> Subject: Re: [ovs-dev] [PATCH V2] OF1.5/EXT-334 OXS/Extensible Flow Entry 
> Statistics Support
>  
> Hi Jan and Ben,
>  
> Please find the inline responses.
>  
> 
> -Ben Pfaff <b...@ovn.org> wrote: -
> To: Jan Scheurich <jan.scheur...@ericsson.com>
> From: Ben Pfaff <b...@ovn.org>
> Date: 01/05/2018 02:35AM
> Cc: SatyaValli <satyavalli.r...@gmail.com>, "d...@openvswitch.org" 
> <d...@openvswitch.org>, Manasa Cherukupally <manasa.cherukupa...@tcs.com>, 
> Pavani Panthagada <p.pava...@tcs.com>, Lavanya Harivelam 
> <harivelam.lava...@tcs.com>, Surya Muttamsetty <muttamsetty.su...@tcs.com>, 
> SatyaValli <satyavalli.r...@tcs.com>
> Subject: Re: [ovs-dev] [PATCH V2] OF1.5/EXT-334 OXS/Extensible Flow Entry 
> Statistics Support
> 
> On Wed, Jan 03, 2018 at 04:24:06PM +, Jan Scheurich wrote:
> > > > >
> > > > > This Patch provides implementation Existing flow entry statistics are
> > > > > redefined as standard OXS(OpenFlow Extensible Statistics) fields for
> > > > > displaying the arbitrary flow stats.The existing Flow Stats were 
> > > > > renamed
> > > > > as Flow Description.
> > > > >
> > > > > To support this implementation below messages are newly added
> > > > >
> > > > > OFPRAW_OFPT15_FLOW_REMOVED,
> > > > > OFPRAW_OFPST15_FLOW_REQUEST,
> > > > > OFPRAW_OFPST15_FLOW_DESC_REQUEST,
> > > > > OFPRAW_OFPST15_AGGREGATE_REQUEST,
> > > > > OFPRAW_OFPST15_FLOW_REPLY,
> > > > > OFPRAW_OFPST15_FLOW_DESC_REPLY,
> > > > > OFPRAW_OFPST15_AGGREGATE_REPLY,
> > > > >
> > > > > The current commit adds support for the new feature in flow statistics
> > > > > multipart messages,aggregate multipart messages and OXS support for 
> > > > > flow
> > > > >

Re: [ovs-dev] [PATCH V2] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support

2018-01-05 Thread Satyavalli Rama
Hi Jan and Ben,

Please find the inline responses.


-Ben Pfaff  wrote: -
To: Jan Scheurich 
From: Ben Pfaff 
Date: 01/05/2018 02:35AM
Cc: SatyaValli , "d...@openvswitch.org" 
, Manasa Cherukupally , 
Pavani Panthagada , Lavanya Harivelam 
, Surya Muttamsetty , 
SatyaValli 
Subject: Re: [ovs-dev] [PATCH V2] OF1.5/EXT-334 OXS/Extensible Flow Entry 
Statistics Support

On Wed, Jan 03, 2018 at 04:24:06PM +, Jan Scheurich wrote:
> > > >
> > > > This Patch provides implementation Existing flow entry statistics are
> > > > redefined as standard OXS(OpenFlow Extensible Statistics) fields for
> > > > displaying the arbitrary flow stats.The existing Flow Stats were renamed
> > > > as Flow Description.
> > > >
> > > > To support this implementation below messages are newly added
> > > >
> > > > OFPRAW_OFPT15_FLOW_REMOVED,
> > > > OFPRAW_OFPST15_FLOW_REQUEST,
> > > > OFPRAW_OFPST15_FLOW_DESC_REQUEST,
> > > > OFPRAW_OFPST15_AGGREGATE_REQUEST,
> > > > OFPRAW_OFPST15_FLOW_REPLY,
> > > > OFPRAW_OFPST15_FLOW_DESC_REPLY,
> > > > OFPRAW_OFPST15_AGGREGATE_REPLY,
> > > >
> > > > The current commit adds support for the new feature in flow statistics
> > > > multipart messages,aggregate multipart messages and OXS support for flow
> > > > removal message, individual flow description messages.
> > > >
> > > > "ovs-ofctl dump-flows" needs to be provided with the arbitrary OXS 
> > > > fields
> > > > for displaying the desired flow stats.
> > > >
> > > > Below are Commands to display OXS stats field wise
> > > >
> > > > Flow Statistics Multipart
> > > > ovs-ofctl dump-flows -O OpenFlow15  idle_time
> > > > ovs-ofctl dump-flows -O OpenFlow15  packet_count
> > > > ovs-ofctl dump-flows -O OpenFlow15  byte_count
> > >
> > > This would break backward compatibility for one of the most frequently 
> > > used OVS CLI commands. Why don't you introduce a new
> > command such as "ovs-ofctl dump-flow-stats" for the new OXS stats?
> > 
> > I think you might be misinterpreting the meaning here.  It doesn't
> > appear to break compatibility, at least not in a major way, since it
> > doesn't do a lot of updates to the tests that would otherwise be
> > required.
> 
> Perhaps I am missing the point of some of these changes. I understand that 
> OVS needs to support the new extensible OXS flow stats syntax in OpenFlow 1.5 
> and the differentiated MP request/reply pairs OFPMP_FLOW_DESC (replacing the 
> former OFPMP_FLOW) and OFPMP_FLOW_STATS (just fetching flow stats per flow 
> w/o the rest of the flow data).
> 
> But I don't understand why this should have any impact on the existing CLI 
> command "ovs-ofctl dump-flows" and its output. This tool expressly fetches 
> and displays the complete flow dump from OVS, including match, 
> instructions/actions and statistics. When using OF 1.5 it should 
> transparently apply OFPMP_FLOW_DESC MP request/reply to fetch the data, up to 
> OF 1.4 it should use the original OFPMP_FLOW.
> 
> I can't see any ovs-ofctl use case that would justify the use of the new 
> OFPMP_FLOW_STATS request/reply. The removed data in the reply compared to the 
> full flow description are mainly the instructions, the full match is still 
> there to identify each flow. So cutting down the transferred data volume can 
> hardly be the reason (Note, this may still be different for real OF 1.5 
> controllers).
> 
> If you believe we should have an ovs-ofctl command anyhow, e.g. for testing 
> purposes, I suggest to introduce a new command or add an option to dump-flows 
> to force use of this particular MP message. The output would be limited to 
> flow match and stats in that case.
> 

As per our understanding and from previous review comments we treated OF1.5+ 
has two different ways to request and get replies for Flow Stats: FLOW_DESC and 
FLOW_STATS (which will be even used for Flow Stats Trigger). And we've 
supported this with the help of two commands

OFPMP_FLOW_DESC - ovs-ofctl dump-flow-desc -O OpenFlow15
OFPMP_FLOW_STATS - ovs-ofctl dump-flows -O OpenFlow15

> The new command to dump aggregate flow stats is of course a welcome addition. 
> It should work irrespectively of the used OpenFlow version with the 
> OFPMP_AGGREGATE_STATS primitive using classic flow stats prior to OF 1.5 and 
> OXS flow stats in OF 1.5.
> 
> All in all I am NACK-ing this patch as it stands.
> 
> Regards, Jan
> 
> BTW: I have played a bit with the patch. The existing ovs-ofctl test cases 
> appear to not break because the changes described in the commit message and 
> the documentation are not effective. The legacy command format "ovs-ofctl 
> dump-flows -O OpenFlow15  []" still produces the complete flow 
> dump including instructions/actions:
> 

We cross checked and tested the patch again on the latest OVS 

Re: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support

2017-09-13 Thread Satyavalli Rama
Hi Ben,

We have addressed all the review comments and submitted the updated patch.
Kindly review it once and provide your inputs for the same.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting





From:   Satyavalli Rama/HYD/TCS
To: Ben Pfaff <b...@ovn.org>
Cc: d...@openvswitch.org, Surya Muttamsetty 
<muttamsetty.su...@tcs.com>, SatyaValli <satyavalli.r...@gmail.com>, 
harivelam.lava...@tcs.com
Date:   08/04/2017 06:48 PM
Subject:Re: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow 
Entry Statistics Support


Hi Ben,

Much Thanks for the Review.
We will address the comments and will submit the updated patch soon.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting






From:   Ben Pfaff <b...@ovn.org>
To: SatyaValli <satyavalli.r...@gmail.com>
Cc: d...@openvswitch.org, Surya Muttamsetty 
<muttamsetty.su...@tcs.com>, SatyaValli <satyavalli.r...@tcs.com>
Date:   08/03/2017 01:41 AM
Subject:Re: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow 
Entry Statistics Support



Thanks for the revision.  I have some more comments.

On Mon, Jun 19, 2017 at 01:14:40PM +0530, SatyaValli wrote:
> commit 49a3592b2878a33033e5fd2e6e5ce82ebccef780
> Author: Satya Valli <satyavalli.r...@tcs.com>
> Co-authored-by: Lavanya Harivelam <harivelam.lava...@tcs.com>
> Co-authored-by: Surya Muttamsetty <muttamsetty.su...@tcs.com>

None of the above should be at the top of the commit message.  Coauthors
go with the sign-offs at the end.

> OpenVswitch: OF1.5/EXT-334 Extensible Flow Entry Statistics

Please don't repeat the subject again in the body.

> OpenFlow 1.5 introduces the Extensible Statistics (OXS) by redefining 
the existing
> flow entry statistics with OXS Fields.
> This Patch provides implementation for OXS fields encoding in TLV 
format.
> 
> To support this implementation below two messages are newly added
> 
> OFPST_OXS_FLOW_STATS_REQUEST
> OFPST_OXS_FLOW_STATS_REPLY
> OFPST_OXS_AGGREGATE_STATS_REQUEST
> OFPST_OXS_AGGREGATE_STATS_REPLY
> OFPST_FLOW_REMOVED

> As per the openflow specification-1.5, this enhancement should take 
place
> on the existing flow entry statistics with the OXS fields on all the 
messages
> that carries flow entry statistics.
> 
> The current commit adds support for the new feature in flow statistics 
multipart messages,
> aggregate multipart messages and OXS flow statistics support for flow 
removal message.
> 
> Some more fields are added to ovs-ofctl dump-flows command to support 
OpenFlow15 OXS stats.
> Below are Commands to display OXS stats field wise
> 
> Flow Statistics Multipart
> ovs-ofctl dump-flows -O OpenFlow15  oxs-duration
> ovs-ofctl dump-flows -O OpenFlow15  oxs-idle_time
> ovs-ofctl dump-flows -O OpenFlow15  oxs-packet_count
> ovs-ofctl dump-flows -O OpenFlow15  oxs-byte_count
> 
> Aggregate Flow Statistics Multipart
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-packet_count
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-byte_count
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-flow_count
> 
> Make Check Changes in  - ofproto.at and ofproto-dpif.at:
> For 1.5 version "flags"  variable has been removed from flow_stats_reply 
structure.
> For avoiding the make check failures for OF1.5 version add-flow with 
flags,
> below test cases has been modified for 1.5 version in respective .at 
files
> 
> Files   testcase
> ofproto.at  0884
> ofproto-dpif1126

Please don't refer to tests by number.  The numbers are not meaningful
and change often.  Use the name of the test.

> In ofproto.at there is one test case numbered 0884 and 1126 in 
ofproto-dpif.at
> which is validating flagsfor OF1.5 this testcase is not valid, because
> in stats reply flags are not explicitly communicated,I've removed this 
test case.
> Before removing this test case is failing for 1.5 version.
> 
> Since FLOW_REMOVED is not supported in OF1.5 version,
> testing has been done by adding test case in ofproto.at.
> While doing make check after adding test case we are able to see
> OFPT_FLOW_REMOVED (OF1.5) message has sent successfully.
> 
> But make check is failing because of Signal 15 termination,
> so we've removed that test case from the patch.

Why isn't FLOW_REMOVED supported in OF1.5

Re: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support

2017-08-04 Thread Satyavalli Rama
Hi Ben,

Much Thanks for the Review.
We will address the comments and will submit the updated patch soon.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting





From:   Ben Pfaff 
To: SatyaValli 
Cc: d...@openvswitch.org, Surya Muttamsetty 
, SatyaValli 
Date:   08/03/2017 01:41 AM
Subject:Re: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow 
Entry Statistics Support



Thanks for the revision.  I have some more comments.

On Mon, Jun 19, 2017 at 01:14:40PM +0530, SatyaValli wrote:
> commit 49a3592b2878a33033e5fd2e6e5ce82ebccef780
> Author: Satya Valli 
> Co-authored-by: Lavanya Harivelam 
> Co-authored-by: Surya Muttamsetty 

None of the above should be at the top of the commit message.  Coauthors
go with the sign-offs at the end.

> OpenVswitch: OF1.5/EXT-334 Extensible Flow Entry Statistics

Please don't repeat the subject again in the body.

> OpenFlow 1.5 introduces the Extensible Statistics (OXS) by redefining 
the existing
> flow entry statistics with OXS Fields.
> This Patch provides implementation for OXS fields encoding in TLV 
format.
> 
> To support this implementation below two messages are newly added
> 
> OFPST_OXS_FLOW_STATS_REQUEST
> OFPST_OXS_FLOW_STATS_REPLY
> OFPST_OXS_AGGREGATE_STATS_REQUEST
> OFPST_OXS_AGGREGATE_STATS_REPLY
> OFPST_FLOW_REMOVED

> As per the openflow specification-1.5, this enhancement should take 
place
> on the existing flow entry statistics with the OXS fields on all the 
messages
> that carries flow entry statistics.
> 
> The current commit adds support for the new feature in flow statistics 
multipart messages,
> aggregate multipart messages and OXS flow statistics support for flow 
removal message.
> 
> Some more fields are added to ovs-ofctl dump-flows command to support 
OpenFlow15 OXS stats.
> Below are Commands to display OXS stats field wise
> 
> Flow Statistics Multipart
> ovs-ofctl dump-flows -O OpenFlow15  oxs-duration
> ovs-ofctl dump-flows -O OpenFlow15  oxs-idle_time
> ovs-ofctl dump-flows -O OpenFlow15  oxs-packet_count
> ovs-ofctl dump-flows -O OpenFlow15  oxs-byte_count
> 
> Aggregate Flow Statistics Multipart
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-packet_count
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-byte_count
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-flow_count
> 
> Make Check Changes in  - ofproto.at and ofproto-dpif.at:
> For 1.5 version "flags"  variable has been removed from flow_stats_reply 
structure.
> For avoiding the make check failures for OF1.5 version add-flow with 
flags,
> below test cases has been modified for 1.5 version in respective .at 
files
> 
> Files   testcase
> ofproto.at  0884
> ofproto-dpif1126

Please don't refer to tests by number.  The numbers are not meaningful
and change often.  Use the name of the test.

> In ofproto.at there is one test case numbered 0884 and 1126 in 
ofproto-dpif.at
> which is validating flagsfor OF1.5 this testcase is not valid, because
> in stats reply flags are not explicitly communicated,I've removed this 
test case.
> Before removing this test case is failing for 1.5 version.
> 
> Since FLOW_REMOVED is not supported in OF1.5 version,
> testing has been done by adding test case in ofproto.at.
> While doing make check after adding test case we are able to see
> OFPT_FLOW_REMOVED (OF1.5) message has sent successfully.
> 
> But make check is failing because of Signal 15 termination,
> so we've removed that test case from the patch.

Why isn't FLOW_REMOVED supported in OF1.5?  Support is needed.  Signal
15 is SIGTERM, meaning that something actually used "kill" to kill it
intentionally.  Please investigate and fix the problem rather than
removing a test.

This adds features that users can use via ovs-ofctl, but it does not
document them.  Please document them in ovs-ofctl(8).  Please also add
appropriate NEWS items to explain the new features.

This adds support for new OpenFlow messages, but it does not add any
tests for printing them in ofp-print.at.  Please add at least one
representative test there for every new message.

struct ofp15_flow_removed doesn't seem to be the same as
ofp_flow_removed in OpenFlow 1.5.

This adds a global variable oxs_field_set.  This is inappropriate.  Do
not use global variables.

The variable oxs_field_set has a bunch of unnamed magic numbers.  This
is inappropriate.  Do not use unnamed magic numbers.

This code is weird.  Fix it please:

+if (parse_oxs_field(name, )) {
+if (f->fl_type == OFPXST_OFB_DURATION) {
+oxs_field_set |= (1 << 

Re: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support

2017-06-19 Thread Satyavalli Rama
Hi Ben,

Much Thanks for your initial reveiw comments.
We have addressed almost all problems and re-submitted the patch except the 
below two lines.

"checkpatch" reports:

warning: 1 line adds whitespace errors.
WARNING: Line length is >79-characters long
#137 FILE: include/openvswitch/ofp-msgs.h:656:
OFPTYPE_OXS_AGGREGATE_STATS_REQUEST, /* 
OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST. */

WARNING: Line length is >79-characters long
#138 FILE: include/openvswitch/ofp-msgs.h:657:
OFPTYPE_OXS_AGGREGATE_STATS_REPLY, /* 
OFPRAW_OFPST15_OXS_AGGREGATE_REPLY. */

We tried to address the above two lines also, but we are getting "unexpected 
syntax within OFPTYPE_ definition" error as below, if we are trying to adjust 
them.
PYTHONPATH=./python":"$PYTHONPATH PYTHONDONTWRITEBYTECODE=yes /usr/bin/python 
./build-aux/extract-ofp-msgs \
./include/openvswitch/ofp-msgs.h lib/ofp-msgs.inc > 
lib/ofp-msgs.inc.tmp && mv lib/ofp-msgs.inc.tmp lib/ofp-msgs.inc
./include/openvswitch/ofp-msgs.h:659: unexpected syntax within OFPTYPE_ 
definition
make[2]: *** [lib/ofp-msgs.inc] Error 1
make[2]: Leaving directory `/home/tcs/freshgitjune15/ovsfinalpatch/ovs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tcs/freshgitjune15/ovsfinalpatch/ovs'
make: *** [all] Error 2


Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting



-Ben Pfaff  wrote: -
To: SatyaValli 
From: Ben Pfaff 
Date: 06/15/2017 02:38AM
Cc: d...@openvswitch.org, SatyaValli 
Subject: Re: [ovs-dev] [PATCH] OF1.5/EXT-334 OXS/Extensible Flow Entry 
Statistics Support

On Fri, Jun 09, 2017 at 01:26:51PM +0530, SatyaValli wrote:
> commit 49a3592b2878a33033e5fd2e6e5ce82ebccef780
> Author: Satya Valli 
> 
> OpenVswitch: OF1.5/EXT-334 Extensible Flow Entry Statistics
> 
> OpenFlow 1.5 introduces the Extensible Statistics (OXS) by redefining the 
> existing
> flow entry statistics with OXS Fields.
> This Patch provides implementation for OXS fields encoding in TLV format.
> 
> To support this implementation below two messages are newly added
> 
> OFPST_OXS_FLOW_STATS_REQUEST
> OFPST_OXS_FLOW_STATS_REPLY
> OFPST_OXS_AGGREGATE_STATS_REQUEST
> OFPST_OXS_AGGREGATE_STATS_REPLY
> OFPST_FLOW_REMOVED
> 
> As per the openflow specification-1.5, this enhancement should take place
> on the existing flow entry statistics with the OXS fields on all the messages
> that carries flow entry statistics.
> 
> The current commit adds support for the new feature in flow statistics 
> multipart messages,
> aggregate multipart messages and OXS flow statistics support for flow removal 
> message.
> 
> Some more fields are added to ovs-ofctl dump-flows command to support 
> OpenFlow15 OXS stats.
> Below are Commands to display OXS stats field wise
> 
> Flow Statistics Multipart
> ovs-ofctl dump-flows -O OpenFlow15  oxs-duration
> ovs-ofctl dump-flows -O OpenFlow15  oxs-idle_time
> ovs-ofctl dump-flows -O OpenFlow15  oxs-packet_count
> ovs-ofctl dump-flows -O OpenFlow15  oxs-byte_count
> 
> Aggregate Flow Statistics Multipart
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-packet_count
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-byte_count
> ovs-ofctl dump-aggregate -O OpenFlow15  oxs-flow_count
> 
> Signed-off-by: Satya Valli 
> Co-authored-by: Lavanya Harivelam  and Surya 
> Muttamsetty 

Thank you for working on Open vSwitch.

"Co-authored-by" takes only one name.  Please use multiple
"Co-authored-by" tags if you have more than one coauthor.

"checkpatch" reports:

warning: 1 line adds whitespace errors.
WARNING: Line length is >79-characters long
#137 FILE: include/openvswitch/ofp-msgs.h:656:
OFPTYPE_OXS_AGGREGATE_STATS_REQUEST, /* 
OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST. */

WARNING: Line length is >79-characters long
#138 FILE: include/openvswitch/ofp-msgs.h:657:
OFPTYPE_OXS_AGGREGATE_STATS_REPLY, /* 
OFPRAW_OFPST15_OXS_AGGREGATE_REPLY. */

ERROR: Inappropriate bracing around statement
#483 FILE: lib/ofp-util.c:3331:
if (error)

ERROR: Improper whitespace around control block
#1114 FILE: lib/ox-stat.c:534:
HMAP_FOR_EACH_IN_BUCKET(oxfs, header_node, hash_int(header_no_len, 0),

ERROR: Improper whitespace around control block
#1135 FILE: lib/ox-stat.c:555:
LIST_FOR_EACH(oxfs, ox_node, _ox_map[id]) {

ERROR: Improper whitespace around control block
#1298 FILE: lib/ox-stat.c:718:
 if(fs) {

ERROR: Improper whitespace around control block
#1308 FILE: lib/ox-stat.c:728:
 if(fs) {

ERROR: Improper whitespace around 

[ovs-dev] [PATCH 6/6] OF1.5/EXT-334 OXS/Flow Removal -2

2017-05-17 Thread satyavalli . rama
From: Harivelam Lavanya 

Since FLOW_REMOVED is not supported in OF1.5 version,
testing has been done by adding test case in ofproto.at.
While doing make check after adding test case we are able to see
OFPT_FLOW_REMOVED (OF1.5) message has sent successfully.

But make check is failing because of Signal 15 termination,
so we've removed that test case from the patch.

Signed-off-by: Harivelam Lavanya  
Co-authored-by: Satya Valli  

---
 lib/ofp-util.c |  41 ++-
 lib/ox-stat.c  | 225 +
 2 files changed, 262 insertions(+), 4 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index f0c96db..a63c643 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -3346,7 +3346,23 @@ ofputil_decode_flow_removed(struct ofputil_flow_removed 
*fr,
 {
 struct ofpbuf b = ofpbuf_const_initializer(oh, ntohs(oh->length));
 enum ofpraw raw = ofpraw_pull_assert();
-if (raw == OFPRAW_OFPT11_FLOW_REMOVED) {
+if (raw == OFPRAW_OFPT15_FLOW_REMOVED) {
+const struct ofp15_flow_removed *ofr;
+enum ofperr error;
+
+ofr = ofpbuf_pull(, sizeof *ofr);
+
+error = ofputil_pull_ofp11_match(, NULL, NULL,  >match, NULL);
+if (error) {
+return error;
+}
+oxs_flow_removed_stat_pull(,fr);
+
+fr->priority = ntohs(ofr->priority);
+fr->cookie = ofr->cookie;
+fr->reason = ofr->reason;
+fr->table_id = ofr->table_id;
+} else if (raw == OFPRAW_OFPT11_FLOW_REMOVED) {
 const struct ofp12_flow_removed *ofr;
 enum ofperr error;
 
@@ -3429,12 +3445,29 @@ ofputil_encode_flow_removed(const struct 
ofputil_flow_removed *fr,
 }
 
 switch (protocol) {
+case OFPUTIL_P_OF15_OXM:
+case OFPUTIL_P_OF16_OXM: {
+struct ofp15_flow_removed *ofr;
+
+msg = ofpraw_alloc_xid(OFPRAW_OFPT15_FLOW_REMOVED,
+   ofputil_protocol_to_ofp_version(protocol),
+   htonl(0),
+   ofputil_match_typical_len(protocol));
+ofr = ofpbuf_put_zeros(msg, sizeof *ofr);
+ofr->cookie = fr->cookie;
+ofr->priority = htons(fr->priority);
+ofr->reason = reason;
+ofr->table_id = fr->table_id;
+ofputil_put_ofp11_match(msg, >match, protocol);
+/*Stats encoding in OXS TLV Format*/
+oxs_flow_removed_stat_put(msg,fr,protocol);
+break;
+}
+
 case OFPUTIL_P_OF11_STD:
 case OFPUTIL_P_OF12_OXM:
 case OFPUTIL_P_OF13_OXM:
-case OFPUTIL_P_OF14_OXM:
-case OFPUTIL_P_OF15_OXM:
-case OFPUTIL_P_OF16_OXM: {
+case OFPUTIL_P_OF14_OXM: {
 struct ofp12_flow_removed *ofr;
 
 msg = ofpraw_alloc_xid(OFPRAW_OFPT11_FLOW_REMOVED,
diff --git a/lib/ox-stat.c b/lib/ox-stat.c
index 4cfcff7..d83ba00 100644
--- a/lib/ox-stat.c
+++ b/lib/ox-stat.c
@@ -150,6 +150,11 @@ static enum ofperr oxs_pull_raw(const uint8_t *, unsigned 
int ,
 ovs_be64 * cookie, ovs_be64 * cookie_mask);
 static enum ofperr oxs_pull_agg_raw(const uint8_t * p, unsigned int stat_len,
 struct ofputil_aggregate_stats *fs);
+static int oxs_flow_rem_stat_fields_pull(const uint8_t *p,
+ unsigned int stat_len,
+ struct ofputil_flow_removed *fr);
+static int oxs_pull_flow_rem_stat_entry(struct ofpbuf *b,
+struct ofputil_flow_removed *fr);
 static void oxs_init(void);
 static void oxs_put_header__(struct ofpbuf *b, uint64_t header);
 static void oxs_put_header_len(struct ofpbuf *b,
@@ -157,6 +162,18 @@ static void oxs_put_header_len(struct ofpbuf *b,
enum ofp_version version);
 static int ox_put_agg_raw(struct ofpbuf *b, enum ofp_version oxs,
   const struct ofputil_aggregate_stats *fs);
+static void oxs_put_duration(struct ofpbuf *b,
+ const struct ofputil_flow_removed *fr,
+ enum ofp_version version);
+static void oxs_put_packet_count(struct ofpbuf *b,
+ const struct ofputil_flow_removed *fr,
+ enum ofp_version version);
+static void oxs_put_byte_count(struct ofpbuf *b,
+   const struct ofputil_flow_removed *fr,
+   enum ofp_version version);
+static int oxs_flow_rem_stat_fields_put(struct ofpbuf *b,
+const struct ofputil_flow_removed *fr,
+enum ofp_version version);
 
 static bool
 is_experimenter_oxs(uint64_t header)
@@ -765,3 +782,211 @@ oxs_put_agg_stat(struct ofpbuf *b, const struct 
ofputil_aggregate_stats *fs,
return stat_len;
 }
 
+static void
+oxs_put_duration(struct 

[ovs-dev] [PATCH 5/6] OF1.5/EXT-334 OXS/Flow Removal -1

2017-05-17 Thread satyavalli . rama
From: SatyaValli 

OXS support for FLOW REMOVED messages

Signed-off-by: Satya Valli  
Co-authored-by: Harivelam Lavanya 
---
 include/openflow/openflow-1.5.h | 11 +++
 include/openvswitch/ofp-msgs.h  |  3 +++
 lib/ox-stat.h   |  6 ++
 3 files changed, 20 insertions(+)

diff --git a/include/openflow/openflow-1.5.h b/include/openflow/openflow-1.5.h
index 3b66f7f..f8a95dd 100644
--- a/include/openflow/openflow-1.5.h
+++ b/include/openflow/openflow-1.5.h
@@ -200,4 +200,15 @@ enum oxs_ofb_stat_fields {
 OFPXST_OFB_BYTE_COUNT = 4,   /* Number of bytes in flow entry.  */
 };
 
+/* Flow removed (datapath -> controller). */
+struct ofp15_flow_removed {
+ovs_be64 cookie;/* Opaque controller-issued identifier. */
+ovs_be16 priority;  /* Priority level of flow entry. */
+uint8_t reason; /* One of OFPRR_*. */
+uint8_t table_id;   /* ID of the table */
+uint8_t pad2[4];/* Align to 64-bits. */
+};
+
+OFP_ASSERT(sizeof (struct ofp15_flow_removed) == 16);
+
 #endif /* openflow/openflow-1.5.h */
diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
index 7d49bc7..3763261 100644
--- a/include/openvswitch/ofp-msgs.h
+++ b/include/openvswitch/ofp-msgs.h
@@ -163,6 +163,8 @@ enum ofpraw {
 OFPRAW_OFPT10_FLOW_REMOVED,
 /* OFPT 1.1+ (11): struct ofp11_flow_removed, uint8_t[8][]. */
 OFPRAW_OFPT11_FLOW_REMOVED,
+/* OFPT 1.5+ (35): struct ofp15_flow_removed,uint8_t[8][]. */
+OFPRAW_OFPT15_FLOW_REMOVED,
 /* NXT 1.0+ (14): struct nx_flow_removed, uint8_t[8][]. */
 OFPRAW_NXT_FLOW_REMOVED,
 
@@ -561,6 +563,7 @@ enum ofptype {
   * OFPRAW_NXT_PACKET_IN. */
 OFPTYPE_FLOW_REMOVED,/* OFPRAW_OFPT10_FLOW_REMOVED.
   * OFPRAW_OFPT11_FLOW_REMOVED.
+  * OFPRAW_OFPT15_FLOW_REMOVED.
   * OFPRAW_NXT_FLOW_REMOVED. */
 OFPTYPE_PORT_STATUS, /* OFPRAW_OFPT10_PORT_STATUS.
   * OFPRAW_OFPT11_PORT_STATUS.
diff --git a/lib/ox-stat.h b/lib/ox-stat.h
index 3ff7f07..826bbe4 100644
--- a/lib/ox-stat.h
+++ b/lib/ox-stat.h
@@ -33,4 +33,10 @@ int oxs_pull_stat(struct ofpbuf *,struct ofputil_flow_stats 
*,
 int oxs_put_agg_stat(struct ofpbuf *, const struct ofputil_aggregate_stats *,
  enum ofp_version);
 int oxs_pull_agg_stat(struct ofpbuf , struct ofputil_aggregate_stats *);
+int oxs_flow_removed_stat_put(struct ofpbuf *b,
+  const struct ofputil_flow_removed *fr,
+  enum ofp_version version);
+int oxs_flow_removed_stat_pull(struct ofpbuf *b,
+   struct ofputil_flow_removed *ofr);
+
 #endif /* ox_stat.h */
-- 
1.9.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 3/6] OF1.5/EXT-334 OXS/Aggregate Flow Statistics -1

2017-05-17 Thread satyavalli . rama
From: SatyaValli 

OXS support Aggregate Multipart Statistiscs

Signed-off-by:  Satya Valli 
Co-authored-by: Muttamsetty Surya 
---
 include/openvswitch/ofp-msgs.h | 6 ++
 lib/ofp-print.c| 6 ++
 lib/ofp-util.c | 9 -
 lib/rconn.c| 2 ++
 ofproto/ofproto.c  | 4 
 5 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
index 089db47..7d49bc7 100644
--- a/include/openvswitch/ofp-msgs.h
+++ b/include/openvswitch/ofp-msgs.h
@@ -307,11 +307,15 @@ enum ofpraw {
 OFPRAW_OFPST10_AGGREGATE_REQUEST,
 /* OFPST 1.1+ (2): struct ofp11_flow_stats_request, uint8_t[8][]. */
 OFPRAW_OFPST11_AGGREGATE_REQUEST,
+/* OFPST 1.5+ (18): struct ofp15_oxs_flow_stats_request, uint8_t[8][]. */
+OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST,
 /* NXST 1.0 (1): struct nx_flow_stats_request, uint8_t[8][]. */
 OFPRAW_NXST_AGGREGATE_REQUEST,
 
 /* OFPST 1.0+ (2): struct ofp_aggregate_stats_reply. */
 OFPRAW_OFPST_AGGREGATE_REPLY,
+/* OFPST 1.5+ (18): uint8_t[] . */
+OFPRAW_OFPST15_OXS_AGGREGATE_REPLY,
 /* NXST 1.0 (1): struct ofp_aggregate_stats_reply. */
 OFPRAW_NXST_AGGREGATE_REPLY,
 
@@ -640,9 +644,11 @@ enum ofptype {
 OFPTYPE_AGGREGATE_STATS_REQUEST, /* OFPRAW_OFPST10_AGGREGATE_REQUEST.
   * OFPRAW_OFPST11_AGGREGATE_REQUEST.
   * OFPRAW_NXST_AGGREGATE_REQUEST. */
+OFPTYPE_OXS_AGGREGATE_STATS_REQUEST, /* 
OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST. */
 OFPTYPE_OXS_FLOW_STATS_REPLY,/* OFPRAW_OFPST15_OXS_FLOW_REPLY. */
 OFPTYPE_AGGREGATE_STATS_REPLY,   /* OFPRAW_OFPST_AGGREGATE_REPLY.
   * OFPRAW_NXST_AGGREGATE_REPLY. */
+OFPTYPE_OXS_AGGREGATE_STATS_REPLY, /* OFPRAW_OFPST15_OXS_AGGREGATE_REPLY. 
*/
 OFPTYPE_TABLE_STATS_REQUEST, /* OFPRAW_OFPST_TABLE_REQUEST. */
 OFPTYPE_TABLE_STATS_REPLY,   /* OFPRAW_OFPST10_TABLE_REPLY.
   * OFPRAW_OFPST11_TABLE_REPLY.
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 0f855fa..c209c19 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -3564,6 +3564,7 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw 
raw,
 break;
 
 case OFPTYPE_OXS_FLOW_STATS_REQUEST:
+case OFPTYPE_OXS_AGGREGATE_STATS_REQUEST:
 ofp_print_stats(string, oh);
 ofp_print_flow_stats_request(string, oh);
 break;
@@ -3597,6 +3598,11 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw 
raw,
 ofp_print_flow_stats_reply(string, oh);
 break;
 
+case OFPTYPE_OXS_AGGREGATE_STATS_REPLY:
+ofp_print_stats(string, oh);
+ofp_print_aggregate_stats_reply(string, oh);
+break;
+
 case OFPTYPE_QUEUE_STATS_REPLY:
 ofp_print_stats(string, oh);
 ofp_print_ofpst_queue_reply(string, oh, verbosity);
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 4813d77..adb87eb 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -2805,6 +2805,11 @@ ofputil_decode_flow_stats_request(struct 
ofputil_flow_stats_request *fsr,
 return ofputil_decode_ofpst15_flow_request(fsr, , false, tun_table,
vl_mff_map);
 
+case OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST:
+oxs_field_set = 0;
+return ofputil_decode_ofpst15_flow_request(fsr, , true, tun_table,
+   vl_mff_map);
+
 case OFPRAW_NXST_FLOW_REQUEST:
 return ofputil_decode_nxst_flow_request(fsr, , false, tun_table,
 vl_mff_map);
@@ -2835,7 +2840,7 @@ ofputil_encode_flow_stats_request(const struct 
ofputil_flow_stats_request *fsr,
 struct ofp15_oxs_flow_stats_request *ofsr;
 
 raw = (fsr->aggregate
-   ? OFPRAW_OFPST11_AGGREGATE_REQUEST
+   ? OFPRAW_OFPST15_OXS_AGGREGATE_REQUEST 
: OFPRAW_OFPST15_OXS_FLOW_REQUEST);
 msg = ofpraw_alloc(raw, ofputil_protocol_to_ofp_version(protocol),
ofputil_match_typical_len(protocol));
@@ -10267,6 +10272,7 @@ ofputil_is_bundlable(enum ofptype type)
 case OFPTYPE_FLOW_STATS_REQUEST:
 case OFPTYPE_OXS_FLOW_STATS_REQUEST:
 case OFPTYPE_AGGREGATE_STATS_REQUEST:
+case OFPTYPE_OXS_AGGREGATE_STATS_REQUEST:
 case OFPTYPE_TABLE_STATS_REQUEST:
 case OFPTYPE_TABLE_FEATURES_STATS_REQUEST:
 case OFPTYPE_TABLE_DESC_REQUEST:
@@ -10299,6 +10305,7 @@ ofputil_is_bundlable(enum ofptype type)
 case OFPTYPE_PORT_STATS_REPLY:
 case OFPTYPE_TABLE_STATS_REPLY:
 case OFPTYPE_AGGREGATE_STATS_REPLY:
+case OFPTYPE_OXS_AGGREGATE_STATS_REPLY:
 case OFPTYPE_PORT_DESC_STATS_REPLY:
 case OFPTYPE_ROLE_REPLY:
 case OFPTYPE_FLOW_MONITOR_PAUSED:

[ovs-dev] [PATCH 2/6] OF1.5/EXT-334 OXS/Individal Flow Statistics -2

2017-05-17 Thread satyavalli . rama
From: Harivelam Lavanya 


Changes in ofproto.at and ofproto-dpif.at :-  

For 1.5 version "flags"  variable has been removed from flow_stats_reply 
structure.
For avoiding the make check failures for OF1.5 version add-flow with flags,
below test cases has been modified for 1.5 version in respective .at files

Files   testcase  
ofproto.at  0884
ofproto-dpif1126

In ofproto.at there is one test case numbered 0884 and 1126 in ofproto-dpif.at 
which is validating flagsfor OF1.5 this testcase is not valid, because
in stats reply flags are not explicitly communicated,I've removed this test 
case.
Before removing this test case is failing for 1.5 version.

Signed-off-by:  Lavanya Harivelam 
Co-authored-by: Satya Valli 

---
 lib/ofp-util.c| 125 -
 lib/ox-stat.c | 365 +-
 lib/ox-stat.h |   3 +-
 tests/ofproto-dpif.at |   1 -
 tests/ofproto.at  |   4 -
 5 files changed, 487 insertions(+), 11 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index bdf89b6..4813d77 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -50,9 +50,12 @@
 #include "unaligned.h"
 #include "util.h"
 #include "uuid.h"
+#include "ox-stat.h"
 
 VLOG_DEFINE_THIS_MODULE(ofp_util);
 
+extern uint8_t oxs_field_set;
+
 /* Rate limit for OpenFlow message parse errors.  These always indicate a bug
  * in the peer and so there's not much point in showing a lot of them. */
 static struct vlog_rate_limit bad_ofmsg_rl = VLOG_RATE_LIMIT_INIT(1, 5);
@@ -2314,6 +2317,40 @@ ofputil_decode_ofpst11_flow_request(struct 
ofputil_flow_stats_request *fsr,
 }
 
 static enum ofperr
+ofputil_decode_ofpst15_flow_request(struct ofputil_flow_stats_request *fsr,
+struct ofpbuf *b, bool aggregate,
+const struct tun_table *tun_table,
+const struct vl_mff_map *vl_mff_map)
+{
+const struct ofp15_oxs_flow_stats_request *ofsr;
+enum ofperr error, stat_error;
+uint16_t statlen;
+
+ofsr = ofpbuf_pull(b, sizeof *ofsr);
+fsr->aggregate = aggregate;
+fsr->table_id = ofsr->table_id;
+
+error = ofputil_port_from_ofp11(ofsr->out_port, >out_port);
+if (error) {
+return error;
+}
+
+fsr->out_group = ntohl(ofsr->out_group);
+fsr->cookie = ofsr->cookie;
+fsr->cookie_mask = ofsr->cookie_mask;
+
+error = ofputil_pull_ofp11_match(b, tun_table, vl_mff_map, >match,
+ NULL);
+stat_error = oxs_pull_stat(b, NULL, );
+
+if (error || stat_error) {
+return error;
+}
+
+return 0;
+}
+
+static enum ofperr
 ofputil_decode_nxst_flow_request(struct ofputil_flow_stats_request *fsr,
  struct ofpbuf *b, bool aggregate,
  const struct tun_table *tun_table,
@@ -2763,6 +2800,11 @@ ofputil_decode_flow_stats_request(struct 
ofputil_flow_stats_request *fsr,
 return ofputil_decode_ofpst11_flow_request(fsr, , true, tun_table,
vl_mff_map);
 
+case OFPRAW_OFPST15_OXS_FLOW_REQUEST:
+oxs_field_set = 0;
+return ofputil_decode_ofpst15_flow_request(fsr, , false, tun_table,
+   vl_mff_map);
+
 case OFPRAW_NXST_FLOW_REQUEST:
 return ofputil_decode_nxst_flow_request(fsr, , false, tun_table,
 vl_mff_map);
@@ -2788,12 +2830,29 @@ ofputil_encode_flow_stats_request(const struct 
ofputil_flow_stats_request *fsr,
 enum ofpraw raw;
 
 switch (protocol) {
+case OFPUTIL_P_OF15_OXM:
+case OFPUTIL_P_OF16_OXM: {
+struct ofp15_oxs_flow_stats_request *ofsr;
+
+raw = (fsr->aggregate
+   ? OFPRAW_OFPST11_AGGREGATE_REQUEST
+   : OFPRAW_OFPST15_OXS_FLOW_REQUEST);
+msg = ofpraw_alloc(raw, ofputil_protocol_to_ofp_version(protocol),
+   ofputil_match_typical_len(protocol));
+ofsr = ofpbuf_put_zeros(msg, sizeof *ofsr);
+ofsr->table_id = fsr->table_id;
+ofsr->out_port = ofputil_port_to_ofp11(fsr->out_port);
+ofsr->out_group = htonl(fsr->out_group);
+ofsr->cookie = fsr->cookie;
+ofsr->cookie_mask = fsr->cookie_mask;
+ofputil_put_ofp11_match(msg, >match, protocol);
+oxs_put_stat(msg, NULL, ofputil_protocol_to_ofp_version(protocol));
+break;
+}
 case OFPUTIL_P_OF11_STD:
 case OFPUTIL_P_OF12_OXM:
 case OFPUTIL_P_OF13_OXM:
-case OFPUTIL_P_OF14_OXM:
-case OFPUTIL_P_OF15_OXM:
-case OFPUTIL_P_OF16_OXM: {
+case OFPUTIL_P_OF14_OXM: {
 struct ofp11_flow_stats_request *ofsr;
 
 raw = (fsr->aggregate
@@ -2893,6 +2952,46 @@ ofputil_decode_flow_stats_reply(struct 
ofputil_flow_stats *fs,
 

[ovs-dev] [PATCH 1/6] OF1.5/EXT-334 OXS/Individal Flow Statistics -1

2017-05-17 Thread satyavalli . rama
From: SatyaValli 

OpenFlow 1.5 introduces the Extensible Statistics (OXS) by redefining the 
existing
flow entry statistics with OXS Fields.
This Patch provides implementation for OXS fields encoding in TLV format.

To support this implementation below two messages are newly added

OFPST_OXS_FLOW_STATS_REQUEST
OFPST_OXS_FLOW_STATS_REPLY
OFPST_OXS_AGGREGATE_STATS_REQUEST
OFPST_OXS_AGGREGATE_STATS_REPLY
OFPST_FLOW_REMOVED

As per the openflow specification-1.5, this enhancement should take place
on the existing flow entry statistics with the OXS fields on all the messages
that carries flow entry statistics.

The current commit adds support for the new feature in flow statistics 
multipart messages,
aggregate multipart messages and OXS flow statistics support for flow removal 
message.

Some more fields are added to ovs-ofctl dump-flows command to support 
OpenFlow15 OXS stats.
Below are Commands to display OXS stats field wise

Flow Statistics Multipart
ovs-ofctl dump-flows -O OpenFlow15  oxs-duration
ovs-ofctl dump-flows -O OpenFlow15  oxs-idle_time
ovs-ofctl dump-flows -O OpenFlow15  oxs-packet_count
ovs-ofctl dump-flows -O OpenFlow15  oxs-byte_count

Aggregate Flow Statistics Multipart
ovs-ofctl dump-aggregate -O OpenFlow15  oxs-packet_count
ovs-ofctl dump-aggregate -O OpenFlow15  oxs-byte_count
ovs-ofctl dump-aggregate -O OpenFlow15  oxs-flow_count

For feature vise verification please apply 
Patch 1 and 2 for OXS support for Flow multiplart stats support
Patch 3 and 4 for OXS support for Aggregate multipart stats support
Patch 5 and 6 for OXS support for Flow Removal   

Signed-off-by: Satya Valli 
Co-authored-by: Lavanya Harivelam 

---
 include/openflow/openflow-1.5.h |  50 +
 include/openvswitch/ofp-msgs.h  |   6 +
 lib/automake.mk |   2 +
 lib/ofp-parse.c |  45 +++-
 lib/ofp-print.c |  10 ++
 lib/ox-stat.c   | 238 
 lib/ox-stat.h   |  32 ++
 lib/rconn.c |   2 +
 ofproto/ofproto.c   |   4 +
 9 files changed, 388 insertions(+), 1 deletion(-)
 create mode 100644 lib/ox-stat.c
 create mode 100644 lib/ox-stat.h

diff --git a/include/openflow/openflow-1.5.h b/include/openflow/openflow-1.5.h
index 3649e6c..3b66f7f 100644
--- a/include/openflow/openflow-1.5.h
+++ b/include/openflow/openflow-1.5.h
@@ -150,4 +150,54 @@ struct ofp15_group_desc_stats {
 };
 OFP_ASSERT(sizeof(struct ofp15_group_desc_stats) == 16);
 
+struct ofp_oxs_stat {
+ovs_be16 reserved;  /* One of OFPST_* */
+ovs_be16 length;/* Stats Length */
+};
+
+OFP_ASSERT(sizeof(struct ofp_oxs_stat) == 4);
+
+/* Body for ofp_multipart_request of type
+* OFPMP_FLOW_DESC & OFPMP_FLOW_STATS. */
+struct ofp15_oxs_flow_stats_request {
+uint8_t table_id;   /* ID of table to read (from ofp_table_desc),
+ * OFPTT_ALL for all tables. */
+uint8_t pad[3]; /* Align to 32 bits. */
+ovs_be32 out_port;  /* Require matching entries to include this as
+ * an output port. A value of OFP_ANY
+ * indicates no restriction. */
+ovs_be32 out_group; /* Require matching entries to include this as
+ * an output group. A value of OFPG_ANY
+ * indicates no restriction. */
+uint8_t pad2[4];/* Align to 64 bits. */
+ovs_be64 cookie;/* Require matching entries to contain this
+ * cookie value */
+ovs_be64 cookie_mask;   /* Mask used to restrict the cookie bits that
+ * must match. A value of 0 indicates no
+ * restriction. */
+};
+
+OFP_ASSERT(sizeof(struct ofp15_oxs_flow_stats_request) == 32);
+
+/* Body of reply to OFPMP_FLOW_STATS request
+* and body for OFPIT_STAT_TRIGGER generated status. */
+struct ofp15_oxs_flow_stats_reply {
+ovs_be16 length;/* Length of this entry.  */
+uint8_t pad2[2];/* Align to 64-bits.  */
+uint8_t table_id;   /* ID of table flow came from. */
+uint8_t reason; /* One of OFPFSR_*.  */
+ovs_be16 priority;  /* Priority of the entry.  */
+};
+
+OFP_ASSERT(sizeof(struct ofp15_oxs_flow_stats_reply) == 8);
+
+/* OXS flow stat field types for OpenFlow basic class. */
+enum oxs_ofb_stat_fields {
+OFPXST_OFB_DURATION = 0, /* Time flow entry has been alive.  */
+OFPXST_OFB_IDLE_TIME = 1,/* Time flow entry has been idle.  */
+OFPXST_OFB_FLOW_COUNT = 2,   /* Number of aggregated flow entries. */
+OFPXST_OFB_PACKET_COUNT = 3, /* Number of packets in flow entry.  */
+OFPXST_OFB_BYTE_COUNT = 4,   /* Number of bytes in flow entry.  */
+};
+
 #endif /* 

Re: [ovs-dev] [PATCH 1/2] OF1.5/EXT-334 OXS/Individal Flow Statistics

2017-05-12 Thread Satyavalli Rama
Surely Ben.

Aaron thanks for the initial feedback will definitely address them.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting



-Ben Pfaff <b...@ovn.org> wrote: -
To: Satyavalli Rama <satyavalli.r...@tcs.com>
From: Ben Pfaff <b...@ovn.org>
Date: 05/12/2017 07:28PM
Cc: d...@openvswitch.org, Aaron Conole <acon...@redhat.com>
Subject: Re: [ovs-dev] [PATCH 1/2] OF1.5/EXT-334 OXS/Individal Flow Statistics

Even if you are sending fresh patches, I hope you will consider Aaron's 
comments.

On May 12, 2017 9:56 AM, Satyavalli Rama <satyavalli.r...@tcs.com> wrote:
Hi Aaron

Please ignore the current patch.  
Due to some proxy issues we were unable to send the complete patches.   
Soon, we wil submitt fresh patches.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting



-Aaron Conole <acon...@redhat.com> wrote: -
To: Ben Pfaff <b...@ovn.org>, Satya Valli <satyavalli.r...@tcs.com>
From: Aaron Conole <acon...@redhat.com>
Date: 05/11/2017 11:23PM
Cc: d...@openvswitch.org,
Subject: Re: [ovs-dev] [PATCH 1/2] OF1.5/EXT-334 OXS/Individal Flow Statistics

Hi Satya,

I haven't checked the OF1.5 spec with this, yet.  Just saw a few things.

Thanks for the contribution!

Ben Pfaff <b...@ovn.org> writes:

> From: Satya Valli <satyavalli.r...@tcs.com>
>

Missing signed-off-by line.  Also, it would be good to describe exactly
which flow stat types are being provided.

> ---
>  include/openflow/openflow-1.5.h | 48 
> +
>  include/openvswitch/ofp-msgs.h  |  6 ++
>  lib/automake.mk |  2 ++
>  lib/ofp-parse.c | 45 +-
>  lib/ofp-print.c | 10 +
>  lib/rconn.c |  2 ++
>  ofproto/ofproto.c   |  4 
>  7 files changed, 116 insertions(+), 1 deletion(-)
>
> diff --git a/include/openflow/openflow-1.5.h b/include/openflow/openflow-1.5.h
> index 3649e6c29e63..ff5fa13fae4a 100644
> --- a/include/openflow/openflow-1.5.h
> +++ b/include/openflow/openflow-1.5.h
> @@ -150,4 +150,52 @@ struct ofp15_group_desc_stats {
>  };
>  OFP_ASSERT(sizeof(struct ofp15_group_desc_stats) == 16);
>  
> +struct ofp_oxs_stat {
> +ovs_be16 reserved;  /* One of OFPST_* */
> +ovs_be16 length;/* Stats Length */
> +};
> +OFP_ASSERT(sizeof(struct ofp_oxs_stat) == 4);
> +
> +/*Body for ofp_multipart_request of type
> +  OFPMP_FLOW_DESC & OFPMP_FLOW_STATS.*/
> +struct ofp15_oxs_flow_stats_request {
> +uint8_t table_id; /* ID of table to read
> + (from ofp_table_desc),
> + OFPTT_ALL for all tables. */
> +uint8_t pad[3];   /* Align to 32 bits. */
> +ovs_be32 out_port;/* Require matching entries to include
> + this as an output port. A value of
> + OFP_ANY indicates no restriction. */
> +ovs_be32 out_group;   /* Require matching entries to include
> + this as an output group. A value of
> + OFPG_ANY indicates no restriction. 
> */
> +uint8_t pad2[4];  /* Align to 64 bits. */
> +ovs_be64 cookie;  /* Require matching entries to contain
> + this cookie value */
> +ovs_be64 cookie_mask; /* Mask used to restrict the cookie 
> bits
> + that must match. A value of 0
> + indicates no restriction. */
> +};
> +OFP_ASSERT(sizeof(struct ofp15_oxs_flow_stats_request) == 32);
> +
> +/* Body of reply to OFPMP_FLOW_STATS request
> +* and body for OFPIT_STAT_TRIGGER generated status. */

Minor nit - please put a space at the beginning of the comment line
here.

> +struct ofp15_oxs_flow_stats_reply {
> +ovs_be16 length; /* Length of this entry.   */
> +uint8_t pad2[2]; /* Align to 64-bits.   */
> +uint8_t table_id;/* ID of table flow came from. */
> +uint8_t reason;  /* One of OFPFSR_*.*/
> +ovs_be16 priority;   /* Priority of 

Re: [ovs-dev] [PATCH 1/2] OF1.5/EXT-334 OXS/Individal Flow Statistics

2017-05-12 Thread Satyavalli Rama
Hi Aaron

Please ignore the current patch.  
Due to some proxy issues we were unable to send the complete patches.   
Soon, we wil submitt fresh patches.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting



-Aaron Conole  wrote: -
To: Ben Pfaff , Satya Valli 
From: Aaron Conole 
Date: 05/11/2017 11:23PM
Cc: d...@openvswitch.org,
Subject: Re: [ovs-dev] [PATCH 1/2] OF1.5/EXT-334 OXS/Individal Flow Statistics

Hi Satya,

I haven't checked the OF1.5 spec with this, yet.  Just saw a few things.

Thanks for the contribution!

Ben Pfaff  writes:

> From: Satya Valli 
>

Missing signed-off-by line.  Also, it would be good to describe exactly
which flow stat types are being provided.

> ---
>  include/openflow/openflow-1.5.h | 48 
> +
>  include/openvswitch/ofp-msgs.h  |  6 ++
>  lib/automake.mk |  2 ++
>  lib/ofp-parse.c | 45 +-
>  lib/ofp-print.c | 10 +
>  lib/rconn.c |  2 ++
>  ofproto/ofproto.c   |  4 
>  7 files changed, 116 insertions(+), 1 deletion(-)
>
> diff --git a/include/openflow/openflow-1.5.h b/include/openflow/openflow-1.5.h
> index 3649e6c29e63..ff5fa13fae4a 100644
> --- a/include/openflow/openflow-1.5.h
> +++ b/include/openflow/openflow-1.5.h
> @@ -150,4 +150,52 @@ struct ofp15_group_desc_stats {
>  };
>  OFP_ASSERT(sizeof(struct ofp15_group_desc_stats) == 16);
>  
> +struct ofp_oxs_stat {
> +ovs_be16 reserved;  /* One of OFPST_* */
> +ovs_be16 length;/* Stats Length */
> +};
> +OFP_ASSERT(sizeof(struct ofp_oxs_stat) == 4);
> +
> +/*Body for ofp_multipart_request of type
> +  OFPMP_FLOW_DESC & OFPMP_FLOW_STATS.*/
> +struct ofp15_oxs_flow_stats_request {
> +uint8_t table_id; /* ID of table to read
> + (from ofp_table_desc),
> + OFPTT_ALL for all tables. */
> +uint8_t pad[3];   /* Align to 32 bits. */
> +ovs_be32 out_port;/* Require matching entries to include
> + this as an output port. A value of
> + OFP_ANY indicates no restriction. */
> +ovs_be32 out_group;   /* Require matching entries to include
> + this as an output group. A value of
> + OFPG_ANY indicates no restriction. 
> */
> +uint8_t pad2[4];  /* Align to 64 bits. */
> +ovs_be64 cookie;  /* Require matching entries to contain
> + this cookie value */
> +ovs_be64 cookie_mask; /* Mask used to restrict the cookie 
> bits
> + that must match. A value of 0
> + indicates no restriction. */
> +};
> +OFP_ASSERT(sizeof(struct ofp15_oxs_flow_stats_request) == 32);
> +
> +/* Body of reply to OFPMP_FLOW_STATS request
> +* and body for OFPIT_STAT_TRIGGER generated status. */

Minor nit - please put a space at the beginning of the comment line
here.

> +struct ofp15_oxs_flow_stats_reply {
> +ovs_be16 length; /* Length of this entry.   */
> +uint8_t pad2[2]; /* Align to 64-bits.   */
> +uint8_t table_id;/* ID of table flow came from. */
> +uint8_t reason;  /* One of OFPFSR_*.*/
> +ovs_be16 priority;   /* Priority of the entry.  */
> +};
> +OFP_ASSERT(sizeof(struct ofp15_oxs_flow_stats_reply) == 8);
> +
> +/* OXS flow stat field types for OpenFlow basic class. */
> +enum oxs_ofb_stat_fields {
> +OFPXST_OFB_DURATION  = 0,   /* Time flow entry has been alive.*/
> +OFPXST_OFB_IDLE_TIME = 1,   /* Time flow entry has been idle. */
> +OFPXST_OFB_FLOW_COUNT= 2,   /* Number of aggregated flow entries. */
> +OFPXST_OFB_PACKET_COUNT  = 3,   /* Number of packets in flow entry.   */
> +OFPXST_OFB_BYTE_COUNT= 4,   /* Number of bytes in flow entry. */
> +};
> +
>  #endif /* openflow/openflow-1.5.h */
> diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
> index 34708f3bd846..49b0f7a2cfa8 100644
> --- a/include/openvswitch/ofp-msgs.h
> +++ b/include/openvswitch/ofp-msgs.h
> @@ -287,6 +287,8 @@ enum ofpraw {
>  OFPRAW_OFPST10_FLOW_REQUEST,
>  /* OFPST 1.1+ (1): struct ofp11_flow_stats_request, uint8_t[8][]. */
>  OFPRAW_OFPST11_FLOW_REQUEST,
> +/* OFPST 1.5+ (17): struct 

[ovs-dev] [patch_v0 0/3] OF1.5-EXT-334: Extensible Flow Entry Statistics Implementation

2017-04-20 Thread Satyavalli Rama
OpenFlow 1.5 introduces the Extensible Statistics (OXS) by redefining the 
existing flow entry statistics with OXS Fields. 
This Patch provide implementation for OXS fields encoding in TLV format.

To support this implementation below two messages are newly added 

OFPST_OXS_FLOW_STATS_REQUEST 
OFPTYPE_OXS_FLOW_STATS_REPLY 

As per the openflow specification-1.5, this enhancement should take place on 
the  existing flow entry statistics
with the OXS fields on all the messages that carries flow entry statistics.

The current commit adds support for the new feature in flow statistics 
multipart messages only.Aggegate Multipart and Flow Removal messages are not as 
part of this commit.

Some more fields are added to ovs-ofctl dump-flows command to support 
OpenFlow15 OXS stats.Below are Commands to display OXS stats field wise
ovs-ofctl dump-flows -O OpenFlow15  oxs-duration
ovs-ofctl dump-flows -O OpenFlow15  oxs-idle_time
ovs-ofctl dump-flows -O OpenFlow15  oxs-packet_count 
ovs-ofctl dump-flows -O OpenFlow15  oxs-byte_count


Signed-off-by: Satya Valli 
Co-authored-by: Lavanya Harivelam 

>From bfec9bd0cd687a2a212c6ac971020a89a7e6b5d4 Mon Sep 17 00:00:00 2001
From: SatyaValli 
Date: Wed, 19 Apr 2017 18:54:56 +0530
Subject: [PATCH 1/4] OF1.5/EXT-334 - OXS Individal Flow Entry Statistics

---
 include/openflow/openflow-1.5.h | 48 +
 include/openvswitch/ofp-msgs.h  |  6 ++
 lib/automake.mk |  2 ++
 lib/ofp-parse.c | 45 +-
 lib/ofp-print.c | 10 +
 lib/rconn.c |  2 ++
 ofproto/ofproto.c   |  4 
 7 files changed, 116 insertions(+), 1 deletion(-)

diff --git a/include/openflow/openflow-1.5.h b/include/openflow/openflow-1.5.h
index 3649e6c29..ff5fa13fa 100644
--- a/include/openflow/openflow-1.5.h
+++ b/include/openflow/openflow-1.5.h
@@ -150,4 +150,52 @@ struct ofp15_group_desc_stats {
 };
 OFP_ASSERT(sizeof(struct ofp15_group_desc_stats) == 16);

+struct ofp_oxs_stat {
+ovs_be16 reserved;  /* One of OFPST_* */
+ovs_be16 length;/* Stats Length */
+};
+OFP_ASSERT(sizeof(struct ofp_oxs_stat) == 4);
+
+/*Body for ofp_multipart_request of type
+  OFPMP_FLOW_DESC & OFPMP_FLOW_STATS.*/
+struct ofp15_oxs_flow_stats_request {
+uint8_t table_id; /* ID of table to read
+ (from ofp_table_desc),
+ OFPTT_ALL for all tables. */
+uint8_t pad[3];   /* Align to 32 bits. */
+ovs_be32 out_port;/* Require matching entries to include
+ this as an output port. A value of
+ OFP_ANY indicates no restriction. */
+ovs_be32 out_group;   /* Require matching entries to include
+ this as an output group. A value of
+ OFPG_ANY indicates no restriction. */
+uint8_t pad2[4];  /* Align to 64 bits. */
+ovs_be64 cookie;  /* Require matching entries to contain
+ this cookie value */
+ovs_be64 cookie_mask; /* Mask used to restrict the cookie bits
+ that must match. A value of 0
+ indicates no restriction. */
+};
+OFP_ASSERT(sizeof(struct ofp15_oxs_flow_stats_request) == 32);
+
+/* Body of reply to OFPMP_FLOW_STATS request
+* and body for OFPIT_STAT_TRIGGER generated status. */
+struct ofp15_oxs_flow_stats_reply {
+ovs_be16 length; /* Length of this entry.   */
+uint8_t pad2[2]; /* Align to 64-bits.   */
+uint8_t table_id;/* ID of table flow came from. */
+uint8_t reason;  /* One of OFPFSR_*.*/
+ovs_be16 priority;   /* Priority of the entry.  */
+};
+OFP_ASSERT(sizeof(struct ofp15_oxs_flow_stats_reply) == 8);
+
+/* OXS flow stat field types for OpenFlow basic class. */
+enum oxs_ofb_stat_fields {
+OFPXST_OFB_DURATION  = 0,   /* Time flow entry has been alive.*/
+OFPXST_OFB_IDLE_TIME = 1,   /* Time flow entry has been idle. */
+OFPXST_OFB_FLOW_COUNT= 2,   /* Number of aggregated flow entries. */
+OFPXST_OFB_PACKET_COUNT  = 3,   /* Number of packets in flow entry.   */
+OFPXST_OFB_BYTE_COUNT= 4,   /* Number of bytes in flow entry. */
+};
+
 #endif /* openflow/openflow-1.5.h */
diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
index 34708f3bd..057f28656 100644
--- a/include/openvswitch/ofp-msgs.h
+++ b/include/openvswitch/ofp-msgs.h
@@ -287,6 +287,8 @@ enum ofpraw {
 OFPRAW_OFPST10_FLOW_REQUEST,
 /* OFPST 1.1+ (1): struct ofp11_flow_stats_request, 

[ovs-dev] [patch_v0 1/3] OF1.5-EXT-334: Extensible Flow Entry Statistics Implementation --lib/ox-stat.h lib/ox-stat.c

2017-04-20 Thread Satyavalli Rama
>From 670ca34412b659989e6bd9d1139892dd1717910b Mon Sep 17 00:00:00 2001
From: SatyaValli 
Date: Wed, 19 Apr 2017 19:22:02 +0530
Subject: [PATCH 2/4] OF1.5/EXT-334-OXS Individal Flow Entry Statistics
 --lib/ox_stat.h lib/ox_stat.c

---
 lib/ox-stat.c | 229 ++
 lib/ox-stat.h |  30 
 2 files changed, 259 insertions(+)
 create mode 100644 lib/ox-stat.c
 create mode 100644 lib/ox-stat.h

diff --git a/lib/ox-stat.c b/lib/ox-stat.c
new file mode 100644
index 0..b48ef3aca
--- /dev/null
+++ b/lib/ox-stat.c
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include 
+#include "nx-match.h"
+#include "ox-stat.h"
+#include 
+#include "classifier.h"
+#include "colors.h"
+#include "openvswitch/hmap.h"
+#include "openflow/nicira-ext.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/meta-flow.h"
+#include "openvswitch/ofp-actions.h"
+#include "openvswitch/ofp-errors.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
+#include "packets.h"
+#include "openvswitch/shash.h"
+#include "tun-metadata.h"
+#include "unaligned.h"
+#include "util.h"
+
+VLOG_DEFINE_THIS_MODULE(ox_stat);
+
+/* ## -- ## */
+/* ## OpenFlow Extensible Stats. ## */
+/* ## -- ## */
+
+/* Components of a OXS TLV header. */
+
+static struct ovs_list oxs_ox_map[OFPXST_OFB_BYTE_COUNT + 1];
+static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
+static uint32_t oxs_header_no_len(uint32_t header) {
+return header & 0xff80; }
+
+#define OXS_CLASS(HEADER) ((HEADER) >> 16)
+#define OXS_FIELD(HEADER) (((HEADER) >> 9) & 0x7f)
+#define OXS_TYPE(HEADER) (((HEADER) >> 9) & 0x7f)
+#define OXS_RESERVED(HEADER) (((HEADER) >> 8) & 1)
+#define OXS_LENGTH(HEADER) ((HEADER) & 0xff)
+
+/* Components of a OXS TLV header. */
+#define OXS_HEADER__(CLASS, FIELD, RESERVED, LENGTH) \
+(((CLASS) << 16) | ((FIELD) << 9) | ((RESERVED) << 8) | (LENGTH))
+
+
+#define OXS_HEADER(CLASS, FIELD, LENGTH) \
+OXS_HEADER__(CLASS, FIELD, 0, LENGTH)
+
+
+
+/*  OXS Class IDs.
+ *  The high order bit differentiate reserved classes from member classes.
+ *  Classes 0x to 0x7FFF are member classes, allocated by ONF.
+ *  Classes 0x8000 to 0xFFFE are reserved classes, reserved for
+ *  standardisation.
+ */
+
+enum ofp_oxs_class {
+  OFPXSC_OPENFLOW_BASIC = 0x8002,   /* Basic stats class for OpenFlow */
+  OFPXSC_EXPERIMENTER   = 0x,   /* Experimenter class */
+};
+
+
+#define OFPXST_OFB_ALL ((UINT64_C(1) << 6) - 1)
+#define OXS_OX_COOKIEOXS_HEADER  (0x8002, 5 , 8)
+
+struct oxs_field {
+uint32_t header;
+enum ofp_version version;
+const char *name;
+enum oxs_ofb_stat_fields id;
+};
+
+struct oxs_field_index {
+struct hmap_node header_node;
+struct hmap_node name_node;
+struct ovs_list ox_node;
+const struct oxs_field fs;
+};
+
+#define OXS_STATS_DURATION_LEN 8
+#define OXS_STATS_IDLE_TIME_LEN8
+#define OXS_STATS_FLOW_COUNT_LEN   4
+#define OXS_STATS_PACKET_COUNT_LEN 8
+#define OXS_STATS_BYTE_COUNT_LEN   8
+
+#define OXS_OF_DURATION OXS_HEADER (0x8002, OFPXST_OFB_DURATION, \
+OXS_STATS_DURATION_LEN)
+#define OXS_OF_IDLE_TIMEOXS_HEADER (0x8002, OFPXST_OFB_IDLE_TIME, \
+OXS_STATS_IDLE_TIME_LEN)
+#define OXS_OF_FLOW_COUNT   OXS_HEADER (0x8002, OFPXST_OFB_FLOW_COUNT, \
+OXS_STATS_FLOW_COUNT_LEN)
+#define OXS_OF_PACKET_COUNT OXS_HEADER (0x8002, OFPXST_OFB_PACKET_COUNT, \
+OXS_STATS_PACKET_COUNT_LEN)
+#define OXS_OF_BYTE_COUNT   OXS_HEADER (0x8002, OFPXST_OFB_BYTE_COUNT, \
+OXS_STATS_BYTE_COUNT_LEN)
+
+static struct oxs_field_index all_oxs_fields[] = {
+{.fs = { OXS_OF_DURATION, OFP15_VERSION, "OFPXST_OFB_DURATION",
+ OFPXST_OFB_DURATION } },
+{.fs = { OXS_OF_IDLE_TIME, OFP15_VERSION, "OFPXST_OFB_IDLE_TIME",
+ OFPXST_OFB_IDLE_TIME } },
+{.fs = { OXS_OF_FLOW_COUNT, OFP15_VERSION, "OFPXST_OFB_FLOW_COUNT",
+ OFPXST_OFB_FLOW_COUNT } },
+{.fs = { OXS_OF_PACKET_COUNT, OFP15_VERSION, "OFPXST_OFB_PACKET_COUNT",
+ OFPXST_OFB_PACKET_COUNT } },
+{.fs = { OXS_OF_BYTE_COUNT, 

Re: [ovs-dev] reg: OpenVswitch Fields Implementation

2016-12-21 Thread Satyavalli Rama
 Hi Ben,

Currently we are implementing OXS as an independent infrastructure.  
While sending OXS Flow Stat Request,  we are facing the below issue.
We have dumped and verified the packet is in proper format only, but we are not 
receiving the Reply.

2016-12-21T06:46:56Z|00016|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt:
 sent (Success): OFPST_OXS_FLOW request (OF1.5) (xid=0x2): 
2016-12-21T06:46:56Z|00017|poll_loop|DBG|wakeup due to 0-ms timeout
2016-12-21T06:47:55Z|00018|poll_loop|DBG|wakeup due to [POLLIN] on fd 4 
(<->/usr/local/var/run/openvswitch/br0.mgmt) at lib/stream-fd.c:155
2016-12-21T06:47:55Z|00019|vconn|DBG|unix:/usr/local/var/run/openvswitch/br0.mgmt:
 received: OFPT_ECHO_REQUEST (OF1.5) (xid=0x0): 0 bytes of payload
2016-12-21T06:47:55Z|00020|ofctl|DBG|received reply with xid  != 
expected 0200
2016-12-21T06:48:55Z|00021|poll_loop|DBG|wakeup due to [POLLIN][POLLHUP] on fd 
4 (<->/usr/local/var/run/openvswitch/br0.mgmt) at lib/stream-fd.c:155
ovs-ofctl: OpenFlow packet receive failed (End of file)

Thanks and Regards
Satya Valli
  

 -Ben Pfaff <b...@ovn.org> wrote: -

 =======
 To: Satyavalli Rama <satyavalli.r...@tcs.com>
 From: Ben Pfaff <b...@ovn.org>
 Date: 12/16/2016 10:23PM 
 Cc: ovs-dev@openvswitch.org
 Subject: Re: [ovs-dev] reg: OpenVswitch Fields Implementation
 ===
   On Fri, Dec 16, 2016 at 03:33:11PM +0530, Satyavalli Rama wrote:
> We are working on Openflow 15 EXT-334 i.e OpenFlow Extensible Flow Entry 
> Statistics,  as per OpenvSwitch fields implementation in the meta-flow.h, 
> the key-value pairs for "OXS fields" to be added/declared separately or do 
> we need to follow the existing NXM/OXM  key-value pairs.
> 
> Please clarify us, and please refer us some guidelines that we need to 
> follow for implementing this Openvswitch fields.

I don't think that OXS defines fields at all, so I'd expect their
implementation to be independent of existing infrastructure.

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] reg: OpenVswitch Fields Implementation

2016-12-16 Thread Satyavalli Rama
Hi Ben,

We are working on Openflow 15 EXT-334 i.e OpenFlow Extensible Flow Entry 
Statistics,  as per OpenvSwitch fields implementation in the meta-flow.h, 
the key-value pairs for "OXS fields" to be added/declared separately or do 
we need to follow the existing NXM/OXM  key-value pairs.

Please clarify us, and please refer us some guidelines that we need to 
follow for implementing this Openvswitch fields.

Thanks & Regards
Satya Valli
Tata Consultancy Services
Mailto: satyavalli.r...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Consulting

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev