Issue with the number of jumbo frames after tweaking

Arnaud YSMAL arnaud.ysmal at stormshield.eu
Wed Dec 10 09:07:33 UTC 2014


Hi,

Using sysctl to set a new value to kern.ipc.nmbjumbo9 or kern.ipc.nmbjumbo16 leads to a wrong value.
This appears in FreeBSD 9.3 with the revision 254515 (https://svnweb.freebsd.org/base?view=revision&revision=254515) which MFC the revision 243631.

The values are respectively 3 and 4 times bigger than expected.

Example on a FreeBSD 9.3 (amd64):
# sysctl kern.ipc.nmbjumbo9=224000
kern.ipc.nmbjumbo9: 223263 -> 672000

The sysctls functions in sys/kern/kern_mbuf.c got the new value from the uma_zone_set_max (sys/vm/uma_core.c) function.
It looks like the formula used in uma_core.c to compute the number of items based on the number of pages is not always the same (uk_ppera is sometimes missing).
In the enclosed patch I assumed that the correct formula to compute the number of items is: (pages / uk_ppera) * uk_ipers

Is it normal that in these sysctls the comparison between nmbufs and the sum of jumbos + clusters (added in the same revision) does not use the new value requested by the user?

Arnaud
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uma_core.patch
Type: text/x-patch
Size: 1764 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20141210/35393b0d/attachment.bin>


More information about the freebsd-net mailing list