svn commit: r319491 - head/sys/dev/xen/netfront

Colin Percival cperciva at FreeBSD.org
Fri Jun 2 07:03:32 UTC 2017


Author: cperciva
Date: Fri Jun  2 07:03:31 2017
New Revision: 319491
URL: https://svnweb.freebsd.org/changeset/base/319491

Log:
  Skip setting the MTU in the netfront driver (xn# devices) if the new MTU
  is the same as the old MTU.  In particular, on Amazon EC2 "T2" instances
  without this change, the network interface is reinitialized every 30
  minutes due to the MTU being (re)set when a new DHCP lease is obtained,
  causing packets to be dropped, along with annoying syslog messages about
  the link state changing.
  
  As a side note, the behaviour this commit fixes was responsible for
  exposing the locking problems fixed via r318523 and r318631.
  
  Maintainers of other network interface drivers may wish to consider making
  the corresponding change; the handling of SIOCSIFMTU does not seem to
  exhibit a great deal of consistency between drivers.
  
  MFC after:	1 week

Modified:
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netfront/netfront.c
==============================================================================
--- head/sys/dev/xen/netfront/netfront.c	Fri Jun  2 03:53:34 2017	(r319490)
+++ head/sys/dev/xen/netfront/netfront.c	Fri Jun  2 07:03:31 2017	(r319491)
@@ -1767,6 +1767,9 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 #endif
 		break;
 	case SIOCSIFMTU:
+		if (ifp->if_mtu == ifr->ifr_mtu)
+			break;
+
 		ifp->if_mtu = ifr->ifr_mtu;
 		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		xn_ifinit(sc);


More information about the svn-src-head mailing list