On Tue, Sep 19, 2000 at 02:14:37PM -0400, Rabeeh Khoury wrote:
> I am working on a Galileo Technology evaluation board. I'm writing
> ethernet driver for our embedded systems and I have to ethernet ports.
> I need to ask if there is a way for implementing the following scenario
> for the ethernet drivers to be activated as two ethernet ports router :
> 1.. The ethernet driver receives a packet
> 2.. The ethernet driver checks if the packet should be forwarded to
> another interface. The checking is done by query to the kernel routing
> 3.. If the packet should be forwarded, the ethernet driver queues the
> packet to the destination interface with slight changes (source and
> destination MAC addresses).
> If this scenario possible, please send me the functions that I should
> use. (dev_queue_xmit for queing a packet to another interface ??!!)
> The main motive in this scenario is that I don't want that the packet to
> be handed to the kernel IP stack, then to decide if it should be routed
> or not ; I want from the ethernet driver to know if the packet should be
> routed or not, and if to be routed to which interface.
> Another question :
> How can I know from the sk_buff when handed to the ethernet driver, if
> it is a routed packet or it's origin is from the local CPU ?
> p.s. I'm using kernel 2.2.14 (MIPS based CPU)
Sounds like what you want is CONFIG_NET_FASTROUTE; here's what
Documentation/Configure says about it:
Saying Y here enables direct NIC-to-NIC (NIC = Network Interface
Card) data transfers on the local network, which is fast.
IMPORTANT NOTE: This option is NOT COMPATIBLE with "Network packet
filtering" (CONFIG_NETFILTER). Say N here if you say Y there.
However, it will work with all options in the "IP: advanced router"
section (except for "IP: use TOS value as routing key" and
"IP: use FWMARK value as routing key").
At the moment, few devices support fast switching (tulip is one of
them, a modified 8390 driver can be found at
If unsure, say N.