linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: feature request - why not make netif_rx() a pointer?
@ 2002-10-23  0:39 Jean Tourrilhes
  2002-10-23 13:39 ` Slavcho Nikolov
  0 siblings, 1 reply; 26+ messages in thread
From: Jean Tourrilhes @ 2002-10-23  0:39 UTC (permalink / raw)
  To: Linux kernel mailing list, Slavcho Nikolov; +Cc: Jeff Garzik

Slavcho Nikolov wrote :
> Non GPL modules that want to attach themselves between all L2 drivers and
> upper layers would not have to incur a performance loss if netif_rx() is
> made a
> pointer instead of a function (whether or not NET filters are compiled in
> the kernel).
> Currently control can be easily wrested from netif_rx() and others through
> injection of a few instructions into the running kernel (SMC - self
> modifying code)

	Assuming that every L2 is Ethernet and every L3 is IP ?
	Well, I've got news for you : IrDA drivers are using
netif_rx() to pass IrLAP frames to the IrDA stack, and 802.11 driver
in the future will pass 802.11 frames to the 802.2 LLC layer via
netif_rx().
	Please don't do that, I don't want people breaking the IrDA
stack in weird ways just because some random clueless code hijacked
netif_rx(). Use netfilters, or define your own private protocol/packet
type to do what you want.

	Regards,

	Jean


^ permalink raw reply	[flat|nested] 26+ messages in thread
* feature request - why not make netif_rx() a pointer?
@ 2002-10-22 21:01 Slavcho Nikolov
  2002-10-22 21:15 ` Matti Aarnio
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Slavcho Nikolov @ 2002-10-22 21:01 UTC (permalink / raw)
  To: linux-kernel

Non GPL modules that want to attach themselves between all L2 drivers and
upper layers would not have to incur a performance loss if netif_rx() is
made a
pointer instead of a function (whether or not NET filters are compiled in
the kernel).
Currently control can be easily wrested from netif_rx() and others through
injection of a few instructions into the running kernel (SMC - self
modifying code)
but decreased performance is one sad consequence. Architecture specific
maintenance of SMC slows down portability, too.
The following suggestion would lead to the least amount of modifications.

The global variable "int (*netif_rx)(struct sk_buff *) = &default_netif_rx;"
gets initialized to the address of a function whose body is the default
implementation.
Drivers calling netif_rx explicitly need to be able to see the prototype
"extern int (*netif_rx)(struct sk_buff *);" or else blow up.
No further changes would be necessary because the current 200+ explicit
references
to "netif_rx(skb);"  become a poorly written "(*netif_rx)(skb);" call.
S.N.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2002-10-25 11:44 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-23  0:39 feature request - why not make netif_rx() a pointer? Jean Tourrilhes
2002-10-23 13:39 ` Slavcho Nikolov
2002-10-23 14:03   ` Chris Friesen
2002-10-23 16:23     ` over&out (Re: feature request - why not make netif_rx() a pointer?) Slavcho Nikolov
2002-10-23 22:59       ` jw schultz
2002-10-24  6:25         ` Gilad Ben-Yossef
2002-10-24  7:08           ` Ben Greear
2002-10-25 11:50       ` Adrian Bunk
2002-10-23 16:48   ` feature request - why not make netif_rx() a pointer? Jean Tourrilhes
2002-10-23 17:27     ` Ben Greear
2002-10-24  4:13   ` David S. Miller
2002-10-24  9:28     ` Henning P. Schmiedehausen
2002-10-24 10:15       ` David S. Miller
2002-10-24 11:01         ` Henning Schmiedehausen
2002-10-24 13:30     ` Slavcho Nikolov
2002-10-24 13:46       ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2002-10-22 21:01 Slavcho Nikolov
2002-10-22 21:15 ` Matti Aarnio
2002-10-22 22:42   ` David S. Miller
2002-10-22 23:16     ` Ben Greear
2002-10-22 23:29     ` Jeff Garzik
2002-10-23 15:16     ` Henning P. Schmiedehausen
2002-10-23 16:11       ` Alan Cox
2002-10-23 16:26         ` Henning P. Schmiedehausen
2002-10-22 21:30 ` Alan Cox
2002-10-22 22:40 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).