bond: Remove bond_hash_src.
Since introduction of 'hash_mac()' function in
commit ("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
@@ -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);
@@ -1734,12 +1732,6 @@ 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)
{
@@ -1747,7 +1739,7 @@ bond_hash(const struct bond *bond, const struct flow *flow, uint16_t vlan)
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 *
