Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932921AbcK1Nnm (ORCPT ); Mon, 28 Nov 2016 08:43:42 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:51773 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933044AbcK1Nne (ORCPT ); Mon, 28 Nov 2016 08:43:34 -0500 Subject: Re: [PATCH 1/1] net: macb: fix the RX queue reset in macb_rx() To: David Miller References: <20161127.202549.1887792653016840262.davem@davemloft.net> CC: , , , , , From: Cyrille Pitchen Message-ID: Date: Mon, 28 Nov 2016 14:43:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161127.202549.1887792653016840262.davem@davemloft.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.145.133.18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1605 Lines: 40 Hi David, Le 28/11/2016 ? 02:25, David Miller a ?crit : > From: Cyrille Pitchen > Date: Fri, 25 Nov 2016 09:49:32 +0100 > >> On macb only (not gem), when a RX queue corruption was detected from >> macb_rx(), the RX queue was reset: during this process the RX ring >> buffer descriptor was initialized by macb_init_rx_ring() but we forgot >> to also set bp->rx_tail to 0. >> >> Indeed, when processing the received frames, bp->rx_tail provides the >> macb driver with the index in the RX ring buffer of the next buffer to >> process. So when the whole ring buffer is reset we must also reset >> bp->rx_tail so the driver is synchronized again with the hardware. >> >> Since macb_init_rx_ring() is called from many locations, currently from >> macb_rx() and macb_init_rings(), we'd rather add the "bp->rx_tail = 0;" >> line inside macb_init_rx_ring() than add the very same line after each >> call of this function. >> >> Without this fix, the rx queue is not reset properly to recover from >> queue corruption and connection drop may occur. >> >> Signed-off-by: Cyrille Pitchen >> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors") > > This doesn't apply cleanly to the 'net' tree, where > RX_RING_SIZE is used instead of bp->rx_ring_size. It seems > you generated this against net-next, however you didn't say > that either in your Subject line nor the commit message. > > As a bug fix this should be targetted at 'net'. > Indeed, sorry. I've just sent a v2 based on net/master. Best regards, Cyrille