On Mon, Nov 18, 2013 at 12:19:05PM +0200, Lori Jakab wrote: > On 11/16/13 1:21 AM, Ben Pfaff wrote: > >On Tue, Nov 12, 2013 at 04:36:25PM +0200, Lorand Jakab wrote: > >>This commit relaxes the assumption that all packets have an Ethernet > >>header, and adds support for layer 3 flows. For each packet received on > >>the Linux kernel datapath the l2 and l3 members of struct ofpbuf are > >>intialized appropriately, and some functions now expect this (notable > >>flow_extract()), in order to differentiate between layer 2 and layer 3 > >>packets. struct flow has now a new 'noeth' member, because we cannot > >>assume that a flow has no Ethernet header when eth_src and eth_dst are > >>0. For layer 3 packets, the protocol type is still stored in the > >>eth_type member. > >> > >>Switching L2->L3 and L3->L2 are both implemented by adding the pop_eth > >>and push_eth actions respectively when a transition is detected. The > >>push_eth action puts 0s on both source and destination MACs. These > >>addresses can be modified with mod_dl_dst and mod_dl_src actions. > >> > >>Signed-off-by: Lorand Jakab <loja...@cisco.com> > >This needs a rebase due to changes in dpif-netdev. > > Will do. I always keep a rebased version on github: > https://github.com/ljakab/openvswitch/commits/l3_v2 > > BTW, my patch had the exact same changes that causes the need for rebase.
Oh, sorry, I didn't look at the details, since I knew that we'd need another version. It didn't keep me from reviewing, anyhow. > >Have you thought about interactions with OpenFlow yet? As-is, there > >are going to be some oddities. > > I was focusing more on getting it to work first :) ;-) > I assume you're > right about the oddities, and I was thinking something along the > lines of reviewing all OF actions and see if they make sense in an > L3 context or not. If you (or anyone else) has any ideas on what > else I should look at, what else might fail/misbehave, please let me > know. One approach that probably fits in well with existing code is to add a prerequisite for Ethernet. Currently the Ethernet fields MFF_ETH_SRC and MFF_ETH_DST have prerequisite MFP_NONE, meaning no prerequisite at all. We could introduce a new prerequisite MFP_ETHERNET, meaning noeth=false (or base_layer=2 or whatever). Then, a lot of code would automatically honor that prerequisite, which would mean less manual auditing. > >For example, the flow > >"dl_dst=00:00:00:00:00:00, actions=drop" will now drop all L3 packets, > >I believe. Presumably we do not want that. I guess any flow that > >matches on dl_dst or dl_src should implicitly also match noeth=false. > I missed this, thanks for pointing it out. And there are probably > some other cases when noeth=false should be needed. Maybe make it > (well "base_layer") a mandatory match, like in_port, metadata, etc. > ? I am not sure what you mean by a mandatory match. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev