From: David Miller <davem@davemloft.net>
To: jeroen.de_wachter.ext@nokia.com
Cc: jringle@gridpoint.com, akpm@linux-foundation.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] encx24j600: bugfix - always move ERXTAIL to next packet in encx24j600_rx_packets
Date: Fri, 16 Dec 2016 13:32:08 -0500 (EST) [thread overview]
Message-ID: <20161216.133208.2134512725082545132.davem@davemloft.net> (raw)
In-Reply-To: <1481549349-8199-1-git-send-email-jeroen.de_wachter.ext@nokia.com>
From: <jeroen.de_wachter.ext@nokia.com>
Date: Mon, 12 Dec 2016 14:29:08 +0100
> From: Jeroen De Wachter <jeroen.de_wachter.ext@nokia.com>
>
> Before, encx24j600_rx_packets did not update encx24j600_priv's next_packet
> member when an error occurred during packet handling (either because the
> packet's RSV header indicates an error or because the encx24j600_receive_packet
> method can't allocate an sk_buff).
>
> If the next_packet member is not updated, the ERXTAIL register will be set to
> the same value it had before, which means the bad packet remains in the
> component's memory and its RSV header will be read again when a new packet
> arrives. If the RSV header indicates a bad packet or if sk_buff allocation
> continues to fail, new packets will be stored in the component's memory until
> that memory is full, after which packets will be dropped.
>
> The SETPKTDEC command is always executed though, so the encx24j600 hardware has
> an incorrect count of the packets in its memory.
>
> To prevent this, the next_packet member should always be updated, allowing the
> packet to be skipped (either because it's bad, as indicated in its RSV header,
> or because allocating an sk_buff failed). In the allocation failure case, this
> does mean dropping a valid packet, but dropping the oldest packet to keep as
> much memory as possible available for new packets seems preferable to keeping
> old (but valid) packets around while dropping new ones.
>
> Signed-off-by: Jeroen De Wachter <jeroen.de_wachter.ext@nokia.com>
Applied.
prev parent reply other threads:[~2016-12-16 18:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-12 13:29 [PATCH 1/2] encx24j600: bugfix - always move ERXTAIL to next packet in encx24j600_rx_packets jeroen.de_wachter.ext
2016-12-12 13:29 ` [PATCH 2/2] encx24j600: Fix some checkstyle warnings jeroen.de_wachter.ext
2016-12-16 18:32 ` David Miller
2016-12-16 18:32 ` David Miller [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=20161216.133208.2134512725082545132.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=jeroen.de_wachter.ext@nokia.com \
--cc=jringle@gridpoint.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).