From owner-freebsd-current@freebsd.org Mon Aug 24 01:36:46 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BACE09C1DC1 for ; Mon, 24 Aug 2015 01:36:46 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 95E49B5E for ; Mon, 24 Aug 2015 01:36:46 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 92E859C1DC0; Mon, 24 Aug 2015 01:36:46 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 918239C1DBE for ; Mon, 24 Aug 2015 01:36:46 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 576DFB5C; Mon, 24 Aug 2015 01:36:46 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by padfo6 with SMTP id fo6so4421928pad.3; Sun, 23 Aug 2015 18:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=43sm27+7ntJOvcQ/e0OQVMwW1mHP45sfa/9hRJG8B1Y=; b=d+MBegsR3mujx+n6L/0BdyRciMrj0mRFHJQ967tSyCTMy01EcTkhQ4TdTXsgEAydgs TYefhfxwQ6knhKHTPYt+goh/2L3xJqzRZZte9gpRIEP1OxWBoYAE53Yy8B5nkjvxuT5c qU9eE+A+jcBo3SBElMkXEqrXdyzbRRz/rGUMQDcqNWjPth4JOSWqXet5uhbYXScAD3Cm ts3tr7bJPLQm+zCm4/aF+nhV8rf6gsExgwoMTM6C8rBMZWJIRvY8rEMjphH3pO6GpyXW qInfkiSeykRtAx2XGSR9AlLIbj1mAeDyLobimk7hQtbJ7snyEvfBvCxfw9jhwsflSElK +nXw== X-Received: by 10.69.11.196 with SMTP id ek4mr41071174pbd.148.1440380205745; Sun, 23 Aug 2015 18:36:45 -0700 (PDT) Received: from pyunyh@gmail.com ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id qp5sm15227625pbc.0.2015.08.23.18.36.41 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 23 Aug 2015 18:36:44 -0700 (PDT) From: Yonghyeon PYUN X-Google-Original-From: "Yonghyeon PYUN" Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 24 Aug 2015 10:36:36 +0900 Date: Mon, 24 Aug 2015 10:36:36 +0900 To: Sean Bruno Cc: Rick Macklem , current@freebsd.org, Joel Dahl Subject: Re: Kernel panic with fresh current, probably nfs related Message-ID: <20150824013636.GA1015@michelle.fasterthan.com> Reply-To: pyunyh@gmail.com References: <20150822115519.GA79434@ymer.vnode.se> <914810061.28949434.1440248260373.JavaMail.zimbra@uoguelph.ca> <55D8BEB6.7090202@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <55D8BEB6.7090202@freebsd.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 24 Aug 2015 01:36:46 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 22, 2015 at 11:25:58AM -0700, Sean Bruno wrote: > > > > > I'm going to guess that you're using an "em" net driver, since that is the > > only one that sets if_hw_tsomax > IP_MAXPACKET (65535) from what I can see. > > > > Sean, EM_TSO_SIZE is defined as (65535 + sizeof(struct ether_vlan_header)), > > which makes it > IP_MAXPACKET. The value of if_hw_tsomax must be <= IP_MAXPACKET > > and I'm guessing this is what caused the above panic. (Someday it would be > > nice if TSO segments > IP_MAXPACKET could be handled, but that will take changes > > in the ip layer and router software so that a bogus ip_len field doesn't cause > > problems.) > > > > if_hw_tsomax needs to be the maximum segment size that the driver can accept > > from IP. Since the driver adds any MAC header after accepting the TSO segment > > from the IP layer, it shouldn't include MAC header(s) in the value for if_hw_tsomax. > > (If its limit includes MAC header(s), it needs to subtract those out when setting > > if_hw_tsomax, not add them.) > > > > Since I am working up a patch for the value of if_hw_tsomaxsegcount, I think I'll > > add a check for > IP_MAXPACKET for if_hw_tsomax as well. > > > > rick > > Huh, ok. You want to try something like this then? > > sean > > > Index: if_em.h > =================================================================== > --- if_em.h (revision 286991) > +++ if_em.h (working copy) > @@ -268,7 +268,7 @@ > > #define EM_MAX_SCATTER 64 > #define EM_VFTA_SIZE 128 > -#define EM_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) > +#define EM_TSO_SIZE (65535 - sizeof(struct ether_vlan_header)) > #define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ > #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ > #define EM_MSIX_LINK 0x01000000 /* For 82574 use */ I don't remember TSO details on em(4) controllers at this moment(it had been long time ago since lastly I touched it) but I think the controller has no additional limit on TSO size(it claims the controller supports MS Large Send Offload so it should support up to 64KB IP datagram) so the change would be sub-optimal. I've attached a new diff. It was not tested though, I don't have em(4) controllers. > Index: if_lem.h > =================================================================== > --- if_lem.h (revision 286991) > +++ if_lem.h (working copy) > @@ -238,7 +238,7 @@ > > #define EM_MAX_SCATTER 64 > #define EM_VFTA_SIZE 128 > -#define EM_TSO_SIZE (65535 + sizeof(struct ether_vlan_header)) > +#define EM_TSO_SIZE (65535 - sizeof(struct ether_vlan_header)) > #define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ > #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ > #define ETH_ZLEN 60 > I think lem(4) does not support TSO so the change would have no effect. Actually all reference on TSO for lem(4) should be removed I guess. --9amGYk9869ThD9tj Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="em.tso.diff" Index: sys/dev/e1000/if_em.c =================================================================== --- sys/dev/e1000/if_em.c (revision 287087) +++ sys/dev/e1000/if_em.c (working copy) @@ -3044,7 +3044,7 @@ em_setup_interface(device_t dev, struct adapter *a if_setioctlfn(ifp, em_ioctl); if_setgetcounterfn(ifp, em_get_counter); /* TSO parameters */ - ifp->if_hw_tsomax = EM_TSO_SIZE; + ifp->if_hw_tsomax = IP_MAXPACKET; ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER; ifp->if_hw_tsomaxsegsize = EM_TSO_SEG_SIZE; --9amGYk9869ThD9tj--