From owner-freebsd-net@FreeBSD.ORG Fri Feb 25 23:52:53 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3D55106566C; Fri, 25 Feb 2011 23:52:53 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBA78FC08; Fri, 25 Feb 2011 23:52:53 +0000 (UTC) Received: by qwj8 with SMTP id 8so1806821qwj.13 for ; Fri, 25 Feb 2011 15:52:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LXfzQgrDRPA7jqOFMuDcuzyzMSV2/htWS6M/UFznBw4=; b=aksgrOQkXuQ/JYMlrQFQ2Zx75FWU4woXHvcypyB+LL6z/84jUVM9EPdhUx1BidtV/D C7cPsp/jDNZIQgTgn3l+U9E6iAcA5yaTU9QbWznGc5Ne+q1UA2c97dG9DVCziHDnFCoA wNoIbDMUD/X7IZkONATz2KpiQ9snmE9JG6GIA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ay3fZpaxtOR5Pou4xozkYr5hiOi35UhRiAN/pdLLy6P8V3t/NLEYC8pLkE4KLYUNCM UqJ+jIe6BUWKv9JW4Mf0foQdYXNzSOa+yhn1jNNENl5UMGKrEgl09hhrcJgG1njC7p9u m7I549SYWgh8lTUvnwvACVTUcJQAyfk3XuO3g= MIME-Version: 1.0 Received: by 10.229.245.1 with SMTP id ls1mr2389607qcb.13.1298677972600; Fri, 25 Feb 2011 15:52:52 -0800 (PST) Received: by 10.229.127.105 with HTTP; Fri, 25 Feb 2011 15:52:52 -0800 (PST) In-Reply-To: References: <201102231218136253955@yahoo.com.cn> <201102231404144686577@yahoo.com.cn> Date: Fri, 25 Feb 2011 18:52:52 -0500 Message-ID: From: Arnaud Lacombe To: beezarliu Content-Type: multipart/mixed; boundary=0016363b8b883c06cd049d24078f Cc: freebsd-net@freebsd.org, Jack Vogel , "bug-followup@FreeBSD.org" Subject: Re: Re: Re: kern/150516: [em] e1000 receive queue handling problem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2011 23:52:53 -0000 --0016363b8b883c06cd049d24078f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, What is the point to invent a complex logic to detected a situation the chip warn you about ? The attached patch has currently survived longer than anything I've been ever tested, without dirty hack, like raising `nmbclusters'. Thanks in advance, - Arnaud ps: this is a temporary patch, for my 82754 based system, I am aware there is other user of IMS_ENABLE_MASK. On Wed, Feb 23, 2011 at 2:52 AM, Arnaud Lacombe wrote: > Hi, > > 2011/2/23 beezarliu : >> I think you can replace sys/dev/e1000/* =A0with the files in stable/8, >> and then uses this patch. It's much simpler. >> :) >> > agree. I switched to the driver of 8-STABLE, applied your patch > (without any conflict), fixed a bad version check (see [0]), built the > kernel, rebooted, ran the test... and hung em(4) RX again. 141k missed > packets (growing) and about 3k cluster allocations denied (constant) > currently. TX is fine, but the NIC is unable to process ARP and ICMP > reply sent back by the machine on the LAN. > > I did not test igb(4) as I do not have any on the path I directly > control, but the fix in trunk survived a few day of similar testing. > > =A0- Arnaud > > [0]: > diff --git a/sys/dev/e1000/if_igb.h b/sys/dev/e1000/if_igb.h > index 4388e07..adef0af 100644 > --- a/sys/dev/e1000/if_igb.h > +++ b/sys/dev/e1000/if_igb.h > @@ -508,7 +508,7 @@ struct igb_rx_buf { > =A0 =A0 =A0 =A0cur |=3D new; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 \ > =A0} > > -#if __FreeBSD_version < 800504 > +#if __FreeBSD_version >=3D 800000 && __FreeBSD_version < 800504 > =A0static __inline int > =A0drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br) > =A0{ > --0016363b8b883c06cd049d24078f Content-Type: text/x-patch; charset=US-ASCII; name="0001-if_em-handle-RX-overrun.patch" Content-Disposition: attachment; filename="0001-if_em-handle-RX-overrun.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gklr8w9u0 RnJvbSAyNjU3NDc1NjFhMjA2MDQ2OWZlMGMyMTA5NGU3N2Q0NGIyYzBhMzlhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBcm5hdWQgTGFjb21iZSA8bGFjb21iYXJAZ21haWwuY29tPgpE YXRlOiBGcmksIDI1IEZlYiAyMDExIDE4OjQ3OjQ4IC0wNTAwClN1YmplY3Q6IFtQQVRDSF0gaWZf ZW06IGhhbmRsZSBSWCBvdmVycnVuCgotLS0KIHN5cy9kZXYvZTEwMDAvZTEwMDBfZGVmaW5lcy5o IHwgICAgMSArCiBzeXMvZGV2L2UxMDAwL2lmX2VtLmMgICAgICAgICB8ICAgMjEgKysrKysrKysr KysrKysrKysrKystCiAyIGZpbGVzIGNoYW5nZWQsIDIxIGluc2VydGlvbnMoKyksIDEgZGVsZXRp b25zKC0pCgpkaWZmIC0tZ2l0IGEvc3lzL2Rldi9lMTAwMC9lMTAwMF9kZWZpbmVzLmggYi9zeXMv ZGV2L2UxMDAwL2UxMDAwX2RlZmluZXMuaAppbmRleCA1ZDA5YWQ5Li5lMGY1MWM0IDEwMDY0NAot LS0gYS9zeXMvZGV2L2UxMDAwL2UxMDAwX2RlZmluZXMuaAorKysgYi9zeXMvZGV2L2UxMDAwL2Ux MDAwX2RlZmluZXMuaApAQCAtODY1LDYgKzg2NSw3IEBACiAjZGVmaW5lIElNU19FTkFCTEVfTUFT Sy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