Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752512AbdLGX5v (ORCPT ); Thu, 7 Dec 2017 18:57:51 -0500 Received: from bastet.se.axis.com ([195.60.68.11]:40506 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751001AbdLGX5s (ORCPT ); Thu, 7 Dec 2017 18:57:48 -0500 Date: Fri, 8 Dec 2017 00:57:45 +0100 From: Niklas Cassel To: Joao.Pinto@synopsys.com, Giuseppe Cavallaro , Alexandre Torgue , Jose.Abreu@synopsys.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: stmmac: fix broken dma_interrupt handling for multi-queues Message-ID: <20171207235745.GA15639@axis.com> References: <20171207225610.15572-1-niklas.cassel@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171207225610.15572-1-niklas.cassel@axis.com> User-Agent: Mutt/1.9.1+16 (8a41d1c2f267) (2017-09-22) X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1312 Lines: 26 On Thu, Dec 07, 2017 at 11:56:10PM +0100, Niklas Cassel wrote: > Since each DMA channel can be used for rx and tx simultaneously, > the current code should probably be rewritten so that napi_struct is > embedded in a new struct stmmac_channel. > That way, stmmac_poll() can call stmmac_tx_clean() on just the tx queue > where we got the IRQ, instead of looping through all tx queues. > This is also how the xgbe driver does it (another driver for this IP). Did anyone at Synopsys ever try this driver with a device tree where num tx queues != num rx queues? I know your hardware has 8 rx queues and 8 tx queues, but that doesn't mean that you have to enable them all. After fixing this crash, I'm still seeing tx timeouts with multi-queue device trees. (At Axis we usually only enable 1 tx queue and 1 rx queue). The multi-queue code seems a bit messy.. refactoring so that napi_struct is in a struct stmmac_channel might help you guys with overall code readability, since this would then actually match how the hardware works. With the xgbe driver, xgbe_one_poll disable tx+rx irqs for a specific channel, then calls futher function only with that specific channel. With the stmmac driver, there is no connection between napi_struct and tx. Disable irqs for tx? stmmac_poll loops through all tx queues :)