diff options
author | Ilya Maximets <i.maximets@samsung.com> | 2017-07-25 13:46:39 +0300 |
---|---|---|
committer | Andy Zhou <azhou@ovn.org> | 2017-07-25 11:33:12 -0700 |
commit | e9013d6ac8dc9adbb4291b4caaf48ba29e275449 (patch) | |
tree | 5bff50288f02c65a91017bb3795082b1e4965906 /ofproto | |
parent | 42781e77035daad70365e87bb4cda1346efd4ba7 (diff) | |
download | openvswitch-e9013d6ac8dc9adbb4291b4caaf48ba29e275449.tar.gz |
bond: Remove bond_hash_src.
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 <azhou@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/bond.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/ofproto/bond.c b/ofproto/bond.c index e4d4b654b..e09136efb 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 * |