On Wed, Oct 11, 2017 at 01:51:27PM -0400, yann bourdeau wrote:
> > Le 11 oct. 2017 à 13:09, Ben Pfaff <[email protected]> a écrit :
> >
> > On Wed, Oct 11, 2017 at 12:35:05PM -0400, yann bourdeau wrote:
> >> 2- The experimenter OXM field I need to implements are of variable length
> >> (both payload and mask to match on the payload of the packet). Can I
> >> create a new type that is variable length? Can I base my code on tunnnelMD
> >> type?
> >>
> >> Here is the structure if you are interested:
> >> struct oxm_fields {
> >> uint16_t oxm_class; /* Match class OFPXMC_EXPERIMENTER 0xffff */
> >> uint oxm_field:7; /* Match field within the class NOVI_OXM_UDP_PAYLOAD
> >> 0b0000001 */
> >> uint oxm_hasmask:1; /* Set if OXM includes a bitmask in payload (wildcard
> >> match tables only) */
> >> uint8_t oxm_length; /* Length of OXM payload */
> >> uint32_t experimenter; /* NoviFlow experimenter ID 0xff000002 */
> >> uint8_t payload[1-32] /* 1-32 payload bytes to be matched on*/
> >> uint8_t mask [0-32] /* Optional mask present if oxm_hasmask bit is set in
> >> the header */
> >> };
> >
> > tunnelMD is probably the best model since it's the only variable-length
> > field we have. I'd start with the code there.
>
>
> I was successful to add the flow with my new type.
>
> However, I needed to comment some code in the following function because my
> OXM is not mapped.
Oh, I forgot that the variable-length fields we have already follow a
different model. Any individual field at a given time has a fixed
length, but the controller can change those lengths. This is because
they were invented for Geneve TLVs. Each TLV has a fixed length, but
different controllers might use different TLVs, so when the controller
connects to the switch it configures ("maps") the TLVs it wants onto
OXMs reserved for that purpose.
I think you're doing something else, where a single OXM can have
different lengths at the same time. You might need to break new ground
here, then. OVS doesn't have any variable-length OXMs of that kind yet.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev