Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1364390

Re: [PATCH 1/1] net: macb: remove BUG_ON() and reset the queue to handle RX errors

From Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] net: macb: remove BUG_ON() and reset the queue to handle RX errors
Date 2016-03-24 19:30 +0100
Message-ID <rgib7-6GK-9@gated-at.bofh.it> (permalink)
References <rgeAy-3Uf-31@gated-at.bofh.it>
Organization Cogent Embedded

Show all headers | View raw


Hello.

On 03/24/2016 05:37 PM, Cyrille Pitchen wrote:

> This patch removes two BUG_ON() used to notify about RX queue corruptions
> on macb (not gem) hardware without actually handling the error.
>
> The new code skips corrupted frames but still processes faultless frames.
> Then it resets the RX queue before restarting the reception from a clean
> state.
>
> This patch is a rework of an older patch proposed by Neil Armstrong:
> http://patchwork.ozlabs.org/patch/371525/
>
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> ---
>   drivers/net/ethernet/cadence/macb.c | 59 ++++++++++++++++++++++++++++++-------
>   1 file changed, 49 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index 6619178ed77b..39447a337149 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
[...]
> @@ -945,11 +948,26 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
>   	return 0;
>   }
>
> +static inline void macb_init_rx_ring(struct macb *bp)
> +{
> +	int i;
> +	dma_addr_t addr;

    DaveM prefers that longer declarations precede the shorter.

[...]
>   static int macb_rx(struct macb *bp, int budget)
>   {
>   	int received = 0;
>   	unsigned int tail;
>   	int first_frag = -1;
> +	int reset_rx_queue = 0;

    *bool*, please.

[...]

MBR, Sergei

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] net: macb: remove BUG_ON() and reset the queue to handle RX errors Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2016-03-24 15:40 +0100
  Re: [PATCH 1/1] net: macb: remove BUG_ON() and reset the queue to  handle RX errors Neil Armstrong <narmstrong@baylibre.com> - 2016-03-24 16:00 +0100
  Re: [PATCH 1/1] net: macb: remove BUG_ON() and reset the queue to  handle RX errors Nicolas Ferre <nicolas.ferre@atmel.com> - 2016-03-24 16:50 +0100
  Re: [PATCH 1/1] net: macb: remove BUG_ON() and reset the queue to  handle RX errors Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-03-24 19:30 +0100

csiph-web