* limitations under the License.
*/
-
#ifndef OVN_LFLOW_H
#define OVN_LFLOW_H 1
+#include "ovn/lib/logical-fields.h"
+
/* Logical_Flow table translation to OpenFlow
* ==========================================
*
/* The number of tables for the ingress and egress pipelines. */
#define LOG_PIPELINE_LEN 16
-/* Logical fields.
- *
- * These values are documented in ovn-architecture(7), please update the
- * documentation if you change any of them. */
-#define MFF_LOG_DATAPATH MFF_METADATA /* Logical datapath (64 bits). */
-#define MFF_LOG_CT_ZONE MFF_REG5 /* Logical conntrack zone (32 bits). */
-#define MFF_LOG_INPORT MFF_REG6 /* Logical input port (32 bits). */
-#define MFF_LOG_OUTPORT MFF_REG7 /* Logical output port (32 bits). */
-
-/* Logical registers.
- *
- * Make sure these don't overlap with the logical fields! */
-#define MFF_LOG_REGS \
- MFF_LOG_REG(MFF_REG0) \
- MFF_LOG_REG(MFF_REG1) \
- MFF_LOG_REG(MFF_REG2) \
- MFF_LOG_REG(MFF_REG3) \
- MFF_LOG_REG(MFF_REG4)
-
void lflow_init(void);
void lflow_run(struct controller_ctx *, struct hmap *flow_table,
const struct simap *ct_zones);
#include "dynamic-string.h"
#include "expr.h"
#include "lex.h"
+#include "logical-fields.h"
#include "ofp-actions.h"
#include "ofpbuf.h"
#include "simap.h"
ct->recirc_table = NX_CT_RECIRC_NONE;
}
- /* xxx Should remove hard-coding reg5 if we refactor library. */
- ct->zone_src.field = mf_from_id(MFF_REG5);
+ ct->zone_src.field = mf_from_id(MFF_LOG_CT_ZONE);
ct->zone_src.ofs = 0;
ct->zone_src.n_bits = 16;
ovn/lib/expr.c \
ovn/lib/expr.h \
ovn/lib/lex.c \
- ovn/lib/lex.h
+ ovn/lib/lex.h \
+ ovn/lib/logical-fields.h
nodist_ovn_lib_libovn_la_SOURCES = \
ovn/lib/ovn-nb-idl.c \
ovn/lib/ovn-nb-idl.h \
--- /dev/null
+/* Copyright (c) 2015 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OVN_LOGICAL_FIELDS_H
+#define OVN_LOGICAL_FIELDS_H 1
+
+#include "meta-flow.h"
+
+/* Logical fields.
+ *
+ * These values are documented in ovn-architecture(7), please update the
+ * documentation if you change any of them. */
+#define MFF_LOG_DATAPATH MFF_METADATA /* Logical datapath (64 bits). */
+#define MFF_LOG_CT_ZONE MFF_REG5 /* Logical conntrack zone (32 bits). */
+#define MFF_LOG_INPORT MFF_REG6 /* Logical input port (32 bits). */
+#define MFF_LOG_OUTPORT MFF_REG7 /* Logical output port (32 bits). */
+
+/* Logical registers.
+ *
+ * Make sure these don't overlap with the logical fields! */
+#define MFF_LOG_REGS \
+ MFF_LOG_REG(MFF_REG0) \
+ MFF_LOG_REG(MFF_REG1) \
+ MFF_LOG_REG(MFF_REG2) \
+ MFF_LOG_REG(MFF_REG3) \
+ MFF_LOG_REG(MFF_REG4)
+
+#endif /* ovn/lib/logical-fields.h */
A field that denotes the logical datapath through which a packet is being
processed.
<!-- Keep the following in sync with MFF_LOG_DATAPATH in
- ovn/controller/lflow.h. -->
+ ovn/lib/logical-fields.h. -->
OVN uses the field that OpenFlow 1.1+ simply (and confusingly) calls
``metadata'' to store the logical datapath. (This field is passed across
tunnels as part of the tunnel key.)
A field that denotes the logical port from which the packet
entered the logical datapath.
<!-- Keep the following in sync with MFF_LOG_INPORT in
- ovn/controller/lflow.h. -->
+ ovn/lib/logical-fields.h. -->
OVN stores this in Nicira extension register number 6.
</p>
leave the logical datapath. This is initialized to 0 at the
beginning of the logical ingress pipeline.
<!-- Keep the following in sync with MFF_LOG_OUTPORT in
- ovn/controller/lflow.h. -->
+ ovn/lib/logical-fields.h. -->
OVN stores this in Nicira extension register number 7.
</p>