Re: Kernel panic with fresh current, probably nfs related

From: Yonghyeon PYUN <pyunyh_at_gmail.com>
Date: Mon, 24 Aug 2015 10:36:36 +0900
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)
> _at__at_ -268,7 +268,7 _at__at_
> 
>  #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)
> _at__at_ -238,7 +238,7 _at__at_
> 
>  #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.

Received on Sun Aug 23 2015 - 23:36:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:59 UTC