On Tue, Jan 07, 2014 at 02:33:38PM +0900, Simon Horman wrote:
> 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 <[email protected]>

I'm planning to apply this soon.

I'm going to change the comment on rx_recv to:
    /* Attempts to receive a packet from 'rx' into the tailroom of 'buffer',
     * which should initially be empty.  If successful, returns 0 and
     * increments 'buffer->size' by the number of bytes in the received packet,
     * otherwise a positive errno value.  Returns EAGAIN immediately if no
     * packet is ready to be received.
     *
     * Must return EMSGSIZE, and discard the packet, if the received packet
     * is longer than 'ofpbuf_tailroom(buffer)'.
     *
     * This function may be set to null if it would always return EOPNOTSUPP
     * anyhow. */
to both make it more specific and not yet describe the upcoming change
that requires an extra VLAN_HEADER_LEN bytes, since that change hasn't
really happened yet (that's in patch 3).

Thanks,

Ben.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to