Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nx-match: Add support for experimenter OXM.
OpenFlow 1.2+ defines a means for vendors to define vendor-specific OXM fields, called "experimenter OXM". These OXM fields are expressed with a 64-bit OXM header instead of the 32-bit header used for standard OXM (and NXM). Until now, OVS has not implemented experimenter OXM, and indeed we have had little need to do so because of a pair of special 32-bit OXM classes grandfathered to OVS as part of the OpenFlow 1.2 standardization process. However, I want to prototype a feature for OpenFlow 1.5 that uses an experimenter OXM as part of the prototype, so to do this OVS needs to support experimenter OXM. This commit adds that support. Most of this commit is a fairly straightforward change: it extends the type used for OXM/NXM from 32 to 64 bits and adds code to encode and decode the longer headers when necessary. Some other changes are necessary because experimenter OXMs have a funny idea of the division between "header" and "body": the extra 32 bits for experimenter OXMs are counted as part of the body rather than the header according to the OpenFlow standard (even though this does not entirely make sense), so arithmetic in various places has to be adjusted, which is the reason for the new functions nxm_experimenter_len(), nxm_payload_len(), and nxm_header_len(). Another change that calls for explanation is the new function mf_nxm_header() that has been split from mf_oxm_header(). This function is used in actions where the space for an NXM or OXM header is fixed so that there is no room for a 64-bit experimenter type. An upcoming commit will add new variations of these actions that can support experimenter OXM. Testing experimenter OXM is tricky because I do not know of any in widespread use. Two ONF proposals use experimenter OXMs: EXT-256 and EXT-233. EXT-256 is not suitable to implement for testing because its use of experimenter OXM is wrong and will be changed. EXT-233 is not suitable to implement for testing because it requires adding a new field to struct flow and I am not yet convinced that that field and the feature that it supports is worth having in Open vSwitch. Thus, this commit assigns an experimenter OXM code point to an existing OVS field that is currently restricted from use by controllers, "dp_hash", and uses that for testing. Because controllers cannot use it, this leaves future versions of OVS free to drop the support for the experimenter OXM for this field without causing backward compatibility problems. Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Jarno Rajahalme <[email protected]>
- Loading branch information