ofp-errors: Duplicate instruction error
authorSimon Horman <horms@verge.net.au>
Mon, 2 Jun 2014 12:36:28 +0000 (21:36 +0900)
committerBen Pfaff <blp@nicira.com>
Mon, 2 Jun 2014 17:25:29 +0000 (10:25 -0700)
Add OFPERR_OFPBIC_DUP_INST (type = OFPET_BAD_INSTRUCTION, code = 9)
and use it for OpenFlow1.4+.

For OpenFlow1.1 - 1.3 map this error to ONFBIC_DUP_INSTRUCTION
(experimenter = ONF, type = 2600) which is proposed in
OpenFlow enhancement proposal EXT-260 "Add error
code for duplicate instruction.".

Previously ONFBIC_DUP_INSTRUCTION was used for OpenFlow1.3+.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
OPENFLOW-1.1+
lib/ofp-actions.c
lib/ofp-errors.h
tests/ofp-actions.at
tests/ofp-errors.at

index 1789f17..927962a 100644 (file)
@@ -171,11 +171,6 @@ Many of them are necessary for OpenFlow 1.4 as well.
       [EXT-256]
       [optional for OF1.4+]
 
-    * Duplicate instruction error
-      We already have ONFBIC_DUP_INSTRUCTION.
-      [EXT-260]
-      [required for OF1.4+]
-
     * Multipart timeout error
       [EXT-264]
       [required for OF1.4+]
index cc1f9a0..dc74e8a 100644 (file)
@@ -1724,7 +1724,7 @@ decode_openflow11_instructions(const struct ofp11_instruction insts[],
         }
 
         if (out[type]) {
-            return OFPERR_ONFBIC_DUP_INSTRUCTION;
+            return OFPERR_OFPBIC_DUP_INST;
         }
         out[type] = inst;
     }
index 2895138..169112a 100644 (file)
@@ -272,8 +272,8 @@ enum ofperr {
     /* OF1.2+(3,8).  Permissions error. */
     OFPERR_OFPBIC_EPERM,
 
-    /* ONF1.1+(2600).  Duplicate instruction. */
-    OFPERR_ONFBIC_DUP_INSTRUCTION,
+    /* ONF1.1-1.3(2600), OF1.4+(3,9).  Duplicate instruction. */
+    OFPERR_OFPBIC_DUP_INST,
 
 /* ## --------------- ## */
 /* ## OFPET_BAD_MATCH ## */
index 452bdbf..4090ca3 100644 (file)
@@ -339,7 +339,7 @@ dnl Check that an empty Apply-Actions instruction gets dropped.
 0004 0008 00000000
 
 dnl Duplicate instruction type:
-# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION
+# bad OF1.1 instructions: OFPBIC_DUP_INST
 0004 0008 00000000 0004 0008 00000000
 
 dnl Instructions not multiple of 8 in length.
@@ -381,7 +381,7 @@ dnl Write-Metadata too long.
 0002 0020 00000000 fedcba9876543210 ffffffffffffffff 0000000000000000
 
 dnl Write-Metadata duplicated.
-# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION
+# bad OF1.1 instructions: OFPBIC_DUP_INST
 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00
 
 dnl Write-Metadata in wrong position (OpenFlow 1.1+ disregards the order
index 17696b7..f8c5cc4 100644 (file)
@@ -80,6 +80,16 @@ OFPT_FEATURES_REPLY (OF1.1) (xid=0xeeff0011):
 ])
 AT_CLEANUP
 
+AT_SETUP([OFPT_ERROR with type OFPBIC_DUP_INST - OF1.4])
+AT_KEYWORDS([ofp-print ofp-errors])
+AT_CHECK([ovs-ofctl ofp-print 0501001400000000000300090206ccddeeff0011], [0], [dnl
+OFPT_ERROR (OF1.4) (xid=0x0): OFPBIC_DUP_INST
+OFPT_FEATURES_REPLY (OF1.1) (xid=0xeeff0011):
+(***truncated to 8 bytes from 52445***)
+00000000  02 06 cc dd ee ff 00 11-                        |........        |
+])
+AT_CLEANUP
+
 dnl OF1.1 had OFPBIC_UNSUP_EXP_INST as 3,5.
 dnl OF1.2 broke it into OFPBIC_BAD_EXPERIMENTER as 3,5
 dnl                 and OFPBIC_BAD_EXT_TYPE as 3,6.