2002-10-02 13:59:11

by will fitzgerald

[permalink] [raw]
Subject: this code does not get called in dev.c so do we need it?

hi all,

this code excerpt from net_rx_action in dev.c does not
get executed at all. is there any need for it? what
does it do?

i inserted printk's in it just about everywhere.
i have a test network set up, A talks to C via router
B
(kernel 2.4.14)
justificattion:
i've pinged C from A, I've pinged eth0 on B from
A,I've pinged eth1 on B from A and i've pinged A from
router B and in no instance was any of the following
code executed.

whats CONFIG_NET_FASTROUTE supposed to do?

the only part that does get executed are the lines:
"skb->h.raw = skb->nh.raw = skb->data;
{struct packet_type *ptype, *pt_prev;
unsigned short type = skb->protocol;
pt_prev = NULL;" just after the
CONFIG_NET_FASTROUTE section of code.

#ifdef CONFIG_NET_FASTROUTE
if (skb->pkt_type == PACKET_FASTROUTE) {
netdev_rx_stat[this_cpu].fastroute_deferred_out++;
dev_queue_xmit(skb);
dev_put(rx_dev);
continue;
}
#endif
skb->h.raw = skb->nh.raw = skb->data;
{

struct packet_type *ptype, *pt_prev;
unsigned short type = skb->protocol;

pt_prev = NULL;
for (ptype = ptype_all; ptype; ptype = ptype->next)
{
if (!ptype->dev || ptype->dev == skb->dev) {
if (pt_prev) {
if (!pt_prev->data) {
deliver_to_old_ones(pt_prev, skb, 0);
} else {
atomic_inc(&skb->users);
pt_prev->func(skb,
skb->dev,
pt_prev);
}
}
pt_prev = ptype;
}
}

#ifdef CONFIG_NET_DIVERT
if (skb->dev->divert && skb->dev->divert->divert)
handle_diverter(skb);
#endif /* CONFIG_NET_DIVERT */


#if defined(CONFIG_BRIDGE) ||
defined(CONFIG_BRIDGE_MODULE)
if (skb->dev->br_port != NULL &&
br_handle_frame_hook != NULL) {
handle_bridge(skb, pt_prev);
dev_put(rx_dev);
continue;
}
#endif

if i'm wrong let me know,
thanks.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


2002-10-03 00:12:23

by David Miller

[permalink] [raw]
Subject: Re: this code does not get called in dev.c so do we need it?


Fast routing, although not implemented in any in-tree drivers,
does get used by some people who have hacked up drivers to support
this.

It allows IPv4 routing to occur right at the level of the device
driver, it directly pushes an input packet to the output routine
of the destination device all without leaving the driver.

This code is used.

2002-10-03 11:08:26

by will fitzgerald

[permalink] [raw]
Subject: Re: this code does not get called in dev.c so do we need it?

thanks David, for your speedy reply.

you say that fast routing occurs in the device driver
level.
how does it send a packet from router eth0 to router
eth1?
is it on the bus? (is this like zero copy jumping from
one device directly to another?)

if fast routing saves time in not having to go to the
ip layer why is it not used alll the time?

is it buggy?

i know you say it hasn't been implemented in the
drivers and you actually have to hack the drivers to
do it,but why have hack the drivers at all?

thanks,
will.

--- "David S. Miller" <[email protected]> wrote: >
> Fast routing, although not implemented in any
> in-tree drivers,
> does get used by some people who have hacked up
> drivers to support
> this.
>
> It allows IPv4 routing to occur right at the level
> of the device
> driver, it directly pushes an input packet to the
> output routine
> of the destination device all without leaving the
> driver.
>
> This code is used.
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

2002-10-03 11:16:38

by David Miller

[permalink] [raw]
Subject: Re: this code does not get called in dev.c so do we need it?

From: will fitzgerald <[email protected]>
Date: Thu, 3 Oct 2002 12:13:56 +0100 (BST)

you say that fast routing occurs in the device driver
level.
how does it send a packet from router eth0 to router
eth1?
is it on the bus? (is this like zero copy jumping from
one device directly to another?)

It passes the packet directly to the output method of
the target device for the route. Just like I said in
my original email, nothing more nothing less.

if fast routing saves time in not having to go to the
ip layer why is it not used alll the time?

Because it is used only by a limited number of people
and it makes drivers harder to maintain since very few
people have the setups necessary to test this feature
properly.

is it buggy?

No.

2002-10-03 20:08:42

by Nick

[permalink] [raw]
Subject: Re: this code does not get called in dev.c so do we need it?

I'm not sure if this is a dumb question, but why arn't there any in-tree
drivers with support for this? Is it too ugly to merge?
Nick

On Wed, 2 Oct 2002, David S. Miller wrote:

>
> Fast routing, although not implemented in any in-tree drivers,
> does get used by some people who have hacked up drivers to support
> this.
>
> It allows IPv4 routing to occur right at the level of the device
> driver, it directly pushes an input packet to the output routine
> of the destination device all without leaving the driver.
>
> This code is used.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>