[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 7 Jul 2010 10:46:39 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: Shreyas Bhatewara <sbhatewara@...are.com>
Cc: netdev@...r.kernel.org, pv-drivers@...are.com
Subject: Re: [PATCH 2.6.35-rc1] net: vmxnet3 fixes [1/5] Spare skb to avoid
starvation
On Wed, 7 Jul 2010 02:21:55 -0700 (PDT)
Shreyas Bhatewara <sbhatewara@...are.com> wrote:
>
>
> From: Shreyas Bhatewara <sbhatewara@...are.com>
>
> skb_alloc() failure can cause the recv ring to loose all packet reception.
> Avoid this by introducing a spare buffer.
>
> Signed-off-by: Michael Stolarchuk <stolarchuk@...are.com>
> Signed-off-by: Shreyas Bhatewara <sbhatewara@...are.com>
>
I don't see how this fixes the problem, what happens when
the spare buffer is used up? Better to design a flow control algorithm
that holds off sender if allocation fails, and retry allocation later
(for example with a work queue).
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index 989b742..5a50d10 100644
...
> /*
> @@ -149,6 +149,13 @@ vmxnet3_cmd_ring_desc_avail(struct vmxnet3_cmd_ring *ring)
> ring->next2comp - ring->next2fill - 1;
> }
>
> +static inline bool
> +vmxnet3_cmd_ring_desc_empty(struct vmxnet3_cmd_ring *ring)
> +{
> + return (ring->next2comp == ring->next2fill);
> +}
const is good practice on functions like this.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists