That way I won't have to figure it out again the next time.
Signed-off-by: Ben Pfaff <[email protected]>
---
lib/ofp-errors.h | 38 ++++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h
index 69c92f9..342877d 100644
--- a/lib/ofp-errors.h
+++ b/lib/ofp-errors.h
@@ -45,7 +45,8 @@ struct ofpbuf;
#define OFPERR_OFS (1 << 30)
-/* OpenFlow error codes.
+/* OpenFlow error codes
+ * --------------------
*
* The comments below are parsed by the extract-ofp-errors program at build
* time and used to determine the mapping between "enum ofperr" constants and
@@ -71,13 +72,46 @@ struct ofpbuf;
* - Additional text is a human-readable description of the meaning of each
* error, used to explain the error to the user. Any text enclosed in
* square brackets is omitted; this can be used to explain rationale for
- * choice of error codes in the case where this is desirable. */
+ * choice of error codes in the case where this is desirable.
+ *
+ *
+ * Expected duplications
+ * ---------------------
+ *
+ * Occasionally, in one version of OpenFlow a single named error can indicate
+ * two or more distinct errors, then a later version of OpenFlow splits those
+ * meanings into different error codes. When that happens, both errors are
+ * assigned the same value in the earlier version. That is ordinarily a
+ * mistake, so the build system reports an error. When that happens, add the
+ * error message to the list of "Expected duplications" below to suppress the
+ * error. In such a case, the named error defined earlier is how OVS
+ * interprets the earlier, merged form of the error.
+ *
+ * For example, OpenFlow 1.1 defined (3,5) as OFPBIC_UNSUP_EXP_INST, then
+ * OpenFlow 1.2 broke this error into OFPBIC_BAD_EXPERIMENTER as (3,5) and
+ * OFPBIC_BAD_EXT_TYPE as (3,6). To allow the OVS code to report just a single
+ * error code, instead of protocol version dependent errors, this list of
+ * errors only lists the latter two errors, giving both of them the same code
+ * (3,5) for OpenFlow 1.1. Then, when OVS serializes either error into
+ * OpenFlow 1.1, it uses the same code (3,5). In the other direction, when OVS
+ * deserializes (3,5) from OpenFlow 1.1, it translates it into
+ * OFPBIC_BAD_EXPERIMENTER (because its definition precedes that of
+ * OFPBIC_BAD_EXT_TYPE below). See the "encoding OFPBIC_* experimenter errors"
+ * and "decoding OFPBIC_* experimenter errors" tests in tests/ofp-errors.at for
+ * full details.
+ */
enum ofperr {
/* Expected duplications. */
/* Expected: 0x0,3,5 in OF1.1 means both OFPBIC_BAD_EXPERIMENTER and
* OFPBIC_BAD_EXP_TYPE. */
+ /* Expected: 0x0,1,5 in OF1.0 means both OFPBRC_EPERM and
+ * OFPBRC_IS_SLAVE. */
+
+ /* Expected: 0x0,1,5 in OF1.1 means both OFPBRC_EPERM and
+ * OFPBRC_IS_SLAVE. */
+
/* ## ------------------ ## */
/* ## OFPET_HELLO_FAILED ## */
/* ## ------------------ ## */
--
2.1.3
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev