Skip to content

Commit

Permalink
can: fix NOHZ local_softirq_pending 08 warning
Browse files Browse the repository at this point in the history
When using nanosleep() in an userspace application we get a ratelimit warning

NOHZ: local_softirq_pending 08

for 10 times.

The echo of CAN frames is done from process context and softirq context only.
Therefore the usage of netif_rx() was wrong (for years).

This patch replaces netif_rx() with netif_rx_ni() which has to be used from
process/softirq context. It also adds a missing comment that can_send() must
no be used from hardirq context.

Signed-off-by: Oliver Hartkopp <[email protected]>
Signed-off-by: Urs Thuermann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Oliver Hartkopp authored and davem330 committed Sep 15, 2009
1 parent 0b6a05c commit 481a819
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/can/vcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev)
skb->dev = dev;
skb->ip_summed = CHECKSUM_UNNECESSARY;

netif_rx(skb);
netif_rx_ni(skb);
}

static netdev_tx_t vcan_tx(struct sk_buff *skb, struct net_device *dev)
Expand Down
4 changes: 3 additions & 1 deletion net/can/af_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
* @skb: pointer to socket buffer with CAN frame in data section
* @loop: loopback for listeners on local CAN sockets (recommended default!)
*
* Due to the loopback this routine must not be called from hardirq context.
*
* Return:
* 0 on success
* -ENETDOWN when the selected interface is down
Expand Down Expand Up @@ -278,7 +280,7 @@ int can_send(struct sk_buff *skb, int loop)
}

if (newskb)
netif_rx(newskb);
netif_rx_ni(newskb);

/* update statistics */
can_stats.tx_frames++;
Expand Down

0 comments on commit 481a819

Please sign in to comment.