Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2012 15:23:19 +0400
From:      Andrey Zonov <andrey@zonov.org>
To:        freebsd-net@freebsd.org
Cc:        davidch@freebsd.org
Subject:   bce: jumbo not working since r218423
Message-ID:  <CANU_PUGwoLSrPcGE8wT=ga3-=F_n9qN4pPXMJC%2BH72wpS9Mfcw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi,

I found that jumbo frames don't work after r218423 with bce driver.
This happens because controller doesn't do reinitialization when MTU
is changed.  Attached patch solves this problem.

I also don't understand why sysctl hw.bce.loose_rx_mtu doesn't respect
with tunnable hw.bce.strict_rx_mtu.  Is there any reason to give them
different names?

-- 
Andrey Zonov

[-- Attachment #2 --]
Index: sys/dev/bce/if_bce.c
===================================================================
--- sys/dev/bce/if_bce.c	(revision 234600)
+++ sys/dev/bce/if_bce.c	(working copy)
@@ -7415,7 +7415,7 @@
 	struct bce_softc *sc = ifp->if_softc;
 	struct ifreq *ifr = (struct ifreq *) data;
 	struct mii_data *mii;
-	int mask, error = 0;
+	int mask, error = 0, reinit = 0;
 
 	DBENTER(BCE_VERBOSE_MISC);
 
@@ -7436,21 +7436,19 @@
 
 		BCE_LOCK(sc);
 		ifp->if_mtu = ifr->ifr_mtu;
+		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+			/*
+			 * It may be requested to turn on/off jumbo
+			 * frames, so reinit controller.
+			 */
+			bce_stop(sc);
+			reinit = 1;
+		}
 
-		if (bce_hdr_split == FALSE) {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				/*
-				 * Because allocation size is used in RX
-				 * buffer allocation, stop controller if
-				 * it is already running.
-				 */
-				bce_stop(sc);
-			}
-
+		if (bce_hdr_split == FALSE)
 			bce_get_rx_buffer_sizes(sc, ifp->if_mtu);
-
+		if (reinit)
 			bce_init_locked(sc);
-		}
 
 		BCE_UNLOCK(sc);
 		break;

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANU_PUGwoLSrPcGE8wT=ga3-=F_n9qN4pPXMJC%2BH72wpS9Mfcw>