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 <ho...@verge.net.au> --- OPENFLOW-1.1+ | 5 ----- lib/ofp-actions.c | 2 +- lib/ofp-errors.h | 4 ++-- tests/ofp-actions.at | 4 ++-- tests/ofp-errors.at | 10 ++++++++++ 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/OPENFLOW-1.1+ b/OPENFLOW-1.1+ index 3210983..d337b8c 100644 --- a/OPENFLOW-1.1+ +++ b/OPENFLOW-1.1+ @@ -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+] diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index cc1f9a0..dc74e8a 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -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; } diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h index 2895138..169112a 100644 --- a/lib/ofp-errors.h +++ b/lib/ofp-errors.h @@ -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 ## */ diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at index 452bdbf..4090ca3 100644 --- a/tests/ofp-actions.at +++ b/tests/ofp-actions.at @@ -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 diff --git a/tests/ofp-errors.at b/tests/ofp-errors.at index 17696b7..f8c5cc4 100644 --- a/tests/ofp-errors.at +++ b/tests/ofp-errors.at @@ -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. -- 1.8.5.2 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev