aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ntb/if_ntb
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2015-11-19 19:53:19 +0000
committerConrad Meyer <cem@FreeBSD.org>2015-11-19 19:53:19 +0000
commit70bca634d018c4ce3929d88e57f63c40641b2c07 (patch)
tree6ddd2c6d1330361faed74dfda7a41a422d17ee0e /sys/dev/ntb/if_ntb
parentf51a1fe048a60cb08616d88af3dcc11588ec8010 (diff)
downloadsrc-70bca634d018c4ce3929d88e57f63c40641b2c07.tar.gz
src-70bca634d018c4ce3929d88e57f63c40641b2c07.zip
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
Notes
Notes: svn path=/head/; revision=291085
Diffstat (limited to 'sys/dev/ntb/if_ntb')
-rw-r--r--sys/dev/ntb/if_ntb/if_ntb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ntb/if_ntb/if_ntb.c b/sys/dev/ntb/if_ntb/if_ntb.c
index 1459126ee048..a532d2b2a40d 100644
--- a/sys/dev/ntb/if_ntb/if_ntb.c
+++ b/sys/dev/ntb/if_ntb/if_ntb.c
@@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$");
#include <machine/cpufunc.h>
#include <machine/pmap.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+
#include "../ntb_hw/ntb_hw.h"
/*
@@ -101,7 +104,7 @@ SYSCTL_UINT(_hw_if_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN,
} \
} 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) +