[ovs-discuss] Add new header support in ovs

Zhouyou Gu guzhouyou at gmail.com
Thu Jun 8 02:30:38 UTC 2017

Hi all

I am interested in add some new header support to OVS.

I find some instructions at the end of this page.

I read the OVS code in related parts. Following is my understanding of how
the fields are processed:

1. The compiler first parses the enum mf_field_id in meta-flow.h, and read
the *comment *in enum mf_field_id to construct the match field id in OXM
and NXM. eg. NXM: NXM_NX_MPLS_TTL(30) since v2.6 will make the id of this
field as 30 in NXM.

2. The compiler also parses the field name in the comment, and match it
with the name in the struct flow?*(this part i am not sure) *
eg.     MFF_CT_STATE,       /* "ct_zone". .....    , this will parse the
MFF_CT_STATE in the ct_zone in the struct flow?

3. In run time, miniflow_extract will push the value of different fields in
the packet into the corresponding field of the struct flow.

4. Since the compiler already links the field id in step one, so the
controller can send the match instruction using the class and id described
in step.


1. am I right for the steps described above

2. I am not sure about what nx_put_raw does. Is it used for parsing the
enum mf_field_id and its comment?

3. Is it ok that I add a new field, eg. MFF_MY_Field.  NXM:
NXM_NX_MY_FIELD(#ID). and the #ID is not same as the ids already defined in
the enum mf_field_id?

4. Is there any experimenter match class api i can use?

6. If at the switch side, I have MFF_MY_Field.  NXM: NXM_NX_MY_FIELD(#ID)
ready, At the controller side, I just need to construct the oxm_fields
according to the setup in the switch.

7. There is two NXM class in OXM class: OFPXMC_NXM_0 OFPXMC_NXM_1. How
should I define the class of my match in these two?

5. Is there any more detailed explanation or tutorial that I can learn
about how to do this?

This information seems a little out of date, because In 2.7 the "struct
flow" is defined in the include/openvswitch/flow.h, and the enum
mf_field_id is in include/openvswitch/flow.h.)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20170608/f031b0d9/attachment-0001.html>

More information about the discuss mailing list