Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Set MTU correctly if mtu > 1500.



details:   https://anonhg.NetBSD.org/src/rev/38c1d9f3009e
branches:  trunk
changeset: 464271:38c1d9f3009e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Oct 01 10:04:11 2019 +0000

description:
Set MTU correctly if mtu > 1500.

diffstat:

 sys/dev/pci/ixgbe/ixv.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 460566d6c26d -r 38c1d9f3009e sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Tue Oct 01 09:36:56 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Tue Oct 01 10:04:11 2019 +0000
@@ -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 @@
        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 @@
         * Determine the correct mbuf pool
         * for doing jumbo/headersplit
         */
-       if (ifp->if_mtu > ETHERMTU)
+       if (adapter->max_frame_size <= MCLBYTES)
+               adapter->rx_mbuf_sz = MCLBYTES;
+       else
                adapter->rx_mbuf_sz = MJUMPAGESIZE;
-       else
-               adapter->rx_mbuf_sz = MCLBYTES;
 
        /* Prepare receive descriptors and buffers */
        if (ixgbe_setup_receive_structures(adapter)) {



Home | Main Index | Thread Index | Old Index