diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-06-17 20:50:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-19 21:07:42 -0400 |
commit | aa310701e787087dbfbccf1409982a96e16c57a6 (patch) | |
tree | f426945de6694203f2c34218b4e4b06913b8f58c /net/openvswitch/vport.c | |
parent | a3e82996a8874c4cfe8c7f1be4d552018d8cba7e (diff) |
openvswitch: Add gre tunnel support.
Add gre vport implementation. Most of gre protocol processing
is pushed to gre module. It make use of gre demultiplexer
therefore it can co-exist with linux device based gre tunnels.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/vport.c')
-rw-r--r-- | net/openvswitch/vport.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 413287a1877f..f52dfb9cb5a7 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c | |||
@@ -38,6 +38,10 @@ | |||
38 | static const struct vport_ops *vport_ops_list[] = { | 38 | static const struct vport_ops *vport_ops_list[] = { |
39 | &ovs_netdev_vport_ops, | 39 | &ovs_netdev_vport_ops, |
40 | &ovs_internal_vport_ops, | 40 | &ovs_internal_vport_ops, |
41 | |||
42 | #ifdef CONFIG_NET_IPGRE_DEMUX | ||
43 | &ovs_gre_vport_ops, | ||
44 | #endif | ||
41 | }; | 45 | }; |
42 | 46 | ||
43 | /* Protected by RCU read lock for reading, ovs_mutex for writing. */ | 47 | /* Protected by RCU read lock for reading, ovs_mutex for writing. */ |
@@ -404,3 +408,18 @@ void ovs_vport_record_error(struct vport *vport, enum vport_err_type err_type) | |||
404 | 408 | ||
405 | spin_unlock(&vport->stats_lock); | 409 | spin_unlock(&vport->stats_lock); |
406 | } | 410 | } |
411 | |||
412 | static void free_vport_rcu(struct rcu_head *rcu) | ||
413 | { | ||
414 | struct vport *vport = container_of(rcu, struct vport, rcu); | ||
415 | |||
416 | ovs_vport_free(vport); | ||
417 | } | ||
418 | |||
419 | void ovs_vport_deferred_free(struct vport *vport) | ||
420 | { | ||
421 | if (!vport) | ||
422 | return; | ||
423 | |||
424 | call_rcu(&vport->rcu, free_vport_rcu); | ||
425 | } | ||