On Fri, 2006-30-06 at 02:46 +0200, Thomas Graf wrote: > * jamal <[EMAIL PROTECTED]> 2006-06-29 20:03 > > On Fri, 2006-30-06 at 01:39 +0200, Thomas Graf wrote: > > > * jamal <[EMAIL PROTECTED]> 2006-06-29 19:23 > > > > > > not at all. Let me explain the design intent further below. > > > > > > Then let me show you what your code does: > > > > > > [mirred attached to filter on eth0 redirecting to ifb0] > > > > > > tcf_mirred(): skb2->input_dev = skb->dev; (skb2->input_dev=eth0) > > > ifb_xmit(): skb->dev = skb->input_dev; (skb->dev=eth0) > > > skb->input_dev = dev; (skb->input_dev=ifb0) > > > > > > So when reentering the stack the skb looks like it would be > > > on eth0 coming from ifb0. Is that what you wanted? > > > > ok, that looks like egress side of the stack, correct? > > No, that's the ingress side leaving ifb again via netif_rx() > > skb->dev should represent the from/at= and not to=. >
Heres what it would look at ingress: step 0: coming from wire via eth0, dev=eth0, input_dev=eth0 step 1: redirect to ifb0, leaving redirect dev=ifb0, input_dev=eth0 step 2: leaving ifb0, coming back to ingress side of stack dev= eth0, input_dev=ifb0 Again, it gets interesting when you have redirection multiple times and create loops. It will get more interesting when i submit the code for redirecting to ingress. The good news is there is very strong consistency. I dont know if "at" is the correct description. I visualize it as hitting the stack just "at" the point. when the packet first comes in both from/to point to eth0. So the semantics are the same as in egress. > For egress your code is correct although impossible to guess > right due to total lack of a comment where it would make sense > and naming that doesn't give any implications. > There are some simple comments and I have been trying very hard to explain this for a long time. Patrick was the last person who tortured me ;-> Perhaps i need to write a document. > When leaving ifb0 you want for... > ... egress: > skb->dev=to (eth0) skb->iif=from (ifb0) > ... ingress: > skb->dev=at (ifb0) skb->iif=from (eth0) > Yes, this is correct. I described the flow of the first one in the earlier email and the ingress side. Although lets not talk about iif yet. I posed a question earlier on which scheme would be better. > So we move the update to the tasklet and set skb->dev to > skb->iif before dev_queue_xmit() and skb->dev = dev (ifb) > before calling netif_rx() > > Does that fullfil your requirements? You lost me on what you are trying to achieve. Just restore the line you removed in ifb and things would be fine. Lets then settle the issue of iif vs input_dev. cheers, jamal - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html