Since introduction of 'hash_mac()' function in commit 7e36ac42e33a ("lib/packet.h: add hash_mac()"), there is no need to have additional wrapper for mac address hashing.
Lets use 'hash_mac()' directly and remove 'bond_hash_src()' to simplify the code. Suggested-by: Andy Zhou <az...@ovn.org> Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- ofproto/bond.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ofproto/bond.c b/ofproto/bond.c index e4d4b65..e09136e 100644 --- a/ofproto/bond.c +++ b/ofproto/bond.c @@ -175,8 +175,6 @@ static void bond_link_status_update(struct bond_slave *) OVS_REQ_WRLOCK(rwlock); static void bond_choose_active_slave(struct bond *) OVS_REQ_WRLOCK(rwlock); -static unsigned int bond_hash_src(const struct eth_addr mac, - uint16_t vlan, uint32_t basis); static struct bond_entry *lookup_bond_entry(const struct bond *, const struct flow *, uint16_t vlan) @@ -1615,7 +1613,7 @@ bond_unixctl_hash(struct unixctl_conn *conn, int argc, const char *argv[], } if (ovs_scan(mac_s, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(mac))) { - hash = bond_hash_src(mac, vlan, basis) & BOND_MASK; + hash = hash_mac(mac, vlan, basis) & BOND_MASK; hash_cstr = xasprintf("%u", hash); unixctl_command_reply(conn, hash_cstr); @@ -1735,19 +1733,13 @@ bond_link_status_update(struct bond_slave *slave) } static unsigned int -bond_hash_src(const struct eth_addr mac, uint16_t vlan, uint32_t basis) -{ - return hash_mac(mac, vlan, basis); -} - -static unsigned int bond_hash(const struct bond *bond, const struct flow *flow, uint16_t vlan) { ovs_assert(bond->balance == BM_TCP || bond->balance == BM_SLB); return (bond->balance == BM_TCP ? flow_hash_5tuple(flow, bond->basis) - : bond_hash_src(flow->dl_src, vlan, bond->basis)); + : hash_mac(flow->dl_src, vlan, bond->basis)); } static struct bond_entry * -- 2.7.4 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev