X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fdatapath.c;h=b95c8f25539fc5d98f44707804c78f44fc629a3c;hb=4faaba2b90979e1106b8c9b0430481f2cc62364d;hp=cf163234086b3800f8593b6259c1015ffd22c135;hpb=e0ce13c4dc34f44d81e0001882a0be88321b5c87;p=openvswitch diff --git a/datapath/datapath.c b/datapath/datapath.c index cf163234..b95c8f25 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -817,9 +817,11 @@ static int do_put_flow(struct datapath *dp, struct odp_flow_put *uf, struct sw_flow *flow; struct tbl *table; int error; + u32 hash; + hash = flow_hash(&uf->flow.key); table = get_table_protected(dp); - flow_node = tbl_lookup(table, &uf->flow.key, flow_hash(&uf->flow.key), flow_cmp); + flow_node = tbl_lookup(table, &uf->flow.key, hash, flow_cmp); if (!flow_node) { /* No such flow. */ struct sw_flow_actions *acts; @@ -853,7 +855,7 @@ static int do_put_flow(struct datapath *dp, struct odp_flow_put *uf, rcu_assign_pointer(flow->sf_acts, acts); /* Put flow in bucket. */ - error = tbl_insert(table, &flow->tbl_node, flow_hash(&flow->key)); + error = tbl_insert(table, &flow->tbl_node, hash); if (error) goto error_free_flow_acts;