From dbf2eb543bc633369f08829170bf7b55f683707f Mon Sep 17 00:00:00 2001 From: Marcin Wojtas Date: Thu, 10 May 2018 09:32:59 +0000 Subject: [PATCH] Skip setting the MTU for ENA if it is not changing On AWS, a network interface can get reinitialized every 30 minutes due to the MTU being (re)set when a new DHCP lease is obtained. This can cause packet drop, along with annoying syslog messages. Skip setting the MTU in the ena driver if the new MTU is the same as the old MTU. Note this fix is already in the netfront driver. Testing: Verified ena up/down messages do not appear every 30 min in /var/log/messages with the fix in place. Submitted by: Krishna Yenduri Reviewed by: Michal Krawczyk --- sys/dev/ena/ena.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index a806747d639..174549120d9 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2368,6 +2368,8 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) rc = 0; switch (command) { case SIOCSIFMTU: + if (ifp->if_mtu == ifr->ifr_mtu) + break; sx_xlock(&adapter->ioctl_sx); ena_down(adapter);