diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 42992dcbdda87387def69d261516c1a9806921d1..425e983bab93069c42b5a32e876a41c70226d232 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -833,7 +833,8 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) if (txq >= numqueues) goto drop; - if (numqueues == 1) { +#ifdef CONFIG_RPS + if (numqueues == 1 && static_key_false(&rps_needed)) { /* Select queue was not called for the skbuff, so we extract the * RPS hash and save it into the flow_table here. */ @@ -848,6 +849,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) tun_flow_save_rps_rxhash(e, rxhash); } } +#endif tun_debug(KERN_INFO, tun, "tun_net_xmit %d\n", skb->len); diff --git a/net/core/dev.c b/net/core/dev.c index e96a3bc2c63473f479b30ed4098964aec1149387..c2f3d5dbde56050a3b41330690b8f16d62b6ec00 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3469,6 +3469,7 @@ u32 rps_cpu_mask __read_mostly; EXPORT_SYMBOL(rps_cpu_mask); struct static_key rps_needed __read_mostly; +EXPORT_SYMBOL(rps_needed); static struct rps_dev_flow * set_rps_cpu(struct net_device *dev, struct sk_buff *skb,