Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Apr 2017 22:02:23 +0300
From:      "Andrey V. Elsukov" <bu7cher@yandex.ru>
To:        rgrimes@freebsd.org
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r316699 - head/sys/net
Message-ID:  <7b4a8622-d7cc-a597-846e-0bdf5519a5d7@yandex.ru>
In-Reply-To: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net>
References:  <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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" <bu7cher@yandex.ru>
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 <machine/in_cksum.h>
>>>>  #include <security/mac/mac_framework.h>
>>>> =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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7b4a8622-d7cc-a597-846e-0bdf5519a5d7>