X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Ftunnel.c;h=3bf58ddf5a54867a0d6ab1eb6f868e20676a4364;hb=0e70cdcb8ddeb20417e682fd63769f9d16601b07;hp=100794e0d524b86e2c7c2cb4a2fb4b7589ddb8fa;hpb=f686a33af8cb41ee228e6a35410c9a488fba3eb1;p=openvswitch diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 100794e0..3bf58ddf 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -174,7 +174,7 @@ static unsigned int *find_port_pool(const struct tnl_mutable_config *mutable) static u32 port_hash(const struct port_lookup_key *key) { - return jhash2((u32*)key, (sizeof(*key) / sizeof(u32)), 0); + return jhash2((u32*)key, (PORT_KEY_LEN / sizeof(u32)), 0); } static inline struct hlist_head *find_bucket(u32 hash) @@ -241,7 +241,7 @@ static struct tnl_vport *port_table_lookup(struct port_lookup_key *key, struct tnl_mutable_config *mutable; mutable = rcu_dereference_rtnl(tnl_vport->mutable); - if (!memcmp(&mutable->key, key, sizeof(*key))) { + if (!memcmp(&mutable->key, key, PORT_KEY_LEN)) { *pmutable = mutable; return tnl_vport; } @@ -813,9 +813,9 @@ static inline void create_eth_hdr(struct tnl_cache *cache, cache->hh_seq = hh_seq; #else - read_lock_bh(&rt_dst(rt).hh->hh_lock); + read_lock(&rt_dst(rt).hh->hh_lock); memcpy(cache_data, (void *)rt_dst(rt).hh->hh_data + hh_off, hh_len); - read_unlock_bh(&rt_dst(rt).hh->hh_lock); + read_unlock(&rt_dst(rt).hh->hh_lock); #endif } @@ -842,7 +842,7 @@ static struct tnl_cache *build_cache(struct vport *vport, * If lock is contended fall back to directly building the header. * We're not going to help performance by sitting here spinning. */ - if (!spin_trylock_bh(&tnl_vport->cache_lock)) + if (!spin_trylock(&tnl_vport->cache_lock)) return NULL; cache = cache_dereference(tnl_vport); @@ -910,7 +910,7 @@ done: assign_cache_rcu(vport, cache); unlock: - spin_unlock_bh(&tnl_vport->cache_lock); + spin_unlock(&tnl_vport->cache_lock); return cache; }