ofproto-dpif: Add more lock annotations.

This annotation would have caught the bug fixed by commit 491a67a0005347130
(ofproto-dpif-xlate: Avoid recursive acquisition of xlate_rwlock.).

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
ofproto-dpif-monitor: Change global rwlock into mutex.

Nothing ever took monitor_rwlock's read lock, so it might as well be a
mutex.

Signed-off-by: Ben Pfaff <blp@nicira.com>
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>
vswitchd: Inherit parents mac address for fake bridges

When adding a physical port to the main bridge the mac address
of the bridge is updated. We can do the same for fake bridges by
copying the mac address of the parent bridge.

There exists only one fake bridge per vlan, hence it is safe
to copy the mac address of the parent bridge.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>