tests: Fix path for distcleaning ovs-controller.8

Fixes the following error on distcheck:-

ERROR: files left in build directory after distclean:
./tests/test-controller.8
make[1]: *** [distcleancheck] Error 1

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev_class: Pass a struct ofpbuf * to rx_recv()

Update the netdev_class so that struct ofpbuf * is passed to rx_recv()
to provide both the data and size of the data to read a packet into.

On success, update struct ofpbuf size inside netdev_class rx_recv
implementation and return 0. This moves logic from the caller.
On error a positive error code is returned, whereas previously
a negative error code was returned. This is a more common convention.

This patch should not have any behavioural changes.

This patch is in preparation for the netdev-linux variant of rx_recv()
making use of headroom in the struct ofpbuf * parameter to push a VLAN tag
obtained from auxdata.

Signed-off-by: Simon Horman <horms@verge.net.au>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib: Add tpid parameter to eth_push_vlan()

This is in preparation for pushing vlan tags
using the TPID provided by the kernel via auxdata.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev-linux: Read packet auxdata to obtain vlan_tid

If VLAN acceleration is used when the kernel receives a packet
then the outer-most VLAN tag will not be present in the packet
when it is received by netdev-linux. Rather, it will be present
in auxdata.

This patch uses recvmsg() instead of recv() to read auxdata for
each packet and if the vlan_tid is set then it is added to the packet.

Adding the vlan_tid makes use of headroom available
in the buffer parameter of rx_recv.

Signed-off-by: Simon Horman <horms@verge.net.au>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Implement OpenFlow support for MPLS, for up to 3 labels.

I've been a little frustrated with the current approach to MPLS, because it
seems quite difficult to understand.  One particularly difficult bit for
me is the variables used during translation, e.g. mpls_depth_delta and
pre_push_mpls_lse.  And what we end up with is support for a single MPLS
label, which I don't think is going to make any real-world users happy.

This commit attempts to implement something easier to understand and more
powerful by just keeping track of all the labels in struct flow.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Simon Horman <horms@verge.net.au>
Add OpenFlow support for matching multiple MPLS labels at once.

This is an OpenFlow extension that might be useful.  I don't know how MPLS
works in practice well enough to judge.

Signed-off-by: Ben Pfaff <blp@nicira.com>
odp-util: Include '/' before mask when formatting MPLS LSE

This corrects what appears to be a minor error in
"Implement OpenFlow support for MPLS, for up to 3 labels."

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Update tests for masked BoS bit

The BoS bit of each LSE is masked by flow_count_mpls_labels()

This corrects what appears to be a minor inconsistency in
"Implement OpenFlow support for MPLS, for up to 3 labels."

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Correct out-by one in logging of MPLS action errors

The number of LSEs supported is ARRAY_SIZE(flow->mpls_lse) not
ARRAY_SIZE(flow->mpls_lse) - 1.

This corrects an inconsistency added my me to
"Implement OpenFlow support for MPLS, for up to 3 labels."

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Probe datapath for MPLS stack depth supported

This is an proposed enhancement to
"Implement OpenFlow support for MPLS, for up to 3 labels."

It is in preparation for not adding flows to the datapath
which have more MPLS LSEs than the datapath supports.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Add probed MPLS stack depth of dpif to xbridge

This is an proposed enhancement to
"Implement OpenFlow support for MPLS, for up to 3 labels."

It is in preparation for not adding flows to the datapath
which have more MPLS LSEs than the datapath supports.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Do not add more MPLS LSEs than the datapath can handle

This is an proposed enhancement to
"Implement OpenFlow support for MPLS, for up to 3 labels."

This makes the conservative assumption that the datapath should
not be asked to apply MPLS push actions such that the resulting
packet will have an MPLS label stack depth greater than the
datapath can accept in a match.

In future it may be possible to use recirculation to handle
such cases.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Do not use of more MPLS LSEs than the datapath can supply

This is an proposed enhancement to
"Implement OpenFlow support for MPLS, for up to 3 labels."

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
odp-util: Report ODP_FIT_TOO_LITTLE when too few MPLS labels are present.

Signed-off-by: Ben Pfaff <blp@nicira.com>