lib/netdev-windows.c: nuke the init function.

The init function is not allowed to call into the kernel datapath
while running unit tests since the kernel datapath is not loaded.
Instead of making the function dummy, it is better to not have it
at all.

Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
tests: Check that port status MODIFY messages are generated.

ONF-JIRA: EXT-338
Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
ofp-actions: Support OF1.5 (draft) masked Set-Field, merge with reg_load.

OpenFlow 1.5 (draft) extends the OFPAT_SET_FIELD action originally
introduced in OpenFlow 1.2 so that it can set not just entire fields but
any subset of bits within a field as well.  This commit adds support for
that feature when OpenFlow 1.5 is used.

With this feature, OFPAT_SET_FIELD becomes a superset of NXAST_REG_LOAD.
Thus, this commit merges the implementations of the two actions into a
single ofpact_set_field.

ONF-JIRA: EXT-314
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
nx-match: Use nx_put_header() internally for encoding flow matches.

This will make it easier to support 64-bit OXM experimenter fields.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
tests: Add test for masked set_field action.

ONF-JIRA: EXT-314
Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
nx-match: Speak of 'class' instead of 'vendor' for OXM/NXM.

OXM renamed the 'vendor' field from NXM to the 'class', and uses the term
"experimenter", which OVS usually renders as "vendor" for historical
reasons, as part of the extended 64-bit OXMs.  To reduce confusion, this
commit adopts the OXM terminology for class.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
util: Make hexits_value() support 64-bit integers too.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
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 <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>