netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Best way to hook incoming eth pkts?
@ 2003-08-20 15:47 Jeff Garzik
  2003-08-20 17:48 ` Bryan O'Sullivan
  2003-08-20 17:49 ` Michael Richardson
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff Garzik @ 2003-08-20 15:47 UTC (permalink / raw)
  To: netdev

All,

netconsole, netdump, and ATA-over-ethernet (and others?) all have a need
to directly send and receive ethernet packets from inside the kernel.

The sending part is easy and obvious.  The receive part isn't.

Essentially, all the things mentioned above need some way to listen
for incoming ethernet packets.  ATA-over-ethernet has its own
IANA-registered ethernet type, but netconsole and netdump are using
IP/UDP instead of a custom ethernet protocol.

So, two questions for the gurus of the crowd ;-)

1) What is the best way for an in-kernel piece of software to 
receive ethernet packets that are intended for it?

2) Possibly related to #1, is it a good or bad idea to consider sending
netconsole/netdump directly over ethernet, eschewing the IP/UDP/syslog
stuff?

Comments and insight requested.

	Jeff

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

* Re: Best way to hook incoming eth pkts?
  2003-08-20 15:47 Best way to hook incoming eth pkts? Jeff Garzik
@ 2003-08-20 17:48 ` Bryan O'Sullivan
  2003-08-20 17:51   ` Jeff Garzik
  2003-08-20 17:49 ` Michael Richardson
  1 sibling, 1 reply; 8+ messages in thread
From: Bryan O'Sullivan @ 2003-08-20 17:48 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

On Wed, 2003-08-20 at 08:47, Jeff Garzik wrote:

> ATA-over-ethernet has its own
> IANA-registered ethernet type, but netconsole and netdump are using
> IP/UDP instead of a custom ethernet protocol.

This is useful, because it minimises the work needed to get them going
over other transports, such as Myrinet.  I'd rather not see the UDP
encapsulation go away.  Netconsole is already messy enough to configure
and deal with; Matt Mackall's 2.6 forward port, that makes configuration
more IP-oriented instead of less, is a step in the right direction.

	<b

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

* Re: Best way to hook incoming eth pkts?
  2003-08-20 15:47 Best way to hook incoming eth pkts? Jeff Garzik
  2003-08-20 17:48 ` Bryan O'Sullivan
@ 2003-08-20 17:49 ` Michael Richardson
  2003-08-20 17:59   ` Jeff Garzik
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Richardson @ 2003-08-20 17:49 UTC (permalink / raw)
  To: netdev

-----BEGIN PGP SIGNED MESSAGE-----


>>>>> "Jeff" == Jeff Garzik <jgarzik@pobox.com> writes:
    Jeff> Essentially, all the things mentioned above need some way to listen
    Jeff> for incoming ethernet packets.  ATA-over-ethernet has its own
    Jeff> IANA-registered ethernet type, but netconsole and netdump are using
    Jeff> IP/UDP instead of a custom ethernet protocol.

    Jeff> So, two questions for the gurus of the crowd ;-)

    Jeff> 1) What is the best way for an in-kernel piece of software to
    Jeff> receive ethernet packets that are intended for it?

  For ethernet protocols, you can just register the protocol handler, and you
will get them.

    Jeff> 2) Possibly related to #1, is it a good or bad idea to consider
    Jeff> sending netconsole/netdump directly over ethernet, eschewing the
    Jeff> IP/UDP/syslog stuff?

  netconsole makes me really nervous, and I'd rather it was not over IP.
  (If you need a far-away remote console, then get another box with multiple 
serial ports + SSH, or get an Annex, or...)

  Another thing which would like UDP packets is the IPsec NAT-T stuff.
  It is even weirder, because some packets need to be *returned* to the 
UDP socket. (I didn't design this protocol, and argued against putting
the ESP and IKE traffic on the same port, but I lost that argument. I would
have prefered to implement Teredo, and then do IPv4-ESP-IPv6-UDP-IPv4
instead, since it would encourage IPv6)

]      Out and about in Ottawa.    hmmm... beer.                |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
] panic("Just another Debian/notebook using, kernel hacking, security guy");  [


  



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Finger me for keys - custom hacks make this fully PGP2 compat

iQCVAwUBP0O0p4qHRg3pndX9AQGjoAP/R37iSdbaK2aWqAwPZvY1DQ9JVSGdk+bq
RBhtuixa3V2SC/kqacw6eUf4gbEMZZgtA0IP4tP0vYXYv3eIUBeB4wJGTBD7Sezn
Tzwc1hJo/Eplbts+kirAM1DJ9Oh8/2HVVWvEQbyGvOqAE2WKzRrQYiCDuyuarH/F
ksardhGJKcM=
=daOJ
-----END PGP SIGNATURE-----

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

* Re: Best way to hook incoming eth pkts?
  2003-08-20 17:48 ` Bryan O'Sullivan
@ 2003-08-20 17:51   ` Jeff Garzik
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2003-08-20 17:51 UTC (permalink / raw)
  To: Bryan O'Sullivan; +Cc: netdev

On Wed, Aug 20, 2003 at 10:48:17AM -0700, Bryan O'Sullivan wrote:
> On Wed, 2003-08-20 at 08:47, Jeff Garzik wrote:
> 
> > ATA-over-ethernet has its own
> > IANA-registered ethernet type, but netconsole and netdump are using
> > IP/UDP instead of a custom ethernet protocol.
> 
> This is useful, because it minimises the work needed to get them going
> over other transports, such as Myrinet.  I'd rather not see the UDP
> encapsulation go away.  Netconsole is already messy enough to configure
> and deal with; Matt Mackall's 2.6 forward port, that makes configuration
> more IP-oriented instead of less, is a step in the right direction.

Configuration has zero to do with the protocol of choice.

I fully agree that current RH netconsole/netdump configuration is
positively awful...

	Jeff

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

* Re: Best way to hook incoming eth pkts?
  2003-08-20 17:59   ` Jeff Garzik
@ 2003-08-20 17:54     ` David S. Miller
  2003-08-20 18:15       ` Jeff Garzik
  0 siblings, 1 reply; 8+ messages in thread
From: David S. Miller @ 2003-08-20 17:54 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: mcr, netdev

On Wed, 20 Aug 2003 13:59:29 -0400
Jeff Garzik <jgarzik@pobox.com> wrote:

> On Wed, Aug 20, 2003 at 01:49:28PM -0400, Michael Richardson wrote:
> >   For ethernet protocols, you can just register the protocol handler, and you
> > will get them.
> 
> Dumb question:  how?  example code, or relevant functions to grep for?

He's talking about net/core/dev.c:dev_add_pack()

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

* Re: Best way to hook incoming eth pkts?
  2003-08-20 17:49 ` Michael Richardson
@ 2003-08-20 17:59   ` Jeff Garzik
  2003-08-20 17:54     ` David S. Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2003-08-20 17:59 UTC (permalink / raw)
  To: Michael Richardson; +Cc: netdev

On Wed, Aug 20, 2003 at 01:49:28PM -0400, Michael Richardson wrote:
>   For ethernet protocols, you can just register the protocol handler, and you
> will get them.

Dumb question:  how?  example code, or relevant functions to grep for?

grepping for 'register.*prot' didn't seem to turn up anything useful,
and I didn't see any register*ether functions in linux/if_ether.h.

Thanks,

	Jeff

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

* Re: Best way to hook incoming eth pkts?
  2003-08-20 17:54     ` David S. Miller
@ 2003-08-20 18:15       ` Jeff Garzik
  2003-08-20 18:17         ` David S. Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2003-08-20 18:15 UTC (permalink / raw)
  To: David S. Miller; +Cc: mcr, netdev

On Wed, Aug 20, 2003 at 10:54:37AM -0700, David S. Miller wrote:
> On Wed, 20 Aug 2003 13:59:29 -0400
> Jeff Garzik <jgarzik@pobox.com> wrote:
> 
> > On Wed, Aug 20, 2003 at 01:49:28PM -0400, Michael Richardson wrote:
> > >   For ethernet protocols, you can just register the protocol handler, and you
> > > will get them.
> > 
> > Dumb question:  how?  example code, or relevant functions to grep for?
> 
> He's talking about net/core/dev.c:dev_add_pack()

Thanks much.

Tangent, from reading dev.c:  Is it ok that dev_queue_xmit_nit does not
check the return value of struct packet_type's ->func hook?  It seems to
do so in all other cases...

	Jeff

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

* Re: Best way to hook incoming eth pkts?
  2003-08-20 18:15       ` Jeff Garzik
@ 2003-08-20 18:17         ` David S. Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David S. Miller @ 2003-08-20 18:17 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: mcr, netdev

On Wed, 20 Aug 2003 14:15:12 -0400
Jeff Garzik <jgarzik@pobox.com> wrote:

> Tangent, from reading dev.c:  Is it ok that dev_queue_xmit_nit does not
> check the return value of struct packet_type's ->func hook?  It seems to
> do so in all other cases...

The return value isn't really used currently.
It provides congestion heuristics that maybe eventually
will be taken advantage of.

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

end of thread, other threads:[~2003-08-20 18:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-20 15:47 Best way to hook incoming eth pkts? Jeff Garzik
2003-08-20 17:48 ` Bryan O'Sullivan
2003-08-20 17:51   ` Jeff Garzik
2003-08-20 17:49 ` Michael Richardson
2003-08-20 17:59   ` Jeff Garzik
2003-08-20 17:54     ` David S. Miller
2003-08-20 18:15       ` Jeff Garzik
2003-08-20 18:17         ` 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).