-struct port_lookup_key {
- const struct tnl_mutable_config *mutable;
- __be64 key;
- u32 tunnel_type;
- __be32 saddr;
- __be32 daddr;
-};
-
-/*
- * Modifies 'target' to store the rcu_dereferenced pointer that was used to do
- * the comparision.
- */
-static int port_cmp(const struct tbl_node *node, void *target)
-{
- const struct tnl_vport *tnl_vport = tnl_vport_table_cast(node);
- struct port_lookup_key *lookup = target;
-
- lookup->mutable = rcu_dereference_rtnl(tnl_vport->mutable);
-
- return (lookup->mutable->tunnel_type == lookup->tunnel_type &&
- lookup->mutable->daddr == lookup->daddr &&
- lookup->mutable->in_key == lookup->key &&
- lookup->mutable->saddr == lookup->saddr);
-}
-
-static u32 port_hash(struct port_lookup_key *k)
-{
- u32 x = jhash_3words((__force u32)k->saddr, (__force u32)k->daddr,
- k->tunnel_type, 0);
- return jhash_2words((__force u64)k->key >> 32, (__force u32)k->key, x);
-}
-
-static u32 mutable_hash(const struct tnl_mutable_config *mutable)