From owner-freebsd-current@FreeBSD.ORG Tue Nov 2 17:56:45 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 495C816A4CF for ; Tue, 2 Nov 2004 17:56:45 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id D75A743D45 for ; Tue, 2 Nov 2004 17:56:44 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by rproxy.gmail.com with SMTP id 74so270514rnk for ; Tue, 02 Nov 2004 09:56:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=X4T9PyYvPYz0ypecJ1X/uor7ZPjihKs0BfSOk9yhLdTVVZptdB53XT0zjit/SbWztkkIG3IeyN79uIZVc9xeld6zOovynsD2Tb3WZRC3Oxv/OFsaj60UQN2RHGsdMYBBIdBqxIVmHnVxPBEXH2GRkwpJ273PoRJd2KslXzzmRt8= Received: by 10.38.154.11 with SMTP id b11mr202865rne; Tue, 02 Nov 2004 09:56:40 -0800 (PST) Received: by 10.38.149.43 with HTTP; Tue, 2 Nov 2004 09:56:40 -0800 (PST) Message-ID: <34cb7c8404110209563fc01498@mail.gmail.com> Date: Tue, 2 Nov 2004 17:56:40 +0000 From: Peter Edwards To: "Bjoern A. Zeeb" In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Mailman-Approved-At: Wed, 03 Nov 2004 13:12:12 +0000 cc: peadar@freebsd.org cc: FreeBSD current mailing list cc: freebsd-amd64@freebsd.org Subject: Re: if_sk patch to get more info from people with problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Peter Edwards List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2004 17:56:45 -0000 Ok, I don't have this hardware, but dumb question: A (very) quick look at the source reveals that buffers are allocated via sk_rxeof()->sk_newbuf()->sk_jalloc() in the interrupt receive function, with the softc lock held in sk_rxeof(). They're freed by the mbuf system via a call to sk_jfree(), but that doesn't hold the SK_LOCK. Is this possibly the source of the corruption problems? What am I missing? This compiles, anyway :-) --- /tmp/if_sk.c Tue Nov 2 17:49:26 2004 +++ if_sk.c Tue Nov 2 17:52:20 2004 @@ -1115,12 +1115,14 @@ if ((i < 0) || (i >= SK_JSLOTS)) panic("sk_jfree: asked to free buffer that we don't manage!"); + SK_LOCK(sc_if->sk_softc); entry = SLIST_FIRST(&sc_if->sk_jinuse_listhead); if (entry == NULL) panic("sk_jfree: buffer not in use!"); entry->slot = i; SLIST_REMOVE_HEAD(&sc_if->sk_jinuse_listhead, jpool_entries); SLIST_INSERT_HEAD(&sc_if->sk_jfree_listhead, entry, jpool_entries); + SK_UNLOCK(sc_if->sk_softc); return; }