Hi FUJITA, > I don't think that checking the dl_dst_mask in match_tuple() makes > sense. match_tuple() converts nxm to OF1.0 match. dl_dst_mask can't be > handled in OF1.0. In such case, flow_format() should indicate NXM > instead OF1.0 match so match_tuple() isn't used. How about the > following?
I agree with your argument on dl_dst_mask. I only added that to my patch because it was already there. LGTM. Reviewed-by: Soheil Hassas Yeganeh <[email protected]> > I don't have a clear idea about a proper long-term fix for > now. flow_format() and match_tuple() try to provides a generic match > interface then converts OF version specific match data structure. > However, more OF versions we support (we already support 1.2), the > code becomes more complicated. Also, not only match, we need to invent > lots of data structures to hide all the differences among OF versions. > I'm not sure the API as raw OF semantics is reasonable for SDN > applications. > > At this point, I think that writing applications for the specific OF > version is more reasonable. For example, simple_isolation doesn't need > NX at all. It had better use OF1.0 explicitly. > > I've wrote an application that can handle both OF1.0 with NX and OF1.2 > but I don't think it's possible to write a clean code that can handle > multiple OF versions. But, the OF version is based on the controller/switch handshake, and the application wouldn't have any control over that. So, an app specific to OF1.0 won't work if a switch is handshaked with OF1.2. right? I think the long-term solution would be an abstraction on top of these. But, as you mentioned, it would be complex to write a proper one. Cheers, Soheil > diff --git a/ryu/ofproto/nx_match.py b/ryu/ofproto/nx_match.py > index b439a7a..2afa2b4 100644 > --- a/ryu/ofproto/nx_match.py > +++ b/ryu/ofproto/nx_match.py > @@ -315,6 +315,10 @@ class ClsRule(object): > if self.wc.dl_dst_mask: > return ofproto_v1_0.NXFF_NXM > > + # Masking DL_SRC is only supported by NXM > + if self.wc.dl_src_mask: > + return ofproto_v1_0.NXFF_NXM > + > # ECN is only supported by NXM > if not self.wc.wildcards & FWW_NW_ECN: > return ofproto_v1_0.NXFF_NXM > @@ -331,7 +335,7 @@ class ClsRule(object): > if self.flow.dl_src != mac.DONTCARE: > wildcards &= ~ofproto.OFPFW_DL_SRC > > - if self.wc.dl_dst_mask: > + if self.flow.dl_dst != mac.DONTCARE: > wildcards &= ~ofproto.OFPFW_DL_DST > > if not self.wc.wildcards & FWW_DL_TYPE: ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
