From owner-svn-src-head@freebsd.org Tue Apr 11 18:16:56 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 86C14D3A971; Tue, 11 Apr 2017 18:16:56 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward2p.cmail.yandex.net (forward2p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::12]) (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 263CF122; Tue, 11 Apr 2017 18:16:55 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [IPv6:2a02:6b8:0:801::ab]) by forward2p.cmail.yandex.net (Yandex) with ESMTP id B99BD20FAD; Tue, 11 Apr 2017 21:16:42 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id BF0DA3C807F1; Tue, 11 Apr 2017 21:16:40 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dXWgLJ60xq-GdJmCRwC; Tue, 11 Apr 2017 21:16:39 +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=1491934599; bh=P+tVge53SkqWA0resiUVCJtwc1k1iIeH7WW3yI2TRvM=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=mtDMKgtYarHxJj1cUzpfhFxrSuFuqTVQw7a+NJBnFSmqw8240HgvPpnDNuKpO+2Ot tDQWcTrFWtCmyr0M1Qi529+VhAQDOtiqOIU+/S5HDs2lxVMMHwcB8cXLonPUDz793U OPMyUMmaF4crkZWmdfoyKS/X6wwbOhTt2xFjTK3w= Authentication-Results: smtp1j.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: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: Date: Tue, 11 Apr 2017 21:15:26 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7" 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 18:16:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7 Content-Type: multipart/mixed; boundary="VmNqvIwPW5XB04HhqASNk2ljKML4Gnv4p"; 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: Subject: Re: svn commit: r316699 - head/sys/net References: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> --VmNqvIwPW5XB04HhqASNk2ljKML4Gnv4p Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11.04.2017 19:51, Rodney W. Grimes wrote: >> Modified: head/sys/net/if_gre.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/net/if_gre.c Tue Apr 11 08:29:12 2017 (r316698) >> +++ head/sys/net/if_gre.c Tue Apr 11 08:56:18 2017 (r316699) >> @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> =20 >> -#define GREMTU 1500 >> +#define GREMTU 1476 >=20 > 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 :) The man page says: "The MTU of gre interfaces is set to 1476 by default, to match the value used by Cisco routers." > 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 value 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. >> 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) >=20 > 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 removed= =2E =46rom RFC791: "It is recommended that hosts only send datagrams larger than 576 octets". >> return (EINVAL); >> - break; >> + ifp->if_mtu =3D ifr->ifr_mtu; >> + return (0); >> case SIOCSIFADDR: >> ifp->if_flags |=3D IFF_UP; >> case SIOCSIFFLAGS: >> @@ -255,12 +256,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, >> } >> error =3D 0; >> switch (cmd) { >> - case SIOCSIFMTU: >> - GRE_WLOCK(sc); >> - sc->gre_mtu =3D ifr->ifr_mtu; >> - gre_updatehdr(sc); >> - GRE_WUNLOCK(sc); >> - goto end; >> case SIOCSIFPHYADDR: >> #ifdef INET6 >> case SIOCSIFPHYADDR_IN6: >> @@ -549,7 +544,6 @@ gre_updatehdr(struct gre_softc *sc) >> } else >> sc->gre_oseq =3D 0; >> gh->gre_flags =3D htons(flags); >> - GRE2IFP(sc)->if_mtu =3D sc->gre_mtu - sc->gre_hlen; >> } >> =20 >> static void >> >> Modified: head/sys/net/if_gre.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/net/if_gre.h Tue Apr 11 08:29:12 2017 (r316698) >> +++ head/sys/net/if_gre.h Tue Apr 11 08:56:18 2017 (r316699) >> @@ -69,7 +69,6 @@ struct gre_softc { >> uint32_t gre_oseq; >> uint32_t gre_key; >> uint32_t gre_options; >> - uint32_t gre_mtu; >> u_int gre_fibnum; >> u_int gre_hlen; /* header size */ >> union { >> >> Modified: head/sys/net/if_me.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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)) >=20 > 1500 -> ETHERMTU? Feel free to fix this. Many pseudo interfaces has similar MTU limitations= =2E --=20 WBR, Andrey V. Elsukov --VmNqvIwPW5XB04HhqASNk2ljKML4Gnv4p-- --q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7 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/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAljtHT4ACgkQAcXqBBDI oXoJ3Qf/YsC3Y5+ViZTmCbjs8iNY1b1S91ECVIbNGPrPNIJwQS55dU/46tPzaUzw 55aVCd7zcb+6c98wEInEd3vR69ExXTReT6dfbaoQOxKOjRfVKtxsYFuuFSj9Nhhi moqVlPEODEkJxHOl/+hdHXMUaI1K39rhClZLEfSgnU95ruw2RcNluYF65YUz49Wp H8r+1bpIuHDj/BHPLcKX/M7aDqYJ1jXO+Oggx8zkJQAmLQzpiaIuL06YPTf9AKoC NphIX5NFDJsI3YeD6oF3addW8TZ3AfNwTkToBJvTmh9muiUpiGwULNO6cTlSvwGd GEMNCUJvcV+5xDQEa9wpNqqvqklgYw== =mJxp -----END PGP SIGNATURE----- --q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7--