Date: Thu, 27 Mar 2014 18:44:01 -0400 (EDT) From: Rick Macklem <rmacklem@uoguelph.ca> To: Christopher Forgeron <csforgeron@gmail.com> Cc: Pyun YongHyeon <pyunyh@gmail.com>, Andre Oppermann <andre@freebsd.org>, FreeBSD Net <freebsd-net@freebsd.org>, Markus Gebert <markus.gebert@hostpoint.ch>, Jack Vogel <jfvogel@gmail.com>, Garrett Wollman <wollman@freebsd.org> Subject: Re: 9.2 ixgbe tx queue hang Message-ID: <1292881633.1858906.1395960241007.JavaMail.root@uoguelph.ca> In-Reply-To: <CAB2_NwB7PnJfyzfgf4n7tqkKqxqgno%2B%2Bf9xY8_aV6AJ-mgPMYw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_1858903_1764427006.1395960241003 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Christopher Forgeron wrote: > > > > > > > On Wed, Mar 26, 2014 at 9:35 PM, Rick Macklem < rmacklem@uoguelph.ca > > wrote: > > > > > I've suggested in the other thread what you suggested in a recent > post...ie. to change the default, at least until the propagation > of driver set values is resolved. > > rick > > > > I wonder if we need to worry about propagating values up from the > sub-if's - Setting the default in if.c means this is set for all > if's, and it's a simple 1 line code change. If a specific 'if' needs > a different value, it can be set before ether_attach() is called. > > > I'm more concerned with the equation we use to calculate if_hw_tsomax > - Are we considering the right variables? Are we thinking on the > wrong OSI layer for headers? > Well, I'm pragmatic (which means I mostly care about some fix that works), but it seems to me that: - The problem is that some TSO enabled network drivers/hardware can only handle 32 transmit segments (or 32 mbufs in the chain for the TSO packet to be transmitted, if that is clearer). --> Since the problem is in certain drivers, it seems that those drivers should be where the long term fix goes. --> Since some hardware can't handle more than 32, it seems that the driver should be able to specify that limit, which tcp_output() can then apply. I have an untested patch that does this by adding if_hw_tsomaxseg. (The attachment called tsomaxseg.patch.) Changing if_hw_tsomax or its default value is just a hack that gets tcp_output() to apply a limit that the driver can then fix to 32 mbufs in the chain via m_defrag(). Since if_hw_tsomax (and if_hw_tsomaxseg in the untested patch) aren't propagated up through lagg, that needs to be fixed. (Yet another attached untested patch called lagg.patch.) As I said before, I don't see these patches getting tested/reviewed etc in time for 9.3, so I think reducing the default value of if_hw_tsomax is a reasonable short term hack to work around the problem. (And it sounds like Pyun YongHyeon has volunteered to fix many of the drivers, where the 32 limit isn't a hardware one.) rick ------=_Part_1858903_1764427006.1395960241003 Content-Type: text/x-patch; name=tsomaxseg.patch Content-Disposition: attachment; filename=tsomaxseg.patch Content-Transfer-Encoding: base64 LS0tIGtlcm4vdWlwY19zb2NrYnVmLmMuc2F2CTIwMTQtMDEtMzAgMjA6Mjc6MTcuMDAwMDAwMDAw IC0wNTAwCisrKyBrZXJuL3VpcGNfc29ja2J1Zi5jCTIwMTQtMDEtMzAgMjI6MTI6MDguMDAwMDAw MDAwIC0wNTAwCkBAIC05NjUsNiArOTY1LDM5IEBAIHNic25kcHRyKHN0cnVjdCBzb2NrYnVmICpz YiwgdV9pbnQgb2ZmLCAKIH0KIAogLyoKKyAqIFJldHVybiB0aGUgZmlyc3QgbWJ1ZiBmb3IgdGhl IHByb3ZpZGVkIG9mZnNldC4KKyAqLworc3RydWN0IG1idWYgKgorc2JzbmRtYnVmKHN0cnVjdCBz b2NrYnVmICpzYiwgdV9pbnQgb2ZmLCBsb25nICpmaXJzdF9sZW4pCit7CisJc3RydWN0IG1idWYg Km07CisKKwlLQVNTRVJUKHNiLT5zYl9tYiAhPSBOVUxMLCAoIiVzOiBzYl9tYiBpcyBOVUxMIiwg X19mdW5jX18pKTsKKworCSpmaXJzdF9sZW4gPSAwOworCS8qCisJICogSXMgb2ZmIGJlbG93IHN0 b3JlZCBvZmZzZXQ/IEhhcHBlbnMgb24gcmV0cmFuc21pdHMuCisJICogSWYgc28sIGp1c3QgdXNl IHNiX21iLgorCSAqLworCWlmIChzYi0+c2Jfc25kcHRyID09IE5VTEwgfHwgc2ItPnNiX3NuZHB0 cm9mZiA+IG9mZikKKwkJbSA9IHNiLT5zYl9tYjsK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IHZhbHVlIGZvciBUU08gbWF4 aW11bSBudW1iZXIgb2YgdHJhbnNtaXQgc2VnbWVudHMgKGNvdW50IG9mIG1idWZzKS4KKyAqLwor I2RlZmluZQlUQ1BUU09fTUFYX1RYX1NFR1NfREVGQVVMVAkzMAorCiAjaWZkZWYgVENQX1NJR05B VFVSRQogLyoKICAqIERlZmluZXMgd2hpY2ggYXJlIG5lZWRlZCBieSB0aGUgeGZvcm1fdGNwIG1v ZHVsZSBhbmQgdGNwX1tpbnxvdXRdcHV0CkBAIC0zMzMsNiArMzM5LDcgQEAgc3RydWN0IGhjX21l dHJpY3NfbGl0ZSB7CS8qIG11c3Qgc3RheSBpbgogc3RydWN0IHRjcF9pZmNhcCB7CiAJaW50CWlm Y2FwOwogCXVfaW50CXRzb21heDsKKwl1X2ludAl0c29tYXhzZWdzOwogfTsKIAogI2lmbmRlZiBf TkVUSU5FVF9JTl9QQ0JfSF8K ------=_Part_1858903_1764427006.1395960241003 Content-Type: text/x-patch; name=lagg.patch Content-Disposition: attachment; filename=lagg.patch Content-Transfer-Encoding: base64 LS0tIG5ldC9pZl9sYWdnLmMuc2F2CTIwMTQtMDMtMjYgMjE6MDQ6MzYuMDAwMDAwMDAwIC0wNDAw CisrKyBuZXQvaWZfbGFnZy5jCTIwMTQtMDMtMjYgMjE6MDc6NTcuMDAwMDAwMDAwIC0wNDAwCkBA IC00MjUsNiArNDI1LDcgQEAgbGFnZ19jYXBhYmlsaXRpZXMoc3RydWN0IGxhZ2dfc29mdGMgKnNj KQogCXN0cnVjdCBsYWdnX3BvcnQgKmxwOwogCWludCBjYXAgPSB+MCwgZW5hID0gfjA7CiAJdV9s b25nIGh3YSA9IH4wVUw7CisJdV9pbnQgaHdfdHNvbWF4ID0gSVBfTUFYUEFDS0VUOwogCiAJTEFH R19XTE9DS19BU1NFUlQoc2MpOwogCkBAIC00MzMsNiArNDM0LDggQEAgbGFnZ19jYXBhYmlsaXRp ZXMoc3RydWN0IGxhZ2dfc29mdGMgKnNjKQogCQljYXAgJj0gbHAtPmxwX2lmcC0+aWZfY2FwYWJp bGl0aWVzOwogCQllbmEgJj0gbHAtPmxwX2lmcC0+aWZfY2FwZW5hYmxlOwogCQlod2EgJj0gbHAt PmxwX2lmcC0+aWZfaHdhc3Npc3Q7CisJCWlmIChscC0+bHBfaWZwLT5pZl9od190c29tYXggPCBo d190c29tYXgpCisJCQlod190c29tYXggPSBscC0+bHBfaWZwLT5pZl9od190c29tYXg7CiAJfQog CWNhcCA9IChjYXAgPT0gfjAgPyAwIDogY2FwKTsKIAllbmEgPSAoZW5hID09IH4wID8gMCA6IGVu YSk7CkBAIC00NDAsMTAgKzQ0MywxMiBAQCBsYWdnX2NhcGFiaWxpdGllcyhzdHJ1Y3QgbGFnZ19z b2Z0YyAqc2MpCiAKIAlpZiAoc2MtPnNjX2lmcC0+aWZfY2FwYWJpbGl0aWVzICE9IGNhcCB8fAog CSAgICBzYy0+c2NfaWZwLT5pZl9jYXBlbmFibGUgIT0gZW5hIHx8Ci0JICAgIHNjLT5zY19pZnAt PmlmX2h3YXNzaXN0ICE9IGh3YSkgeworCSAgICBzYy0+c2NfaWZwLT5pZl9od2Fzc2lzdCAhPSBo d2EgfHwKKwkgICAgc2MtPnNjX2lmcC0+aWZfaHdfdHNvbWF4ICE9IGh3X3Rzb21heCkgewogCQlz Yy0+c2NfaWZwLT5pZl9jYXBhYmlsaXRpZXMgPSBjYXA7CiAJCXNjLT5zY19pZnAtPmlmX2NhcGVu YWJsZSA9IGVuYTsKIAkJc2MtPnNjX2lmcC0+aWZfaHdhc3Npc3QgPSBod2E7CisJCXNjLT5zY19p ZnAtPmlmX2h3X3Rzb21heCA9IGh3X3Rzb21heDsKIAkJZ2V0bWljcm90aW1lKCZzYy0+c2NfaWZw LT5pZl9sYXN0Y2hhbmdlKTsKIAogCQlpZiAoc2MtPnNjX2lmZmxhZ3MgJiBJRkZfREVCVUcpCg== ------=_Part_1858903_1764427006.1395960241003--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1292881633.1858906.1395960241007.JavaMail.root>