From owner-freebsd-net@FreeBSD.ORG Tue Aug 18 21:05:24 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C93D91065672; Tue, 18 Aug 2009 21:05:24 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 21CF48FC45; Tue, 18 Aug 2009 21:05:16 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 8F5715C06F; Wed, 19 Aug 2009 05:05:10 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 3B74F55CDC94; Wed, 19 Aug 2009 05:05:10 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id Mb-qDex1uhlT; Wed, 19 Aug 2009 05:04:11 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 9451255CDC82; Wed, 19 Aug 2009 05:03:59 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type; b=DvB6xfedbIueLqIBf2+zT7JUEMrVF0VR9KtnXRQiQBLClNT9ASZ+Q2sBpaUl5mPrb Q0u0eh/uIgTbJNVxmtWuA== Message-ID: <4A8B1729.8070503@delphij.net> Date: Tue, 18 Aug 2009 14:03:37 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Jack Vogel References: <5D267A3F22FD854F8F48B3D2B523819339EC3813D2@IRVEXCHCCR01.corp.ad.broadcom.com> <692150.91493.qm@web63906.mail.re1.yahoo.com> <2a41acea0908060905n69edf1dfkbf993d9f8a4edf37@mail.gmail.com> In-Reply-To: <2a41acea0908060905n69edf1dfkbf993d9f8a4edf37@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------050902070402030906080103" Cc: Barney Cordoba , David Christensen , "d@delphij.net" , "freebsd-net@freebsd.org" , Julian Elischer , Jack F Vogel , yongari@FreeBSD.org Subject: [PATCH] Fix for e1000 (em/igb) NOARP issue [Was Re: em(4): sending ARP regardless of NOARP flag] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2009 21:05:25 -0000 This is a multi-part message in MIME format. --------------050902070402030906080103 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Jack, I have looked into the code history and found that sys/dev/em/if_em.c,v 1.119 has introduced the arp_ifinit() call in order to fix the problem that if_em won't send ARP when IP address is changed. I think we can further improve it as attached, say, only do it when IFF_NOARP is not set. This should have no effect for usual configuration but fix the problem when NOARP is the desired behavior. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqLFykACgkQi+vbBBjt66CMFQCeOkESwsgDAbqe5PCtiMulaU1E lIAAoIm0LDJ6qHuR8jyo7dXFi/9iYA22 =9E54 -----END PGP SIGNATURE----- --------------050902070402030906080103 Content-Type: text/plain; name="e1000-noarp-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="e1000-noarp-fix.diff" Index: if_igb.c =================================================================== --- if_igb.c (revision 196363) +++ if_igb.c (working copy) @@ -952,7 +952,8 @@ igb_ioctl(struct ifnet *ifp, u_long command, caddr igb_init_locked(adapter); IGB_CORE_UNLOCK(adapter); } - arp_ifinit(ifp, ifa); + if (!(ifp->if_flags & IFF_NOARP)) + arp_ifinit(ifp, ifa); } else #endif error = ether_ioctl(ifp, command, data); Index: if_em.c =================================================================== --- if_em.c (revision 196363) +++ if_em.c (working copy) @@ -1204,7 +1204,8 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_ em_init_locked(adapter); EM_CORE_UNLOCK(adapter); } - arp_ifinit(ifp, ifa); + if (!(ifp->if_flags & IFF_NOARP)) + arp_ifinit(ifp, ifa); } else #endif error = ether_ioctl(ifp, command, data); --------------050902070402030906080103--