From: Stephen Hemminger <shemminger@vyatta.com>
To: Shreyas Bhatewara <sbhatewara@vmware.com>
Cc: netdev@vger.kernel.org, pv-drivers@vmware.com
Subject: Re: [PATCH 2.6.35-rc1] net: vmxnet3 fixes [1/5] Spare skb to avoid starvation
Date: Wed, 7 Jul 2010 10:46:39 -0700 [thread overview]
Message-ID: <20100707104639.28f69b57@s6510> (raw)
In-Reply-To: <alpine.LRH.2.00.1007070214400.6105@localhost.localdomain>
On Wed, 7 Jul 2010 02:21:55 -0700 (PDT)
Shreyas Bhatewara <sbhatewara@vmware.com> wrote:
>
>
> From: Shreyas Bhatewara <sbhatewara@vmware.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@vmware.com>
> Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.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.
next prev parent reply other threads:[~2010-07-07 17:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-07 9:21 [PATCH 2.6.35-rc1] net: vmxnet3 fixes [1/5] Spare skb to avoid starvation Shreyas Bhatewara
2010-07-07 17:46 ` Stephen Hemminger [this message]
2010-07-14 0:46 ` [PATCH 2.6.35-rc1] net-next: " Shreyas Bhatewara
2010-07-16 1:19 ` Shreyas Bhatewara
2010-07-16 1:39 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2010-07-07 18:34 [PATCH 2.6.35-rc1] net: " Shreyas Bhatewara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100707104639.28f69b57@s6510 \
--to=shemminger@vyatta.com \
--cc=netdev@vger.kernel.org \
--cc=pv-drivers@vmware.com \
--cc=sbhatewara@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).