aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2014-09-15 22:37:25 -0400
committerPravin B Shelar <pshelar@nicira.com>2014-09-16 02:28:14 -0400
commit971427f353f3c42c8dcef62e7124440df68eb809 (patch)
tree7eed9ed50fe70cfc82ce33e12a13147ad0de580c /net/openvswitch/datapath.c
parent32ae87ff795781b7ceffc44b7c694c1bb206a266 (diff)
openvswitch: Add recirc and hash action.
Recirc action allows a packet to reenter openvswitch processing. currently openvswitch lookup flow for packet received and execute set of actions on that packet, with help of recirc action we can process/modify the packet and recirculate it back in openvswitch for another pass. OVS hash action calculates 5-tupple hash and set hash in flow-key hash. This can be used along with recirculation for distributing packets among different ports for bond devices. For example: OVS bonding can use following actions: Match on: bond flow; Action: hash, recirc(id) Match on: recirc-id == id and hash lower bits == a; Action: output port_bond_a Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 7e0819919b8a..16cad14fa81e 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -156,7 +156,7 @@ static struct datapath *get_dp(struct net *net, int dp_ifindex)
156} 156}
157 157
158/* Must be called with rcu_read_lock or ovs_mutex. */ 158/* Must be called with rcu_read_lock or ovs_mutex. */
159static const char *ovs_dp_name(const struct datapath *dp) 159const char *ovs_dp_name(const struct datapath *dp)
160{ 160{
161 struct vport *vport = ovs_vport_ovsl_rcu(dp, OVSP_LOCAL); 161 struct vport *vport = ovs_vport_ovsl_rcu(dp, OVSP_LOCAL);
162 return vport->ops->get_name(vport); 162 return vport->ops->get_name(vport);
@@ -2065,10 +2065,14 @@ static int __init dp_init(void)
2065 2065
2066 pr_info("Open vSwitch switching datapath\n"); 2066 pr_info("Open vSwitch switching datapath\n");
2067 2067
2068 err = ovs_internal_dev_rtnl_link_register(); 2068 err = action_fifos_init();
2069 if (err) 2069 if (err)
2070 goto error; 2070 goto error;
2071 2071
2072 err = ovs_internal_dev_rtnl_link_register();
2073 if (err)
2074 goto error_action_fifos_exit;
2075
2072 err = ovs_flow_init(); 2076 err = ovs_flow_init();
2073 if (err) 2077 if (err)
2074 goto error_unreg_rtnl_link; 2078 goto error_unreg_rtnl_link;
@@ -2101,6 +2105,8 @@ error_flow_exit:
2101 ovs_flow_exit(); 2105 ovs_flow_exit();
2102error_unreg_rtnl_link: 2106error_unreg_rtnl_link:
2103 ovs_internal_dev_rtnl_link_unregister(); 2107 ovs_internal_dev_rtnl_link_unregister();
2108error_action_fifos_exit:
2109 action_fifos_exit();
2104error: 2110error:
2105 return err; 2111 return err;
2106} 2112}
@@ -2114,6 +2120,7 @@ static void dp_cleanup(void)
2114 ovs_vport_exit(); 2120 ovs_vport_exit();
2115 ovs_flow_exit(); 2121 ovs_flow_exit();
2116 ovs_internal_dev_rtnl_link_unregister(); 2122 ovs_internal_dev_rtnl_link_unregister();
2123 action_fifos_exit();
2117} 2124}
2118 2125
2119module_init(dp_init); 2126module_init(dp_init);