From: Florian Fainelli <f.fainelli@gmail.com>
To: Jaedon Shin <jaedon.shin@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: bcmgenet: fix increase rx_read_ptr
Date: Mon, 06 Oct 2014 09:45:50 -0700 [thread overview]
Message-ID: <5432C73E.90805@gmail.com> (raw)
In-Reply-To: <1412564726-40192-1-git-send-email-jaedon.shin@gmail.com>
On 10/05/2014 08:05 PM, Jaedon Shin wrote:
> The rx_read_ptr must increase after using it.
Your commit message is too terse, you need to explain why you think the
current code is bad, and how your patch is fixing it.
One possible thing that I see is that we might be off by one in how we
use the enet_cb versus how we read the HW packet descriptor.
>
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 5cc9cae..b47db5e 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -1282,9 +1282,6 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv,
>
> rxpktprocessed++;
>
> - priv->rx_read_ptr++;
> - priv->rx_read_ptr &= (priv->num_rx_bds - 1);
> -
> /* We do not have a backing SKB, so we do not have a
> * corresponding DMA mapping for this incoming packet since
> * bcmgenet_rx_refill always either has both skb and mapping or
> @@ -1399,6 +1396,9 @@ refill:
> err = bcmgenet_rx_refill(priv, cb);
> if (err)
> netif_err(priv, rx_err, dev, "Rx refill failed\n");
> +
> + priv->rx_read_ptr++;
> + priv->rx_read_ptr &= (priv->num_rx_bds - 1);
> }
>
> return rxpktprocessed;
>
next parent reply other threads:[~2014-10-06 16:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1412564726-40192-1-git-send-email-jaedon.shin@gmail.com>
2014-10-06 16:45 ` Florian Fainelli [this message]
2014-10-07 6:40 ` [PATCH] net: bcmgenet: fix increase rx_read_ptr Jaedon Shin
2014-10-07 17:01 ` Florian Fainelli
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=5432C73E.90805@gmail.com \
--to=f.fainelli@gmail.com \
--cc=jaedon.shin@gmail.com \
--cc=netdev@vger.kernel.org \
/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).