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

2017-05-01 Thread Ben Pfaff
On Thu, Apr 20, 2017 at 05:46:58PM +0530, Satyavalli Rama wrote:
> 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.

Thanks a lot for working on this feature!  It's nice to support more
OpenFlow features and get closer to OpenFlow 1.5 support.

This patch does not apply.  It is corrupted.  "git am" says:

  Applying: OF1.5-EXT-334: Extensible Flow Entry Statistics Implementation
  fatal: corrupt patch at line 89
  Patch failed at 0001 OF1.5-EXT-334: Extensible Flow Entry Statistics 
Implementation

A glance at the patch contents makes it look like your mailer is
deleting blank lines or lines that contain just white space.

Please use "git send email" to send patches, or if you cannot, then
please instead submit a pull request on Github.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[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,