X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=7997402e1c6e6a934ef00ad9d6891382d4097ee3;hb=3b6a2571f07e153e850a9bf2044699d8d4434ef0;hp=59100ccee7a7d4f3596eb202073d489acaa9af2c;hpb=141d9ce465b9722fb9321c3d102238dd33507d79;p=sliver-openvswitch.git diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 59100ccee..7997402e1 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2694,11 +2694,37 @@ bridge_account_checkpoint_ofhook_cb(void *br_) } } +static uint16_t +bridge_autopath_ofhook_cb(const struct flow *flow, uint32_t ofp_port, + tag_type *tags, void *br_) +{ + struct bridge *br = br_; + uint16_t odp_port = ofp_port_to_odp_port(ofp_port); + struct port *port = port_from_dp_ifidx(br, odp_port); + uint16_t ret; + + if (!port) { + ret = ODPP_NONE; + } else if (list_is_short(&port->ifaces)) { + ret = odp_port; + } else { + struct iface *iface; + + /* Autopath does not support VLAN hashing. */ + iface = bond_choose_output_slave(port->bond, flow, + OFP_VLAN_NONE, tags); + ret = iface ? iface->dp_ifidx : ODPP_NONE; + } + + return odp_port_to_ofp_port(ret); +} + static struct ofhooks bridge_ofhooks = { bridge_normal_ofhook_cb, bridge_special_ofhook_cb, bridge_account_flow_ofhook_cb, bridge_account_checkpoint_ofhook_cb, + bridge_autopath_ofhook_cb, }; /* Port functions. */