From f0e7025f7e107f62e3c125a956cb0d608931f338 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 4 Nov 2013 21:14:53 -0800 Subject: [PATCH] ofproto: report the correct set of actions for group features 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 [blp@nicira.com added a comment to ofp-util.h] Signed-off-by: Ben Pfaff --- lib/ofp-util.h | 8 ++++++-- ofproto/ofproto.c | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/ofp-util.h b/lib/ofp-util.h index c66e65dba..fef85e0b0 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -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. */ diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index b88cd816d..0c66a5969 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -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) { -- 2.43.0