netdev_class: Pass a struct ofpbuf * to rx_recv()
authorSimon Horman <horms@verge.net.au>
Wed, 15 Jan 2014 08:17:00 +0000 (17:17 +0900)
committerBen Pfaff <blp@nicira.com>
Thu, 16 Jan 2014 22:37:43 +0000 (14:37 -0800)
commitbfd3367b9e7426ffc931c9b0d010d8b1b5884ec2
tree8585bda3f250bd05473632be532d6d8a3c3e6bbe
parent6a62a162efeabe7ad54a82e34fe940f973792443
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/netdev-bsd.c
lib/netdev-dummy.c
lib/netdev-linux.c
lib/netdev-provider.h
lib/netdev.c