* [PATCH] netif_rx from non interrupt context
@ 2001-07-30 19:24 Maksim Krasnyanskiy
2001-07-31 1:53 ` David S. Miller
2001-07-31 17:11 ` Maksim Krasnyanskiy
0 siblings, 2 replies; 4+ messages in thread
From: Maksim Krasnyanskiy @ 2001-07-30 19:24 UTC (permalink / raw)
To: linux-kernel; +Cc: davem, andrea, torvalds, kuznet
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] netif_rx from non interrupt context
2001-07-30 19:24 [PATCH] netif_rx from non interrupt context Maksim Krasnyanskiy
@ 2001-07-31 1:53 ` David S. Miller
2001-07-31 17:11 ` Maksim Krasnyanskiy
1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2001-07-31 1:53 UTC (permalink / raw)
To: Maksim Krasnyanskiy; +Cc: linux-kernel, andrea, torvalds, kuznet
Maksim Krasnyanskiy writes:
> Generic function for the net drivers that call netif_rx from non interrupt context.
> And TUN/TAP driver patch.
No, let us do it explicitly in the drivers, not create a new API for
this.
Maybe we should add "Send to socket with BH disabled" or a "insert to
generic linked list with spinlock held" interfaces too? :-)
Later,
David S. Miller
davem@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] netif_rx from non interrupt context
2001-07-30 19:24 [PATCH] netif_rx from non interrupt context Maksim Krasnyanskiy
2001-07-31 1:53 ` David S. Miller
@ 2001-07-31 17:11 ` Maksim Krasnyanskiy
2001-07-31 18:13 ` kuznet
1 sibling, 1 reply; 4+ messages in thread
From: Maksim Krasnyanskiy @ 2001-07-31 17:11 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-kernel, andrea, torvalds, kuznet
> > Generic function for the net drivers that call netif_rx from non interrupt context.
> > And TUN/TAP driver patch.
>
>No, let us do it explicitly in the drivers, not create a new API for this.
Well, the thing is that we can probably optimize that function (like you guys did for a local_bh_enable) because it's
a critical path. Also it makes sense (to me) to hide softirq implementation details from the net drivers.
If softirqs are changed again we can fix one place instead of auditing net drivers.
>Maybe we should add "Send to socket with BH disabled" or a "insert to generic linked list with spinlock held" interfaces too ? :-)
:-)
Max
Maksim Krasnyanskiy
Senior Kernel Engineer
Qualcomm Incorporated
maxk@qualcomm.com
http://bluez.sf.net
http://vtun.sf.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] netif_rx from non interrupt context
2001-07-31 17:11 ` Maksim Krasnyanskiy
@ 2001-07-31 18:13 ` kuznet
0 siblings, 0 replies; 4+ messages in thread
From: kuznet @ 2001-07-31 18:13 UTC (permalink / raw)
To: Maksim Krasnyanskiy; +Cc: davem, linux-kernel, andrea, torvalds
Hello!
> a critical path. Also it makes sense (to me) to hide softirq implementation details from the net drivers.
He tells right thing... The fact that netif_rx() is invalid in this context
and, especially, way to make it valid is not evident. It was not evident
for me three days ago, at least. :-)
Seems, it is better to hide this yet.
Alexey
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-07-31 18:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-30 19:24 [PATCH] netif_rx from non interrupt context Maksim Krasnyanskiy
2001-07-31 1:53 ` David S. Miller
2001-07-31 17:11 ` Maksim Krasnyanskiy
2001-07-31 18:13 ` kuznet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®