[ovs-dev] [PATCH] dpif-netdev: Allow for Ethernet and VLAN header in buffer size calculation.

Justin Pettit jpettit at nicira.com
Mon Jan 24 17:55:18 UTC 2011


On Jan 24, 2011, at 9:03 AM, Ben Pfaff wrote:

> This is a long-standing bug--it was present in version 1.0 too.
> 
> Reported-by: Gaetano Catalli <gaetano.catalli at gmail.com>
> Solution by Jesse Gross <jesse at nicira.com>
> ---
> lib/dpif-netdev.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 82d7d74..391a2a7 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -950,7 +950,7 @@ dp_netdev_run(void)
>     struct shash_node *node;
>     struct ofpbuf packet;
> 
> -    ofpbuf_init(&packet, DP_NETDEV_HEADROOM + max_mtu);
> +    ofpbuf_init(&packet, DP_NETDEV_HEADROOM + VLAN_ETH_HEADER_LEN + max_mtu);
>     SHASH_FOR_EACH (node, &dp_netdevs) {
>         struct dp_netdev *dp = node->data;
>         struct dp_netdev_port *port;

It looks like DP_NETDEV_HEADROOM already has VLAN_HEADER_LEN included, so this might be 4 bytes more than we strictly require.

Otherwise, it looks reasonable to me.  Jesse did the initial investigation, so he may be a better to review it.

--Justin






More information about the dev mailing list