From owner-freebsd-stable@FreeBSD.ORG Sun Apr 12 17:57:40 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 826A639E for ; Sun, 12 Apr 2015 17:57:40 +0000 (UTC) Received: from mail2.glyndwr.ac.uk (autodiscover.glyndwr.ac.uk [194.82.118.162]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail2.glyndwr.ac.uk", Issuer "TERENA SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2CA9C4 for ; Sun, 12 Apr 2015 17:57:39 +0000 (UTC) Received: from XCH7.wrexham.local ([fe80::4b1:2f4e:799f:2fb]) by XCH2.wrexham.local ([2002:c252:76a2::c252:76a2]) with mapi id 14.03.0224.002; Sun, 12 Apr 2015 18:57:35 +0100 From: Gareth Wyn Roberts To: "freebsd-stable@freebsd.org" Subject: msk msk0 watchdog timeout freeze hang lock stop problem Thread-Topic: msk msk0 watchdog timeout freeze hang lock stop problem Thread-Index: AdB1SJ7I96oMbb9aSL6oKcwiEr6BLQ== Date: Sun, 12 Apr 2015 17:57:34 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [213.122.248.173] Content-Type: multipart/mixed; boundary="_004_A861E9C3B0586445B36C4BB29ABF2DB46B2EA6F7XCH7wrexhamloca_" MIME-Version: 1.0 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2015 17:57:40 -0000 --_004_A861E9C3B0586445B36C4BB29ABF2DB46B2EA6F7XCH7wrexhamloca_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I've run in to problems using the msk device where initially it works well = enough to set DHCP etc. but stops/freezes as soon as any appreciable networ= k traffic occurs . There are several threads describing similar symptoms ov= er the past two years or more. I've been following several false leads but= have finally found a solution (at least it solves my problem). I'm running a standard FreeBSD 10.1-RELEASE and the NIC is detected as: mskc0: mem 0xfa000000-0xfa003fff i= rq 19 at device 0.0 on pci6 msk0: on msk= c0 msk0: Ethernet address: 00:13:77:e9:df:eb miibus0: on msk0 e1000phy0: PHY 0 on miibus0 e1000phy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT= , 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-ma ster, auto, auto-flow The network worked when using the i386 release, but failed for the amd64 re= lease (as reported previously) which prompted me to disable 64-bit DMA (the= patch for this is attached below). This worked for the first kernel built= but mysteriously failed when another unrelated part of the kernel was chan= ged (a usb driver) and the kernel recompiled. So identical msk driver code= worked in one kernel but not the second! This suggested that alignment dif= ferences between the two kernels were causing the msk driver to fail. Other= s have reported varying behaviour depending on different circumstances. It transpires that changing just one value in the if_mskreg.h file solved a= ll my problems. Subsequently I have not been able to make it fail under he= avy network traffic in either 32-bit or 64-bit mode. I'm working on 10.1-RELEASE source, i.e. if_msk.c revision 262524 and if_ms= kreg.h revision 264442. Here's the patch to if_mskreg.h --- if_mskreg.h-orig 2014-11-11 20:02:58.000000000 +0000 +++ if_mskreg.h 2015-04-12 18:47:20.000000000 +0100 @@ -2179,9 +2179,11 @@ * At first I guessed 8 bytes, the size of a single descriptor, would be * required alignment constraints. But, it seems that Yukon II have 4096 * bytes boundary alignment constraints. + * And it seems that the DMA status region for the Yukon Ultra 2 (88E8057) + * requires 8192 byte alignment to prevent locking. */ #define MSK_RING_ALIGN 4096 -#define MSK_STAT_ALIGN 4096 +#define MSK_STAT_ALIGN 8192 The patches to both files which also implement a MSK_64BIT_DMA_DISABLE flag= are attached. Perhaps the developers would consider committing these as i= t may be useful for future debugging. Gareth. --_004_A861E9C3B0586445B36C4BB29ABF2DB46B2EA6F7XCH7wrexhamloca_ Content-Type: text/x-patch; name="if_mskreg.h.rev264442.diff" Content-Description: if_mskreg.h.rev264442.diff Content-Disposition: attachment; filename="if_mskreg.h.rev264442.diff"; size=603; creation-date="Sun, 12 Apr 2015 17:52:31 GMT"; modification-date="Sun, 12 Apr 2015 17:52:31 GMT" Content-Transfer-Encoding: base64 LS0tIGlmX21za3JlZy5oLW9yaWcJMjAxNC0xMS0xMSAyMDowMjo1OC4wMDAwMDAwMDAgKzAwMDAK KysrIGlmX21za3JlZy5oCTIwMTUtMDQtMTIgMTg6NDc6MjAuMDAwMDAwMDAwICswMTAwCkBAIC0y MTc5LDkgKzIxNzksMTEgQEAKICAqIEF0IGZpcnN0IEkgZ3Vlc3NlZCA4IGJ5dGVzLCB0aGUgc2l6 ZSBvZiBhIHNpbmdsZSBkZXNjcmlwdG9yLCB3b3VsZCBiZQogICogcmVxdWlyZWQgYWxpZ25tZW50 IGNvbnN0cmFpbnRzLiBCdXQsIGl0IHNlZW1zIHRoYXQgWXVrb24gSUkgaGF2ZSA0MDk2CiAgKiBi eXRlcyBib3VuZGFyeSBhbGlnbm1lbnQgY29uc3RyYWludHMuCisgKiBBbmQgaXQgc2VlbXMgdGhh dCB0aGUgRE1BIHN0YXR1cyByZWdpb24gZm9yIHRoZSBZdWtvbiBVbHRyYSAyICg4OEU4MDU3KQor ICogcmVxdWlyZXMgODE5MiBieXRlIGFsaWdubWVudCB0byBwcmV2ZW50IGxvY2tpbmcuCiAgKi8K ICNkZWZpbmUgTVNLX1JJTkdfQUxJR04JNDA5NgotI2RlZmluZQlNU0tfU1RBVF9BTElHTgk0MDk2 CisjZGVmaW5lCU1TS19TVEFUX0FMSUdOCTgxOTIKIAogLyogUnggZGVzY3JpcHRvciBkYXRhIHN0 cnVjdHVyZSAqLwogc3RydWN0IG1za19yeF9kZXNjIHsK --_004_A861E9C3B0586445B36C4BB29ABF2DB46B2EA6F7XCH7wrexhamloca_ Content-Type: text/x-patch; name="if_msk.c.rev262524.dma.diff" Content-Description: if_msk.c.rev262524.dma.diff Content-Disposition: attachment; filename="if_msk.c.rev262524.dma.diff"; size=3748; creation-date="Sun, 12 Apr 2015 17:52:52 GMT"; modification-date="Sun, 12 Apr 2015 17:52:52 GMT" Content-Transfer-Encoding: base64 LS0tIGlmX21zay5jLW9yaWcJMjAxNC0xMS0xMSAyMDowMjo1OC4wMDAwMDAwMDAgKzAwMDAKKysr IGlmX21zay5jCTIwMTUtMDQtMTIgMDI6MTU6MTIuNTUxMDA1MDAwICswMTAwCkBAIC0yMTY0LDgg KzIxNjQsOCBAQAogCWVycm9yID0gYnVzX2RtYV90YWdfY3JlYXRlKAogCQkgICAgYnVzX2dldF9k bWFfdGFnKHNjLT5tc2tfZGV2KSwJLyogcGFyZW50ICovCiAJCSAgICBNU0tfU1RBVF9BTElHTiwg MCwJCS8qIGFsaWdubWVudCwgYm91bmRhcnkgKi8KLQkJICAgIEJVU19TUEFDRV9NQVhBRERSLAkJ LyogbG93YWRkciAqLwotCQkgICAgQlVTX1NQQUNFX01BWEFERFIsCQkvKiBoaWdoYWRkciAqLwor CQkgICAgQlVTX0RNQV9UQUdfTE9XQUREUiwJLyogbG93YWRkciAqLworCQkgICAgQlVTX0RNQV9U QUdfSElHSEFERFIsCS8qIGhpZ2hhZGRyICovCiAJCSAgICBOVUxMLCBOVUxMLAkJCS8qIGZpbHRl ciwgZmlsdGVyYXJnICovCiAJCSAgICBzdGF0X3N6LAkJCS8qIG1heHNpemUgKi8KIAkJICAgIDEs CQkJCS8qIG5zZWdtZW50cyAqLwpAQCAtMjIzNSw4ICsyMjM1LDggQEAKIAllcnJvciA9IGJ1c19k bWFfdGFnX2NyZWF0ZSgKIAkJICAgIGJ1c19nZXRfZG1hX3RhZyhzY19pZi0+bXNrX2lmX2Rldiks CS8qIHBhcmVudCAqLwogCQkgICAgMSwgMCwJCQkvKiBhbGlnbm1lbnQsIGJvdW5kYXJ5ICovCi0J C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3JlYXRlKHNjX2lmLT5tc2tfY2RhdGEubXNrX3Bh cmVudF90YWcsLyogcGFyZW50ICovCiAJCSAgICBNU0tfUklOR19BTElHTiwgMCwJCS8qIGFsaWdu bWVudCwgYm91bmRhcnkgKi8KLQkJICAgIEJVU19TUEFDRV9NQVhBRERSLAkJLyogbG93YWRkciAq LwotCQkgICAgQlVTX1NQQUNFX01BWEFERFIsCQkvKiBoaWdoYWRkciAqLworCQkgICAgQlVTX0RN QV9UQUdfTE9XQUREUiwJLyogbG93YWRkciAqLworCQkgICAgQlVTX0RNQV9UQUdfSElHSEFERFIs CS8qIGhpZ2hhZGRyICovCiAJCSAgICBOVUxMLCBOVUxMLAkJCS8qIGZpbHRlciwgZmlsdGVyYXJn ICovCiAJCSAgICBNU0tfUlhfUklOR19TWiwJCS8qIG1heHNpemUgKi8KIAkJICAgIDEsCQkJCS8q IG5zZWdtZW50cyAqLwpAQCAtMjI4OCw4ICsyMjg4LDggQEAKIAkvKiBDcmVhdGUgdGFnIGZvciBU eCBidWZmZXJzLiAqLwogCWVycm9yID0gYnVzX2RtYV90YWdfY3JlYXRlKHNjX2lmLT5tc2tfY2Rh dGEubXNrX3BhcmVudF90YWcsLyogcGFyZW50ICovCiAJCSAgICAxLCAwLAkJCS8qIGFsaWdubWVu dCwgYm91bmRhcnkgKi8KLQkJICAgIEJVU19TUEFDRV9NQVhBRERSLAkJLyogbG93YWRkciAqLwot CQkgICAgQlVTX1NQQUNFX01BWEFERFIsCQkvKiBoaWdoYWRkciAqLworCQkgICAgQlVTX0RNQV9U QUdfTE9XQUREUiwJLyogbG93YWRkciAqLworCQkgICAgQlVTX0RNQV9UQUdfSElHSEFERFIsCS8q IGhpZ2hhZGRyICovCiAJCSAgICBOVUxMLCBOVUxMLAkJCS8qIGZpbHRlciwgZmlsdGVyYXJnICov CiAJCSAgICBNU0tfVFNPX01BWFNJWkUsCQkvKiBtYXhzaXplICovCiAJCSAgICBNU0tfTUFYVFhT RUdTLAkJLyogbnNl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ICBOVUxMLCBOVUxMLAkJCS8q IGZpbHRlciwgZmlsdGVyYXJnICovCiAJCSAgICBNU0tfSlVNQk9fUlhfUklOR19TWiwJLyogbWF4 c2l6ZSAqLwogCQkgICAgMSwJCQkJLyogbnNlZ21lbnRzICovCkBAIC0yNDQ5LDggKzI0NDksOCBA QAogCS8qIENyZWF0ZSB0YWcgZm9yIGp1bWJvIFJ4IGJ1ZmZlcnMuICovCiAJZXJyb3IgPSBidXNf ZG1hX3RhZ19jcmVhdGUoc2NfaWYtPm1za19jZGF0YS5tc2tfcGFyZW50X3RhZywvKiBwYXJlbnQg Ki8KIAkJICAgIHJ4YWxpZ24sIDAsCQkJLyogYWxpZ25tZW50LCBib3VuZGFyeSAqLwotCQkgICAg QlVTX1NQQUNFX01BWEFERFIsCQkvKiBsb3dhZGRyICovCi0JCSAgICBCVVNfU1BBQ0VfTUFYQURE UiwJCS8qIGhpZ2hhZGRyICovCisJCSAgICBCVVNfRE1BX1RBR19MT1dBRERSLAkvKiBsb3dhZGRy ICovCisJCSAgICBCVVNfRE1BX1RBR19ISUdIQUREUiwJLyogaGlnaGFkZHIgKi8KIAkJICAgIE5V TEwsIE5VTEwsCQkJLyogZmlsdGVyLCBmaWx0ZXJhcmcgKi8KIAkJICAgIE1KVU05QllURVMsCQkJ LyogbWF4c2l6ZSAqLwogCQkgICAgMSwJCQkJLyogbnNlZ21lbnRzICovCg== --_004_A861E9C3B0586445B36C4BB29ABF2DB46B2EA6F7XCH7wrexhamloca_ Content-Type: text/x-patch; name="if_mskreg.h.rev264442.dma.diff" Content-Description: if_mskreg.h.rev264442.dma.diff Content-Disposition: attachment; filename="if_mskreg.h.rev264442.dma.diff"; size=1533; creation-date="Sun, 12 Apr 2015 17:53:17 GMT"; modification-date="Sun, 12 Apr 2015 17:53:17 GMT" Content-Transfer-Encoding: base64 LS0tIGlmX21za3JlZy5oLW9yaWcJMjAxNC0xMS0xMSAyMDowMjo1OC4wMDAwMDAwMDAgKzAwMDAK KysrIG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