netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yasushi SHOJI <yashi@atmark-techno.com>
Cc: netdev@vger.kernel.org
Subject: Re: sh_eth.c::sh_eth_rx(): mdp->rx_skbuff[entry] can be NULL
Date: Fri, 23 Oct 2015 14:05:45 +0300	[thread overview]
Message-ID: <562A1489.70804@cogentembedded.com> (raw)
In-Reply-To: <56295282.7070202@cogentembedded.com>

On 10/23/2015 12:17 AM, Sergei Shtylyov wrote:

[...]

>> If memory is not yet available
>> when the controller is trying to use the invalid descriptor, the
>> controller will see it and DMA will stop.
>
>     That means leaving RACT=0 and that's what the driver is even doing...
>     Hm, then I don't understand how the error you've described can occur,
> unless we encounter OOM during sh_eth_ring_format()...
>
>> Is it acceptable path to go?
>
>     I'm not seeing a bug in this function, perhaps I'm missing something?

    Nevermind, I'm seeing the bug now -- occurred to me before I went to bed 
yesterday.

>> To achieve zero copy, the driver push the sk_buffs filled with
>> received packet to the netdev core with netif_receive_skb() then
>> netdev_alloc_skb() sk_buffs in the sh_eth_rx(), the poll method of the
>> driver, and update the corresponding descriptor.
>
>> If the allocation failed, it just leave the function, leaving old
>> pointer in the descriptor as is.
>
>     Yes, but note that it also leaves RACT=0, which basically means an invalid
> descriptor, encountering which the reception should just stop.

    The problem is that the first loop has no way of identifying the bad 
descriptors. Looks like we only can fix that by checking rx_skbuff[entry] for 
NULL.

MBR, Sergei

      reply	other threads:[~2015-10-23 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 15:01 sh_eth.c::sh_eth_rx(): mdp->rx_skbuff[entry] can be NULL Yasushi SHOJI
2015-10-20 20:48 ` Sergei Shtylyov
2015-10-21  7:26   ` Yasushi SHOJI
2015-10-22 21:17     ` Sergei Shtylyov
2015-10-23 11:05       ` Sergei Shtylyov [this message]

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=562A1489.70804@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=netdev@vger.kernel.org \
    --cc=yashi@atmark-techno.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).