From owner-freebsd-current@FreeBSD.ORG Fri Nov 5 01:31:32 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C81B1065672 for ; Fri, 5 Nov 2010 01:31:32 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id A0BBA8FC14 for ; Fri, 5 Nov 2010 01:31:31 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnEFALv60kyDaFvO/2dsb2JhbACDKZBCjnWsMJEChFRzBIpV X-IronPort-AV: E=Sophos;i="4.58,299,1286164800"; d="scan'208";a="97858248" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 04 Nov 2010 21:31:30 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 732DDB3F4C; Thu, 4 Nov 2010 21:31:30 -0400 (EDT) Date: Thu, 4 Nov 2010 21:31:30 -0400 (EDT) From: Rick Macklem To: pyunyh@gmail.com Message-ID: <430617549.130565.1288920690389.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20101104003906.GC14740@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_130564_31585594.1288920690387" X-Originating-IP: [99.225.56.115] X-Mailer: Zimbra 6.0.7_GA_2476.RHEL4 (ZimbraWebClient - IE8 (Win)/6.0.7_GA_2473.RHEL4_64) Cc: freebsd-current@freebsd.org Subject: Re: re(4) driver dropping packets when reading NFS files X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2010 01:31:32 -0000 ------=_Part_130564_31585594.1288920690387 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit > > If the counter was not wrapped, it seem you lost more than 10% out of > total RX frames. This is a lot loss and there should be a way to > mitigate it. > I've attached a patch (to the if_re.c in head, not your patched variant) that works a lot better (about 5Mbytes/sec read rate). To get that, I had to disable msi and not clear the RL_IMR register in re_intr(). I suspect that a packet would be received between when the bits in RL_IMR were cleared and when they were set at the end of re_int_task() and those were getting lost. This patch doesn't completely fix the problem. (I added your stats collecting stuff to the if_re.c in head and attached the result, which still shows some lost packets. One thought is clearing the bits in RL_ISR in re_intr() instead of re_int_task(), but then I can't see a good way to pass the old value of the status reg. through to re_int_task()? The patch doesn't help when msi is enabled and when I played with your patched variant, I got it to hang when RL_IMR wasn't cleared. I've attached the patch and stats. I might play around with it some more tomorrow, rick ps: If you have hardware to test re with, you want to do an NFS mount and then read a large file when nothing else is happening on the machine, to see if you can reproduce the problem. pss: All tests done with a kernel that does not have option DEVICE_POLLING. ------=_Part_130564_31585594.1288920690387 Content-Type: text/x-patch; name=if_re.c.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=if_re.c.patch LS0tIGlmX3JlLmMub3JpZwkyMDEwLTExLTAzIDE4OjQ5OjI5LjAwMDAwMDAwMCAtMDQwMA0KKysr IGlmX3JlLmMJMjAxMC0xMS0wNCAyMTowNDozNC4wMDAwMDAwMDAgLTA0MDANCkBAIC0xNTYsNyAr MTU2LDcgQEANCiAjaW5jbHVkZSAibWlpYnVzX2lmLmgiDQogDQogLyogVHVuYWJsZXMuICovDQot c3RhdGljIGludCBtc2lfZGlzYWJsZSA9IDA7DQorc3RhdGljIGludCBtc2lfZGlzYWJsZSA9IDE7 DQogVFVOQUJMRV9JTlQoImh3LnJlLm1zaV9kaXNhYmxlIiwgJm1zaV9kaXNhYmxlKTsNCiBzdGF0 aWMgaW50IHByZWZlcl9pb21hcCA9IDA7DQogVFVOQUJMRV9JTlQoImh3LnJlLnByZWZlcl9pb21h cCIsICZwcmVmZXJfaW9tYXApOw0KQEAgLTIxNzksNyArMjE3OSw2IEBADQogCXN0YXR1cyA9IENT Ul9SRUFEXzIoc2MsIFJMX0lTUik7DQogCWlmIChzdGF0dXMgPT0gMHhGRkZGIHx8IChzdGF0dXMg JiBSTF9JTlRSU19DUExVUykgPT0gMCkNCiAgICAgICAgICAgICAgICAgcmV0dXJuIChGSUxURVJf U1RSQVkpOw0KLQlDU1JfV1JJVEVfMihzYywgUkxfSU1SLCAwKTsNCiANCiAJdGFza3F1ZXVlX2Vu cXVldWVfZmFzdCh0YXNrcXVldWVfZmFzdCwgJnNjLT5ybF9pbnR0YXNrKTsNCiANCg== ------=_Part_130564_31585594.1288920690387 Content-Type: text/plain; name=newre.stats Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=newre.stats cmUwIHN0YXRpc3RpY3M6DQpUcmFuc21pdCBnb29kIGZyYW1lcyA6IDgzMzIwDQpSZWNlaXZlIGdv b2QgZnJhbWVzIDogMTM2MTU4DQpUeCBlcnJvcnMgOiAwDQpSeCBlcnJvcnMgOiAwDQpSeCBtaXNz ZWQgZnJhbWVzIDogMjY2Ng0KUnggZnJhbWUgYWxpZ25tZW50IGVycnMgOiAwDQpUeCBzaW5nbGUg Y29sbGlzaW9ucyA6IDANClR4IG11bHRpcGxlIGNvbGxpc2lvbnMgOiAwDQpSeCB1bmljYXN0IGZy YW1lcyA6IDEzNjE1Nw0KUnggYnJvYWRjYXN0IGZyYW1lcyA6IDANClJ4IG11bHRpY2FzdCBmcmFt ZXMgOiAxDQpUeCBhYm9ydHMgOiAwDQpUeCB1bmRlcnJ1bnMgOiAwDQo= ------=_Part_130564_31585594.1288920690387--