[ovs-dev] [PATCH 12/14] datapath: Don't set dev->last_rx on kernels >= 2.6.29.

Jesse Gross jesse at nicira.com
Thu Dec 2 20:37:01 UTC 2010


dev->last_rx is used for rebalancing in Linux bonding.  However,
on a SMP machine it quickly becomes a very hot cacheline.  On
kernels 2.6.29 and later the networking core will update last_rx
only if bonding is in use, so drivers do not need to set it at all.

Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 datapath/vport-internal_dev.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index ec0052c..3e820a6 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -12,6 +12,7 @@
 #include <linux/ethtool.h>
 #include <linux/rcupdate.h>
 #include <linux/skbuff.h>
+#include <linux/version.h>
 
 #include "datapath.h"
 #include "vport-generic.h"
@@ -273,7 +274,10 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
 		netif_rx(skb);
 	else
 		netif_rx_ni(skb);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
 	netdev->last_rx = jiffies;
+#endif
 
 	return len;
 }
-- 
1.7.1





More information about the dev mailing list