svn commit: r316699 - head/sys/net

Andrey V. Elsukov bu7cher at yandex.ru
Tue Apr 11 19:03:38 UTC 2017


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; 
>>> Or what ever the approprite sizeof(foo) is;
>>
>> I just returned back constants that were here :)
> 
> 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.

> 
>> The man page says:
>>  "The MTU of gre interfaces is set to 1476 by default, to match the
>>   value used by Cisco routers."
> 
> That might need some clean up too?
> 
>>> 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.
> 
> I may some day want to #define ETHERMTU 9000 and just have all the right
> magic happen, wouldnt that be nice?

It would be nice.

>>>>  static const char grename[] = "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 = sc;
>>>>  	if_initname(GRE2IFP(sc), grename, unit);
>>>>  
>>>> -	GRE2IFP(sc)->if_mtu = sc->gre_mtu = GREMTU;
>>>> +	GRE2IFP(sc)->if_mtu = GREMTU;
>>>>  	GRE2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST;
>>>>  	GRE2IFP(sc)->if_output = gre_output;
>>>>  	GRE2IFP(sc)->if_ioctl = 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 removed.
>>
>> From RFC791: "It is recommended that hosts only send datagrams larger
>> than 576 octets".
> 
> No, I doubt we want to remove that, it is also part of ipv6 documentation,
> 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.

Why not? We have many things that allow foot shooting.

======
>>>> --- 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>
>>>>  
>>>> -#define	MEMTU			1500
>>>> +#define	MEMTU			(1500 - sizeof(struct mobhdr))
>>>
>>> 1500 -> ETHERMTU?
>>
>> Feel free to fix this. Many pseudo interfaces has similar MTU limitations.

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 553 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20170411/6a357493/attachment.sig>


More information about the svn-src-head mailing list