1 /* Copyright (c) 2015 Nicira, Inc.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
20 /* Logical_Flow table translation to OpenFlow
21 * ==========================================
23 * The Logical_Flow table obtained from the OVN_Southbound database works in
24 * terms of logical entities, that is, logical flows among logical datapaths
25 * and logical ports. This code translates these logical flows into OpenFlow
26 * flows that, again, work in terms of logical entities implemented through
27 * OpenFlow extensions (e.g. registers represent the logical input and output
30 * Physical-to-logical and logical-to-physical translation are implemented in
31 * physical.[ch] as separate OpenFlow tables that run before and after,
32 * respectively, the logical pipeline OpenFlow tables.
37 struct controller_ctx;
41 /* OpenFlow table numbers.
43 * These are heavily documented in ovn-architecture(7), please update it if
44 * you make any changes. */
45 #define OFTABLE_PHY_TO_LOG 0
46 #define OFTABLE_LOG_INGRESS_PIPELINE 16 /* First of LOG_PIPELINE_LEN tables. */
47 #define OFTABLE_REMOTE_OUTPUT 32
48 #define OFTABLE_LOCAL_OUTPUT 33
49 #define OFTABLE_DROP_LOOPBACK 34
50 #define OFTABLE_LOG_EGRESS_PIPELINE 48 /* First of LOG_PIPELINE_LEN tables. */
51 #define OFTABLE_LOG_TO_PHY 64
53 /* The number of tables for the ingress and egress pipelines. */
54 #define LOG_PIPELINE_LEN 16
58 * These values are documented in ovn-architecture(7), please update the
59 * documentation if you change any of them. */
60 #define MFF_LOG_DATAPATH MFF_METADATA /* Logical datapath (64 bits). */
61 #define MFF_LOG_INPORT MFF_REG6 /* Logical input port (32 bits). */
62 #define MFF_LOG_OUTPORT MFF_REG7 /* Logical output port (32 bits). */
66 * Make sure these don't overlap with the logical fields! */
67 #define MFF_LOG_REGS \
68 MFF_LOG_REG(MFF_REG0) \
69 MFF_LOG_REG(MFF_REG1) \
70 MFF_LOG_REG(MFF_REG2) \
71 MFF_LOG_REG(MFF_REG3) \
72 MFF_LOG_REG(MFF_REG4) \
75 void lflow_init(void);
76 void lflow_run(struct controller_ctx *, struct hmap *flow_table);
77 void lflow_destroy(void);
79 #endif /* ovn/lflow.h */