2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

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>
This commit is contained in:
Pravin B Shelar
2014-11-11 11:53:47 -08:00
parent 0746a84f39
commit a36de779d7
46 changed files with 2144 additions and 77 deletions

View File

@@ -70,6 +70,7 @@ struct in_addr;
struct in6_addr;
struct smap;
struct sset;
struct ovs_action_push_tnl;
/* Network device statistics.
*
@@ -181,6 +182,13 @@ int netdev_send(struct netdev *, int qid, struct dpif_packet **, int cnt,
bool may_steal);
void netdev_send_wait(struct netdev *, int qid);
int netdev_build_header(const struct netdev *, struct ovs_action_push_tnl *data);
int netdev_push_header(const struct netdev *netdev,
struct dpif_packet **buffers, int cnt,
const struct ovs_action_push_tnl *data);
int netdev_pop_header(struct netdev *netdev, struct dpif_packet **buffers,
int cnt);
/* Hardware address. */
int netdev_set_etheraddr(struct netdev *, const uint8_t mac[ETH_ADDR_LEN]);
int netdev_get_etheraddr(const struct netdev *, uint8_t mac[ETH_ADDR_LEN]);
@@ -327,6 +335,7 @@ int netdev_dump_queue_stats(const struct netdev *,
netdev_dump_queue_stats_cb *, void *aux);
enum { NETDEV_MAX_RX_BATCH = 256 }; /* Maximum number packets in rx_recv() batch. */
extern struct seq *tnl_conf_seq;
#ifdef __cplusplus
}