# Jumbo frames on lagg0



## sk8harddiefast (Dec 21, 2011)

I use link aggregation with CARP and I want to change the MTU on lagg0 to 9000. How to do that?
My rc.conf right now is this:

```
defaultrouter="192.168.1.1"
ifconfig_re0="up"
ifconfig_msk0="up"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto lacp laggport re0 laggport msk0 192.168.1.2/24"
```


----------



## wblock@ (Dec 21, 2011)

It's an interesting question.  First place to look is lagg(4)... and there it is:
`$ man lagg | less -p MTU`


----------



## sk8harddiefast (Dec 21, 2011)

From 
	
	



```
man lagg | less -p MTU
```



> The MTU of the first interface to be added is used as the lagg MTU.


So

```
ifconfig_re0="up [B]mtu 9000[/B]"
ifconfig_msk0="up"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto lacp laggport re0 laggport msk0 192.168.1.2/24"
```
But *ifconfig lagg0* returns *mtu 1500*


----------



## wblock@ (Dec 21, 2011)

The sentence right after that says


> All additional interfaces are required to have exactly the same value.



So figure out the maximum value for both interfaces, and use the smaller value.  But make sure they really work.  My re0's maximum MTU is 6122.


----------



## sk8harddiefast (Dec 21, 2011)

I am lost about maximum and minimum values. To understand. I must set on re0 and msk0 the maximum or the minimum MTU? This phrase I cannot understand what means:





> So figure out the maximum value for both interfaces, and use the smaller value.


----------



## wblock@ (Dec 21, 2011)

By testing actual values, figure out the biggest MTU re0 supports (6122 here).  Then figure out the biggest MTU msk0 supports.  Use the smaller value of those two for both.  So if msk0 can have an MTU of 9000, they both should be set to 6122, the smaller of the two.  If msk0 only supports jumbo frames up to 4096, use 4096 for both.  If msk0 doesn't support jumbo frames at all, they both have to be 1500 (so don't set the MTU at all).


----------



## sk8harddiefast (Dec 21, 2011)

Ok. I understood  How can I find the highest limit of jumbo frames for my re0 and for my msk0? And set the minimum of them for both. Right?


----------



## wblock@ (Dec 21, 2011)

Try to set a value with ifconfig(8).  My re0 gives an error for values larger than 6122.  msk(4) says it will take up to 9022, but that might vary depending on the card.  em(4) says the maximum is 16114, but mine only handles 9216.  Try it:
`# ifconfig msk0 mtu 9022`

If it works, the easiest way to change things is to set the new value in /etc/rc.conf and restart.  Of course they both have to be the same for lagg(4), and the switch also has to support jumbo frames.


----------



## sk8harddiefast (Dec 21, 2011)

```
ifconfig msk0 mtu [B]9022[/B]
ifconfig: ioctl (set mtu): Invalid argument
```



> My re0 gives an error for values larger than 6122




```
ifconfig re0 mtu [B]6123[/B] 
ifconfig: ioctl (set mtu): Invalid argument
ifconfig re0 mtu [B]6122[/B]
ifconfig: ioctl (set mtu): Invalid argument
```
Huston you have a problem here


----------



## wblock@ (Dec 21, 2011)

Try much smaller values, like 4096.


----------



## sk8harddiefast (Dec 21, 2011)

I tried even to set MTU on 2000. Even there I get the same answer :/


----------



## wblock@ (Dec 21, 2011)

The change on re0 ought to work.  Are you trying that as root?


----------



## sk8harddiefast (Dec 21, 2011)

Even as root I get the same.

```
[ember@BSD|ZFS ~]$ su root
Password:
BSD|ZFS# ifconfig re0 mtu 6122
ifconfig: ioctl (set mtu): Invalid argument
BSD|ZFS# ifconfig re0 mtu 2000
ifconfig: ioctl (set mtu): Invalid argument
```


----------



## wblock@ (Dec 21, 2011)

re(4) shows that only some Realtek chipsets support jumbo frames.
`$ pciconf -lv | grep -A4 re0@`


----------



## sk8harddiefast (Dec 21, 2011)

```
[B]pciconf -lv | grep -A4 re0@[/B]
re0@pci0:5:4:0:	class=0x020000 card=0x820d1043 chip=0x816710ec rev=0x10 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL-8110SC/8169SC Gigabit Ethernet'
    class      = network
    subclass   = ethernet
```



> The 8169, 8169S and 8110S also support jumbo frames, which can be configured via the interface MTU setting. The MTU is limited to 7422, since the chip cannot transmit larger frames


----------

