From owner-svn-src-head@freebsd.org Tue Apr 11 19:03:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F27D3A01A; Tue, 11 Apr 2017 19:03:38 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5p.cmail.yandex.net (forward5p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD60C1EE2; Tue, 11 Apr 2017 19:03:37 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [77.88.29.85]) by forward5p.cmail.yandex.net (Yandex) with ESMTP id 7919720EAB; Tue, 11 Apr 2017 22:03:34 +0300 (MSK) Received: from smtp2p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2p.mail.yandex.net (Yandex) with ESMTP id BCA301A80060; Tue, 11 Apr 2017 22:03:32 +0300 (MSK) Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Fqf15KSlEL-3VJuc0Z2; Tue, 11 Apr 2017 22:03:31 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1491937411; bh=CaWKc1Bv8rgwrOmZ5g+94RKwe8KX3YSLPiQYAjWs7Dg=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=eSYr8KpaqsZumaaen+GR2a4QGUr8DjsiVSerHqDunKLA0lsFalBRXVV6rKXgThSIT QLRKyKKfUh6O47x3A36cmy0fcZWSy4NC4Hkf5p2okYzqAPUc7LGaNBWt+CVPowvY5i SrTKnFgab93QblZhlpolKXgSPcMgMYhDwGtS2RjY= Authentication-Results: smtp2p.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: svn commit: r316699 - head/sys/net To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <7b4a8622-d7cc-a597-846e-0bdf5519a5d7@yandex.ru> Date: Tue, 11 Apr 2017 22:02:23 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 19:03:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg Content-Type: multipart/mixed; boundary="FrwCIHriBBhRQ12cpNfdJBv4Esigd5Qx9"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7b4a8622-d7cc-a597-846e-0bdf5519a5d7@yandex.ru> Subject: Re: svn commit: r316699 - head/sys/net References: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> --FrwCIHriBBhRQ12cpNfdJBv4Esigd5Qx9 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11.04.2017 21:49, Rodney W. Grimes wrote: >>>> -#define GREMTU 1500 >>>> +#define GREMTU 1476 >>> >>> I would of thought that this was >>> #define GREMTU ETHERMTU >>> and now should probably be: >>> #define GREMTU ETHERMTU - gre_hlen;=20 >>> Or what ever the approprite sizeof(foo) is; >> >> I just returned back constants that were here :) >=20 > Can we try to improve on this, or maybe just ignore it? There are a lot of things that we need and can improve, but usually we choose the most interested or important. >=20 >> The man page says: >> "The MTU of gre interfaces is set to 1476 by default, to match the >> value used by Cisco routers." >=20 > That might need some clean up too? >=20 >>> Isn't this arguably wrong in the face of JumboFrames? >>> >> >> I don't see why it may be wrong for jumbo frames. The default MTU valu= e >> used by any interfaces is ETHERMTU, if you know that your NIC supports= >> jumbo frames, you will configure specific MTU value. >> If you want 9k MTU on gre(4), you should configure it. >=20 > I may some day want to #define ETHERMTU 9000 and just have all the righ= t > magic happen, wouldnt that be nice? It would be nice. >>>> static const char grename[] =3D "gre"; >>>> static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation= "); >>>> static VNET_DEFINE(struct mtx, gre_mtx); >>>> @@ -173,7 +173,7 @@ gre_clone_create(struct if_clone *ifc, i >>>> GRE2IFP(sc)->if_softc =3D sc; >>>> if_initname(GRE2IFP(sc), grename, unit); >>>> =20 >>>> - GRE2IFP(sc)->if_mtu =3D sc->gre_mtu =3D GREMTU; >>>> + GRE2IFP(sc)->if_mtu =3D GREMTU; >>>> GRE2IFP(sc)->if_flags =3D IFF_POINTOPOINT|IFF_MULTICAST; >>>> GRE2IFP(sc)->if_output =3D gre_output; >>>> GRE2IFP(sc)->if_ioctl =3D gre_ioctl; >>>> @@ -231,7 +231,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, >>>> /* XXX: */ >>>> if (ifr->ifr_mtu < 576) >>> >>> This is another magic constant that should be in a #define. >> >> It was here too. I think it is something from the past and can be remo= ved. >> >> From RFC791: "It is recommended that hosts only send datagrams larger >> than 576 octets". >=20 > No, I doubt we want to remove that, it is also part of ipv6 documentati= on, > and iirc part of some BCP's. You really dont want to be running on the= > internet with MTU < 576. It use to be 296 in the days when we had SLIP= =2E Why not? We have many things that allow foot shooting. =3D=3D=3D=3D=3D=3D >>>> --- head/sys/net/if_me.c Tue Apr 11 08:29:12 2017 (r316698) >>>> +++ head/sys/net/if_me.c Tue Apr 11 08:56:18 2017 (r316699) >>>> @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); >>>> #include >>>> #include >>>> =20 >>>> -#define MEMTU 1500 >>>> +#define MEMTU (1500 - sizeof(struct mobhdr)) >>> >>> 1500 -> ETHERMTU? >> >> Feel free to fix this. Many pseudo interfaces has similar MTU limitati= ons. --=20 WBR, Andrey V. Elsukov --FrwCIHriBBhRQ12cpNfdJBv4Esigd5Qx9-- --BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAljtKD8ACgkQAcXqBBDI oXp5nwf9FMYpUVQwnMCo4aKesU47c2l8jRCrU5rczAWNvVmW0AyUp5lNjn+IG9ya zd9NiHXs+RDwVF1h/cbIel7t3Qg6m293aJyLeoVxCBjknuNb+iTU+o5fRUQ1lfAR nXw2LIzLOBFaedxnJapYD8a2wHP5bWav/1zD1n+S+JLnLjUn/VeGrrrC9xmFyjCm n/p5FZJowQe4DhQm50xnCLgcWqr6cYMhe9WSChvCXmqLRPm7eZRylXHWKlPC4JLS MG2S3bEEzDp3lJaSQUw3lTPCO0trkG3fMrjvPUZHrUkVSfCSEmL7aPlzYvCurKsm 3hHINip2g4uA4of4i2jbwJDM/NKgrA== =TIIx -----END PGP SIGNATURE----- --BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg--