Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-26 Thread Patrick McHardy
Arnd Bergmann wrote: On Tuesday 24 November 2009, Patrick McHardy wrote: Eric W. Biederman wrote: I don't quite follow what you intend with dev_queue_xmit when the macvlan is in one namespace and the real physical device is in another. Are you mentioning that the packet classifier runs in

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-26 Thread Eric W. Biederman
Patrick McHardy ka...@trash.net writes: Arnd Bergmann wrote: On Tuesday 24 November 2009, Patrick McHardy wrote: Eric W. Biederman wrote: I don't quite follow what you intend with dev_queue_xmit when the macvlan is in one namespace and the real physical device is in another. Are you

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-26 Thread Arnd Bergmann
On Thursday 26 November 2009, Patrick McHardy wrote: In addition to those already handled, I'd say - priority: affects qdisc classification, may refer to classes of the old namespace - ipvs_property: might cause packets to incorrectly skip netfilter hooks - nf_trace: might trigger packet

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-26 Thread Patrick McHardy
Arnd Bergmann wrote: On Thursday 26 November 2009, Patrick McHardy wrote: In addition to those already handled, I'd say - priority: affects qdisc classification, may refer to classes of the old namespace - ipvs_property: might cause packets to incorrectly skip netfilter hooks - nf_trace:

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Patrick McHardy
Arnd Bergmann wrote: +int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) +{ + skb_orphan(skb); + + if (!(dev-flags IFF_UP)) + return NET_RX_DROP; + + if (skb-len (dev-mtu + dev-hard_header_len)) + return NET_RX_DROP; + +

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Arnd Bergmann
On Tuesday 24 November 2009 09:51:19 Patrick McHardy wrote: + skb_dst_drop(skb); + skb-tstamp.tv64 = 0; + skb-pkt_type = PACKET_HOST; + skb-protocol = eth_type_trans(skb, dev); + skb-mark = 0; skb-mark clearing should stay private to veth since its usually

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Patrick McHardy
Arnd Bergmann wrote: On Tuesday 24 November 2009 09:51:19 Patrick McHardy wrote: + skb_dst_drop(skb); + skb-tstamp.tv64 = 0; + skb-pkt_type = PACKET_HOST; + skb-protocol = eth_type_trans(skb, dev); + skb-mark = 0; skb-mark clearing should stay private to veth since its

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Arnd Bergmann
On Tuesday 24 November 2009 10:17:11 Patrick McHardy wrote: Arnd Bergmann wrote: On Tuesday 24 November 2009 09:51:19 Patrick McHardy wrote: + skb_dst_drop(skb); + skb-tstamp.tv64 = 0; + skb-pkt_type = PACKET_HOST; + skb-protocol = eth_type_trans(skb, dev); +

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Patrick McHardy
Arnd Bergmann wrote: On Tuesday 24 November 2009 10:17:11 Patrick McHardy wrote: Arnd Bergmann wrote: On Tuesday 24 November 2009 09:51:19 Patrick McHardy wrote: + skb_dst_drop(skb); + skb-tstamp.tv64 = 0; + skb-pkt_type = PACKET_HOST; + skb-protocol = eth_type_trans(skb,

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Arnd Bergmann
On Tuesday 24 November 2009, Patrick McHardy wrote: I don't think its necessary, we bypass outgoing queuing anyways. But if you'd want to add it, just keeping the skb-mark clearing in veth should work from what I can tell. Ok, I won't bother with it for now then. Arnd

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Eric W. Biederman
Patrick McHardy ka...@trash.net writes: I did all my testing with macvlan interfaces in separate namespaces communicating with each other, so I'd assume that we should always clear skb-mark and skb-dst in this function. Good point, in that case we probably should clear it as well. But in the

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Patrick McHardy
Eric W. Biederman wrote: Patrick McHardy ka...@trash.net writes: I did all my testing with macvlan interfaces in separate namespaces communicating with each other, so I'd assume that we should always clear skb-mark and skb-dst in this function. Good point, in that case we probably should

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Eric W. Biederman
Patrick McHardy ka...@trash.net writes: Eric W. Biederman wrote: Patrick McHardy ka...@trash.net writes: I did all my testing with macvlan interfaces in separate namespaces communicating with each other, so I'd assume that we should always clear skb-mark and skb-dst in this function. Good

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Arnd Bergmann
On Tuesday 24 November 2009, Eric W. Biederman wrote: I don't quite follow what you intend with dev_queue_xmit when the macvlan is in one namespace and the real physical device is in another. Are you mentioning that the packet classifier runs in the namespace where the primary device lives

Re: [PATCH 1/4] veth: move loopback logic to common location

2009-11-24 Thread Patrick McHardy
Eric W. Biederman wrote: Patrick McHardy ka...@trash.net writes: In the layered case (macvlan - eth0) its common behaviour to keep the mark however. But in case of different namespaces, I think macvlan should also clear the mark on the dev_queue_xmit() path since this is just a shortcut to

[PATCH 1/4] veth: move loopback logic to common location

2009-11-23 Thread Arnd Bergmann
The veth driver contains code to forward an skb from the start_xmit function of one network device into the receive path of another device. Moving that code into a common location lets us reuse the code for direct forwarding of data between macvlan ports, and possibly in other drivers.