[PATCH 4.4 15/93] ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast()
From: Greg Kroah-Hartman
Date: Thu Mar 19 2020 - 09:38:38 EST
From: Eric Dumazet <edumazet@xxxxxxxxxx>
[ Upstream commit afe207d80a61e4d6e7cfa0611a4af46d0ba95628 ]
Commit e18b353f102e ("ipvlan: add cond_resched_rcu() while
processing muticast backlog") added a cond_resched_rcu() in a loop
using rcu protection to iterate over slaves.
This is breaking rcu rules, so lets instead use cond_resched()
at a point we can reschedule
Fixes: e18b353f102e ("ipvlan: add cond_resched_rcu() while processing muticast backlog")
Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
Cc: Mahesh Bandewar <maheshb@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/net/ipvlan/ipvlan_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -240,7 +240,6 @@ void ipvlan_process_multicast(struct wor
ret = netif_rx(nskb);
acct:
ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS, true);
- cond_resched_rcu();
}
rcu_read_unlock();
@@ -252,6 +251,7 @@ acct:
} else {
kfree_skb(skb);
}
+ cond_resched();
}
}