[ovs-discuss] [PATCH-RFC 2/2] Improve ARP latency

Pradeep Satyanarayana pradeeps at linux.vnet.ibm.com
Wed Sep 30 04:41:45 UTC 2015


skb_get_hash() returns a 0 (invalid hash) for arp packets resulting in same
ids_index for every arp packet. This results in a single ovs-vswitchd 
handler
thread processing every arp packet severely impacting the average latency of
arps. This change spreads the work evenly between all the handler threads.

---
   datapath/vport.c | 6 ++++++
   1 file changed, 6 insertions(+)

diff --git a/datapath/vport.c b/datapath/vport.c
index 024491f..20d20fa 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -465,6 +465,12 @@ u32 ovs_vport_find_upcall_portid(const struct
vport *vport, struct sk_buff *skb)
   		 if (ids->n_ids == 1 && ids->ids[0] == 0)
   		 		 return 0;

+		 /* skb_get_hash() is not supporting ETH_P_ARP packets returning a 0
+		  * (invalid hash) for every ARP.
+		  */
+		 if (skb->protocol == ntohs(ETH_P_ARP))
+		 		 return ids->ids[vport->port_no%ids->n_ids];
+
   		 hash = skb_get_hash(skb);
   		 return ids->ids[hash - ids->n_ids * reciprocal_divide(hash, 
ids->rn_ids)];
   }




More information about the discuss mailing list