From owner-svn-src-all@freebsd.org Thu Nov 19 19:53:20 2015 Return-Path: Delivered-To: svn-src-all@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 5BB08A33943; Thu, 19 Nov 2015 19:53:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2814E1310; Thu, 19 Nov 2015 19:53:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAJJrJZZ066916; Thu, 19 Nov 2015 19:53:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAJJrJRc066915; Thu, 19 Nov 2015 19:53:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201511191953.tAJJrJRc066915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 19 Nov 2015 19:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291085 - head/sys/dev/ntb/if_ntb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2015 19:53:20 -0000 Author: cem Date: Thu Nov 19 19:53:19 2015 New Revision: 291085 URL: https://svnweb.freebsd.org/changeset/base/291085 Log: if_ntb: Initialize if_mtu to the correct MTU Lower the payload data (IP) portion of the MTU from 0x10000 to IP_MAXPACKET (0xFFFF) to avoid panicing the IP stack. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Thu Nov 19 19:53:09 2015 (r291084) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Thu Nov 19 19:53:19 2015 (r291085) @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "../ntb_hw/ntb_hw.h" /* @@ -101,7 +104,7 @@ SYSCTL_UINT(_hw_if_ntb, OID_AUTO, debug_ } \ } while (0) -static unsigned transport_mtu = 0x10000 + ETHER_HDR_LEN + ETHER_CRC_LEN; +static unsigned transport_mtu = IP_MAXPACKET + ETHER_HDR_LEN + ETHER_CRC_LEN; static uint64_t max_mw_size; SYSCTL_UQUAD(_hw_if_ntb, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, &max_mw_size, 0, @@ -435,6 +438,8 @@ ntb_setup_interface(void) ether_ifattach(ifp, net_softc.eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; + ifp->if_mtu = ntb_transport_max_size(net_softc.qp) - ETHER_HDR_LEN - + ETHER_CRC_LEN; ntb_transport_link_up(net_softc.qp); net_softc.bufsize = ntb_transport_max_size(net_softc.qp) +