Hello Fujita,

Thanks for the hint.

I've been utilizing ofctl_v1_3 for a while, and I've noticed that the old
API, which is used in ofctl, is supposed to be removed in the future. I may
make a patch to migrate ofctl to the new OFPMatch API later.


2014-09-02 7:38 GMT+08:00 FUJITA Tomonori <[email protected]>:

> On Mon, 01 Sep 2014 19:53:41 +0900 (JST)
> FUJITA Tomonori <[email protected]> wrote:
>
> > Hello, sorry about the delay,
> >
> > On Fri, 29 Aug 2014 15:10:46 +0800
> > Wei-Li Tang <[email protected]> wrote:
> >
> >> I tried to add a flow which matches non-VLAN-tagged packets by
> specifying
> >> VLAN_VID match field without OFPVID_PRESENT bit, but it didn't work. It
> >> seems that Ryu always sets OXM_OF_VLAN_VID with OFPVID_PRESENT bit
> during
> >> serialization in ofproto_v1_3_parser.MTVlanVid:
> >>
> >> class MTVlanVid(OFPMatchField):
> >>     pack_str = '!H'
> >>
> >>     def __init__(self, header, value, mask=None):
> >>         super(MTVlanVid, self).__init__(header)
> >>         self.value = value
> >>         self.mask = mask
> >>
> >>     @classmethod
> >>     def field_parser(cls, header, buf, offset):
> >>         m = super(MTVlanVid, cls).field_parser(header, buf, offset)
> >>         m.value &= ~ofproto.OFPVID_PRESENT
> >>         return m
> >>
> >>     def serialize(self, buf, offset):
> >>         self.value |= ofproto.OFPVID_PRESENT
> >>         super(MTVlanVid, self).serialize(buf, offset)
> >>
> >> It makes OFPVID_NONE impossible to be assigned to OXM_OF_VLAN_VID as
> >> described in Table 13, openflow spec 1.3.4. I'm not sure it's fine to
> >> remove `self.value |= ofproto.OFPVID_PRESENT` if there have been many
> users
> >> depend on it.
> >
> > If you use the new API such OFPMatch(vlan_vid=0), the above code is
> > not used. With the new API, you need to specify OFPVID_PRESENT like
> > OFPMatch(vlan_vid=0x1000|4) for match a specific vid.
>
> btw, the following code parses/serializes oxm:
>
> https://github.com/osrg/ryu/blob/master/ryu/ofproto/oxm_fields.py
>



-- 
Sincerely,

Wei-Li Tang
RD Engineer, Xinguard Inc.
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to