summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2019-10-01 10:04:11 +0000
committermsaitoh <msaitoh@NetBSD.org>2019-10-01 10:04:11 +0000
commit3fad596288f5be79dd4d2a3a46a6fd82692aaee2 (patch)
tree1303790b6517d56a52a5cf46307ed07144d21d38 /sys/dev
parent3205ec99c5443ad89c9c1507066fdf0cc7fae8ce (diff)
Set MTU correctly if mtu > 1500.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ixgbe/ixv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/ixgbe/ixv.c b/sys/dev/pci/ixgbe/ixv.c
index 559a06349ab..7aee656a34d 100644
--- a/sys/dev/pci/ixgbe/ixv.c
+++ b/sys/dev/pci/ixgbe/ixv.c
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.138 2019/09/20 09:28:37 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.139 2019/10/01 10:04:11 msaitoh Exp $*/
/******************************************************************************
@@ -716,6 +716,9 @@ ixv_init_locked(struct adapter *adapter)
for (i = 0, que = adapter->queues; i < adapter->num_queues; i++, que++)
que->disabled_count = 0;
+ adapter->max_frame_size =
+ ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+
/* reprogram the RAR[0] in case user changed it. */
hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV);
@@ -748,10 +751,10 @@ ixv_init_locked(struct adapter *adapter)
* Determine the correct mbuf pool
* for doing jumbo/headersplit
*/
- if (ifp->if_mtu > ETHERMTU)
- adapter->rx_mbuf_sz = MJUMPAGESIZE;
- else
+ if (adapter->max_frame_size <= MCLBYTES)
adapter->rx_mbuf_sz = MCLBYTES;
+ else
+ adapter->rx_mbuf_sz = MJUMPAGESIZE;
/* Prepare receive descriptors and buffers */
if (ixgbe_setup_receive_structures(adapter)) {