[PATCH] netif_rx from non interrupt context

From: Maksim Krasnyanskiy (maxk@qualcomm.com)
Date: Mon Jul 30 2001 - 14:24:08 EST


Hi Folks,

Generic function for the net drivers that call netif_rx from non interrupt context.
And TUN/TAP driver patch.

--- linux/include/linux/netdevice.h.old Mon Jul 30 11:37:27 2001
+++ linux/include/linux/netdevice.h Mon Jul 30 11:48:32 2001
@@ -563,6 +563,19 @@
  
  extern int netdev_nit;
  
+
+/*
+ * netif_rx_ni - post buffer to the network code from _non interrupt_ context.
+ * see net/core/dev.c for netif_rx description.
+ */
+static inline int netif_rx_ni(struct sk_buff *skb)
+{
+ int err = netif_rx(skb);
+ if (softirq_pending(smp_processor_id()))
+ do_softirq();
+ return err;
+}
+

--- linux/drivers/net/tun.c.old Mon Jun 11 19:15:27 2001
+++ linux/drivers/net/tun.c Mon Jul 30 11:49:01 2001
@@ -218,7 +218,7 @@
         if (tun->flags & TUN_NOCHECKSUM)
                 skb->ip_summed = CHECKSUM_UNNECESSARY;
   
- netif_rx(skb);
+ netif_rx_ni(skb);
     
         tun->stats.rx_packets++;
         tun->stats.rx_bytes += len;

Thanks
Max

Maksim Krasnyanskiy
Senior Kernel Engineer
Qualcomm Incorporated

maxk@qualcomm.com
http://bluez.sf.net
http://vtun.sf.net

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:45 EST