+static struct vport *port_table_lookup(struct port_lookup_key *key,
+ const struct tnl_mutable_config **pmutable)
+{
+ struct hlist_node *n;
+ struct hlist_head *bucket;
+ u32 hash = port_hash(key);
+ struct tnl_vport * tnl_vport;
+
+ bucket = find_bucket(hash);
+
+ hlist_for_each_entry_rcu(tnl_vport, n, bucket, hash_node) {
+ struct tnl_mutable_config *mutable;
+
+ mutable = rcu_dereference_rtnl(tnl_vport->mutable);
+ if (!memcmp(&mutable->key, key, PORT_KEY_LEN)) {
+ *pmutable = mutable;
+ return tnl_vport_to_vport(tnl_vport);
+ }
+ }
+
+ return NULL;