From owner-freebsd-wireless@freebsd.org Tue Nov 3 16:40:13 2015 Return-Path: Delivered-To: freebsd-wireless@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 4E2F2A24508 for ; Tue, 3 Nov 2015 16:40:13 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 066D7197A; Tue, 3 Nov 2015 16:40:12 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by lfgh9 with SMTP id h9so24598279lfg.1; Tue, 03 Nov 2015 08:40:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=content-type:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=/7g0Ud4GguT8XUJ99szZxNi63MfyToQqUtkf2cGH0yc=; b=jsw9YB9hKuibziCOac7TF1N3G105++vp7iC88pgutpPKRI3fPR4a/Ck0ZI6HlEpYpl S7wvg1iXXtVtsoCofI3dXs3GojlpzkIaxhE/COfknOh1RBA4wtRwWrruAIgqPqbWLvS8 h0DdQM0HmSiJrKX807mMMSpuOHuB+SUBxG6tOpPks2tIpswz+fAY3S4VkjlTELRgjlAQ vJ/90B3vWu33A/8FOOpaE8QId/B/TSFQwqvmbtYiP9BJG5YYD0zzidlDkUG3hqV6l52M YwnhgUrFTh8ni+n/0cODEdoDuvJHCWdLWQQGMj701BtAWE1s8TtReebW9qVEp1bLNsHf Jaow== X-Received: by 10.112.158.98 with SMTP id wt2mr13683049lbb.33.1446567171667; Tue, 03 Nov 2015 08:12:51 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id h7sm4899506lbk.8.2015.11.03.08.12.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Nov 2015 08:12:51 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Adrian Chadd" , "freebsd-wireless@freebsd.org" , "Mark Felder" Subject: Re: (untested) ath fix upon error References: Date: Tue, 03 Nov 2015 18:12:48 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2015 16:40:13 -0000 Tue, 03 Nov 2015 17:31:18 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd = : > hiya, > > what do people think about this to fix ath(4) transmit errors: > > adrian@victoria:~/work/freebsd/head-embedded/src % svn diff sys/dev/at= h > Index: sys/dev/ath/if_ath.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/ath/if_ath.c (revision 290048) > +++ sys/dev/ath/if_ath.c (working copy) > @@ -3320,6 +3320,9 @@ > * > * Note: if this fails, then the mbufs are freed but > * not the node reference. > + * > + * So, we now have to free the node reference ourselves here > + * and return OK up to the stack. > */ > next =3D m->m_nextpkt; > if (ath_tx_start(sc, ni, bf, m)) { > @@ -3336,7 +3339,14 @@ > */ > ath_txfrag_cleanup(sc, &frags, ni); > ATH_TXBUF_UNLOCK(sc); > - retval =3D ENOBUFS; > + > + /* > + * XXX: And free the node/return OK; ath_tx_start() ma= y = > have > + * modified the buffer. We currently have no way= to > + * signify that the mbuf was freed but there was = an = > error. > + */ > + ieee80211_node_free(ni); > + retval =3D 0; > goto finish; > } > > > .. the idea is that we can't return failure once we've called > ath_tx_start(), as the mbuf needs to be consumed. So we return OK and > just count an error. > Yes, I think this (temporary?) workaround should fix the issue. > > > -adrian