mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
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>
This commit is contained in:
parent
32ae87ff79
commit
971427f353
7 changed files with 288 additions and 12 deletions
|
@ -156,7 +156,7 @@ static struct datapath *get_dp(struct net *net, int dp_ifindex)
|
|||
}
|
||||
|
||||
/* Must be called with rcu_read_lock or ovs_mutex. */
|
||||
static const char *ovs_dp_name(const struct datapath *dp)
|
||||
const char *ovs_dp_name(const struct datapath *dp)
|
||||
{
|
||||
struct vport *vport = ovs_vport_ovsl_rcu(dp, OVSP_LOCAL);
|
||||
return vport->ops->get_name(vport);
|
||||
|
@ -2065,10 +2065,14 @@ static int __init dp_init(void)
|
|||
|
||||
pr_info("Open vSwitch switching datapath\n");
|
||||
|
||||
err = ovs_internal_dev_rtnl_link_register();
|
||||
err = action_fifos_init();
|
||||
if (err)
|
||||
goto error;
|
||||
|
||||
err = ovs_internal_dev_rtnl_link_register();
|
||||
if (err)
|
||||
goto error_action_fifos_exit;
|
||||
|
||||
err = ovs_flow_init();
|
||||
if (err)
|
||||
goto error_unreg_rtnl_link;
|
||||
|
@ -2101,6 +2105,8 @@ error_flow_exit:
|
|||
ovs_flow_exit();
|
||||
error_unreg_rtnl_link:
|
||||
ovs_internal_dev_rtnl_link_unregister();
|
||||
error_action_fifos_exit:
|
||||
action_fifos_exit();
|
||||
error:
|
||||
return err;
|
||||
}
|
||||
|
@ -2114,6 +2120,7 @@ static void dp_cleanup(void)
|
|||
ovs_vport_exit();
|
||||
ovs_flow_exit();
|
||||
ovs_internal_dev_rtnl_link_unregister();
|
||||
action_fifos_exit();
|
||||
}
|
||||
|
||||
module_init(dp_init);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue