[ovs-dev] netdev_recv buffer size

Gaetano Catalli gaetano.catalli at gmail.com
Mon Jan 24 09:58:45 UTC 2011


Hi all,
I'm trying to port openvswitch to FreeBSD, but I have a problem that I
can't clear up.
At the moment I'm implementing the netdev_bsd_recv function. As I can
read in the netdev-provider.h file this function "...attempts to
receive a packet from 'netdev' into the 'size' bytes in 'buffer'...".
My problem regards just the 'size' value. In the function netdev_recv
(netdev.c) I can read :

"Attempts to receive a packet from 'netdev' into 'buffer', which the
caller must have initialized with sufficient room, for the packet. The
space required to receive any packet is ETH_HEADER_LEN, plus
VLAN_HEADER_LEN, plus the device's MTU..."

so the maximum size of a packet is supposed to be 14+4+1500=1518 bytes
(or 1514 if the device doesn't allow for VLAN header).
Now, making some tests I have discovered that the function
netdev_bsd_recv is always being called with a size value of 1500 that,
for my reasoning, is not sufficient to contain a maximum-size packet.

Is there anything I'm not taking into account?

Regards,
Gaetano




More information about the dev mailing list