path: root/net/core
diff options
authorJason Wang <>2016-04-25 23:13:42 -0400
committerDavid S. Miller <>2016-04-28 16:38:54 -0400
commit3df97ba83019d524c012fd43d3216d4cc3005955 (patch)
treed913793fb00287a9e120f36d9a6d274a0257c2f4 /net/core
parentf345c9a5726d10cc3613d17ae75dcb1ab0986ba1 (diff)
tuntap: calculate rps hash only when needed
There's no need to calculate rps hash if it was not enabled. So this patch export rps_needed and check it before trying to get rps hash. Tests (using pktgen to inject packets to guest) shows this can improve pps about 13% (when rps is disabled). Before: ~1150000 pps After: ~1300000 pps Cc: Michael S. Tsirkin <> Signed-off-by: Jason Wang <> ---- Changes from V1: - Fix build when CONFIG_RPS is not set Signed-off-by: David S. Miller <>
Diffstat (limited to 'net/core')
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index e96a3bc2c634..c2f3d5dbde56 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3469,6 +3469,7 @@ u32 rps_cpu_mask __read_mostly;
struct static_key rps_needed __read_mostly;
static struct rps_dev_flow *
set_rps_cpu(struct net_device *dev, struct sk_buff *skb,