When Recving tcp stream form LOCAL port, and flows have a dp_hash group, linux call 
skb_set_hash_from_sk to set skb->hash and skb->l4_hash, ovs use skb->hash to 
select group bucket.
When tcp retransmission occurs,linux call sk_rethink_txhash to rehash skb->hash 
of retransmission packet, so the retransmission packet will select a different 
bucket than the original package.
ovs should ignore l4_hash,and call __skb_get_hash to get hash

Signed-off-by: grimlock.lw <[email protected]>
---
 datapath/actions.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/datapath/actions.c b/datapath/actions.c
index fbf445703..381037c05 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -1100,6 +1100,7 @@ static void execute_hash(struct sk_buff *skb, struct 
sw_flow_key *key,
        u32 hash = 0;
/* OVS_HASH_ALG_L4 is the only possible hash algorithm. */
+       skb->l4_hash = 0;
        hash = skb_get_hash(skb);
        hash = jhash_1word(hash, hash_act->hash_basis);
        if (!hash)

Ignoring the hash that comes from the tcp stack would incur in extra processing for every packet which would probably have a significant performance impact.

Besides, the whole point of changing the hash on retransmits is to allow routing engines to route the packet through a less congested path. I understand that, if what you're doing in the buckets is selecting an endpoint (e.g: service load balancing), this could make things worse on established connections, but that's just one of the possible uses cases which could probably be fixed by using connection tracking.

Also, note that patches in the datapath should go to the kernel tree.

Thanks.
--
Adrián Moreno

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to