ofproto: report the correct set of actions for group features
authorBen Pfaff <blp@nicira.com>
Tue, 5 Nov 2013 05:14:53 +0000 (21:14 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 5 Nov 2013 05:14:53 +0000 (21:14 -0800)
do not report OF1.1 bits (set_dl_src etc) as group features is OF1.2+.

LINC seems to use 1<<31 for experimenter action type but i failed to
find it in the spec.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
[blp@nicira.com added a comment to ofp-util.h]
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-util.h
ofproto/ofproto.c

index c66e65d..fef85e0 100644 (file)
@@ -991,12 +991,16 @@ struct ofputil_group_stats {
     struct bucket_counter *bucket_stats;
 };
 
-/* Group features reply, independent of protocol. */
+/* Group features reply, independent of protocol.
+ *
+ * Only OF1.2 and later support group features replies. */
 struct ofputil_group_features {
     uint32_t  types;           /* Bitmap of OFPGT_* values supported. */
     uint32_t  capabilities;    /* Bitmap of OFPGFC12_* capability supported. */
     uint32_t  max_groups[4];   /* Maximum number of groups for each type. */
-    uint32_t  actions[4];      /* Bitmaps of OFPAT_* that are supported. */
+
+    /* Bitmaps of OFPAT_* that are supported.  OF1.2+ actions only. */
+    uint32_t  actions[4];
 };
 
 /* Group desc reply, independent of protocol. */
index b88cd81..0c66a59 100644 (file)
@@ -538,9 +538,23 @@ ofproto_create(const char *datapath_name, const char *datapath_type,
     ofproto->ogf.max_groups[OFPGT11_INDIRECT] = OFPG_MAX;
     ofproto->ogf.max_groups[OFPGT11_FF] = OFPG_MAX;
     ofproto->ogf.actions[0] =
-#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) (1 << ENUM) |
-#include "ofp-util.def"
-    0;
+        (1 << OFPAT11_OUTPUT) |
+        (1 << OFPAT11_COPY_TTL_OUT) |
+        (1 << OFPAT11_COPY_TTL_IN) |
+        (1 << OFPAT11_SET_MPLS_TTL) |
+        (1 << OFPAT11_DEC_MPLS_TTL) |
+        (1 << OFPAT11_PUSH_VLAN) |
+        (1 << OFPAT11_POP_VLAN) |
+        (1 << OFPAT11_PUSH_MPLS) |
+        (1 << OFPAT11_POP_MPLS) |
+        (1 << OFPAT11_SET_QUEUE) |
+        (1 << OFPAT11_GROUP) |
+        (1 << OFPAT11_SET_NW_TTL) |
+        (1 << OFPAT11_DEC_NW_TTL) |
+        (1 << OFPAT12_SET_FIELD);
+/* not supported:
+ *      (1 << OFPAT13_PUSH_PBB) |
+ *      (1 << OFPAT13_POP_PBB) */
 
     error = ofproto->ofproto_class->construct(ofproto);
     if (error) {