ipvlan: use netif_receive_skb() in ipvlan_process_multicast()
Subsystems (2)
PATCH 1/1 ipvlan: use netif_receive_skb() in ipvlan_process_multicast()
ipvlan_process_multicast() runs from process context, there is no risk of stack overflow if we call netif_receive_skb() instead of netif_rx().
This avoids some overhead adding/removing skbs to/from a per-cpu backlog and raising/processing NET_RX softirqs.
--- drivers/net/ipvlan/ipvlan_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ipvlan/ipvlan_core.c +1 -1
@@ -286,7 +286,7 @@ void ipvlan_process_multicast(struct work_struct *work)if (tx_pkt) ret =dev_forward_skb (ipvlan->dev, nskb);else - ret =netif_rx (nskb); + ret =netif_receive_skb (nskb); }ipvlan_count_rx (ipvlan, len, ret ==NET_RX_SUCCESS , true);local_bh_enable ();
Signature · 1 line
2.54.0.545.g6539524ca2-goog
Quoted 18 lines · Eric Dumazet
ipvlan_process_multicast()runs from process context, there is no risk of stack overflow if we callnetif_receive_skb()instead ofnetif_rx().This avoids some overhead adding/removing skbs to/from a per-cpu backlog and raising/processing
NET_RXsoftirqs.Signed-off-by Eric Dumazet <[email protected]>--- drivers/net/ipvlan/ipvlan_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ipvlan/ipvlan_core.c +0
-0
drivers/net/ipvlan/ipvlan_core.c void ipvlan_process_multicast(struct work_struct *work) · line 292
Quoted 8 lines
drivers/net/ipvlan/ipvlan_core.c +1
-1@@ -286,7 +286,7 @@ void ipvlan_process_multicast(struct work_struct *work)if (tx_pkt) ret =dev_forward_skb (ipvlan->dev, nskb);else - ret =netif_rx (nskb); + ret =netif_receive_skb (nskb); }ipvlan_count_rx (ipvlan, len, ret ==NET_RX_SUCCESS , true);local_bh_enable ();
I will send a V2, to limit the number of netif_receive_skb() in presence of large number of ipvlans.
pw-bot: cr
Quoted 15 lines · Eric Dumazet
Quoted 13 lines · Eric Dumazet
ipvlan_process_multicast()runs from process context, there is no risk of stack overflow if we callnetif_receive_skb()instead ofnetif_rx().This avoids some overhead adding/removing skbs to/from a per-cpu backlog and raising/processing
NET_RXsoftirqs.Signed-off-by Eric Dumazet <[email protected]>--- drivers/net/ipvlan/ipvlan_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
drivers/net/ipvlan/ipvlan_core.c void ipvlan_process_multicast(struct work_struct *work) · line 292
Quoted 13 lines
drivers/net/ipvlan/ipvlan_core.c +1
-1@@ -286,7 +286,7 @@ void ipvlan_process_multicast(struct work_struct *work)if (tx_pkt) ret =dev_forward_skb (ipvlan->dev, nskb);else - ret =netif_rx (nskb); + ret =netif_receive_skb (nskb); }ipvlan_count_rx (ipvlan, len, ret ==NET_RX_SUCCESS , true);local_bh_enable ();I will send a V2, to limit the number of
netif_receive_skb()in presence of large number of ipvlans.
Well, this was caused this sashiko report:
Because netif_receive_skb() traverses the networking stack synchronously, it bypasses the backlog and softirq processing budgets. In environments with many IPVLAN sub-interfaces, delivering a broadcast or multicast packet could monopolize the CPU for an unbounded amount of time before reaching rcu_read_unlock().
But using netif_rx(nskb) had the same problem.
Each packet was immediately processed at the local_bh_enable() time.
So I do not think a V2 is needed.