diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2014-11-11 11:53:47 -0800 |
---|---|---|
committer | Pravin B Shelar <pshelar@nicira.com> | 2014-11-12 15:08:33 -0800 |
commit | a36de779d739cdcd72c65c67a547a786798b595a (patch) | |
tree | 736331a0c51ec85f22fe982b18135d7f9d9131ca /ofproto/tunnel.h | |
parent | 0746a84f3916193c0704e94a4c214f672c5c542e (diff) | |
download | openvswitch-a36de779d739cdcd72c65c67a547a786798b595a.tar.gz |
openvswitch: Userspace tunneling.
Following patch adds support for userspace tunneling. Tunneling
needs three more component first is routing table which is configured by
caching kernel routes and second is ARP cache which build automatically
by snooping arp. And third is tunnel protocol table which list all
listening protocols which is populated by vswitchd as tunnel ports
are added. GRE and VXLAN protocol support is added in this patch.
Tunneling works as follows:
On packet receive vswitchd check if this packet is targeted to tunnel
port. If it is then vswitchd inserts tunnel pop action which pops
header and sends packet to tunnel port.
On packet xmit rather than generating Set tunnel action it generate
tunnel push action which has tunnel header data. datapath can use
tunnel-push action data to generate header for each packet and
forward this packet to output port. Since tunnel-push action
contains most of packet header vswitchd needs to lookup routing
table and arp table to build this action.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ofproto/tunnel.h')
-rw-r--r-- | ofproto/tunnel.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ofproto/tunnel.h b/ofproto/tunnel.h index cdcbb7715..6181762b2 100644 --- a/ofproto/tunnel.h +++ b/ofproto/tunnel.h @@ -25,15 +25,16 @@ * These functions emulate tunnel virtual ports based on the outer * header information from the kernel. */ +struct ovs_action_push_tnl; struct ofport_dpif; struct netdev; void ofproto_tunnel_init(void); bool tnl_port_reconfigure(const struct ofport_dpif *, const struct netdev *, - odp_port_t); + odp_port_t, bool native_tnl, const char name[]); void tnl_port_add(const struct ofport_dpif *, const struct netdev *, - odp_port_t odp_port); + odp_port_t odp_port, bool native_tnl, const char name[]); void tnl_port_del(const struct ofport_dpif *); const struct ofport_dpif *tnl_port_receive(const struct flow *); @@ -49,4 +50,10 @@ tnl_port_should_receive(const struct flow *flow) return flow->tunnel.ip_dst != 0; } +int tnl_port_build_header(const struct ofport_dpif *ofport, + const struct flow *tnl_flow, + uint8_t dmac[ETH_ADDR_LEN], + uint8_t smac[ETH_ADDR_LEN], + ovs_be32 ip_src, struct ovs_action_push_tnl *data); + #endif /* tunnel.h */ |