From owner-freebsd-mips@freebsd.org Thu Oct 29 19:57:57 2015 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49879A213C4 for ; Thu, 29 Oct 2015 19:57:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D48481A42 for ; Thu, 29 Oct 2015 19:57:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iody8 with SMTP id y8so58009916iod.1 for ; Thu, 29 Oct 2015 12:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=hpQs546F+isUGxO9TYWb4GpKirhLskFIvJkhlhft/qw=; b=s/e9PiRabvl5RsqRgpnkqxKOQtGqqZ2EGptV9wCgXdes0SdBL/9DZ5b1EXZJEdgqnk uhofMDZI4lo8rYp/HWxTFyLkSSJg2z4BJrmEVbGDmQnZf+YXmC5yJ7Vg+PVuj5yp9Rd3 9HAjTYbwSAc/DTLNHEGWjFP4BL2ixLSdcDS5296/zrKfl9v2m4VbamRClBGtk205eGAA +sBqsT/enHGB5Dwlhr+oMnY/FIV3t6N7X8MNCCi+dz3FbAcmkevCyo8XdSa3uCX6HDTL Trb+x9S8WjsoiBCYO+SyHoyI3LioNMfs+7URlz7Q5Pn6vekSRoS5TOFUnh3mFyXw/VA5 NIpg== MIME-Version: 1.0 X-Received: by 10.107.46.142 with SMTP id u14mr5677501iou.165.1446148676175; Thu, 29 Oct 2015 12:57:56 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Thu, 29 Oct 2015 12:57:56 -0700 (PDT) In-Reply-To: References: <562CBEC3.8030308@rdtc.ru> <562E3027.4020806@grosbein.net> <562F75E2.9000505@grosbein.net> <5630E844.2080807@grosbein.net> <56321ED9.4050602@grosbein.net> <56323496.609@grosbein.net> <56325769.8070202@grosbein.net> Date: Thu, 29 Oct 2015 15:57:56 -0400 Message-ID: Subject: Re: arge1 on TL WDR3600 From: Adrian Chadd To: Eugene Grosbein Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2015 19:57:57 -0000 This may actually be a bug in how the rx/tx descriptors are handled. I'm going to have to change it to pad them out to be one descriptor per cache line. It's the only way this'll work. -a On 29 October 2015 at 14:41, Adrian Chadd wrote: > AH, ok. So it says TX_UNDERRUN + TX_PKT_SENT. So hm. > > The way this is supposed to work is .. odd. > > You queue TX packets to the hardware. The hardware increments > TXPKTCOUNT in the TX DMA status register. > > Then for each packet you see transmitted, you write TXPKTSENT to the > TX DMA status register and that decrements TXPKTCOUNT. Once it's zero, > you won't see any more TX interrupts. > > Now, the 'arge_tx_cnt' value tracks that; it should be zero if it's > idle. It's 126, which means there are still things to process. there's > 128 ring slots, so that prod/cons value indicates there's 126 things > in the ring. arge_tx_locked() does the decrementing and poking > TXPKTSENT. > > So, I bet the driver and hardware is out of sync. I bet that the (ctrl > & ARGE_DESC_EMPTY) check is triggering on the current frame in that > ring. I don't know if it's because prod/cons are out of whack, or it's > currently trying to check a descriptor in a multi-frame TX descriptor, > or whether the hardware is just plain buggy and it didn't update that. > But, that's actually what's going on. > > So that's my 5 minute analysis of it. I wish I could reproduce it on > what I have here because then I could see what the state of the ring > is and whether the hardware is buggy or our tx prod/cons tracking is > busted. I'd reaally appreciate help here :( > > > -adrian