-
Notifications
You must be signed in to change notification settings - Fork 176
Description
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/src/blob/master/CONTRIBUTING.md
- I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/src/issues?q=is%3Aissue
Describe the bug
I own a DEC2752 firewall from Deciso, and running OPNsense. I am trying to enable 9000 bytes Jumbo frames on the two 10GBit "axgbe" ports. While this does work from the UI, and "ifconfig" on OPNsense also confirms the configuration setting, only jumbo frames up to 4ß82 bytes are supported.
To Reproduce
Steps to reproduce the behavior:
- Enable a MTU of 9000 for one of the axgbe interfaces (ax0 or ax1)
- Connect a Linux client, also with a MTU of 9000 to the corresponding port of the OPNsense firewall
- Perform a "ping -M do -s 8972 opnsense" from the Linux client to the OPNsense firewall
- See that pings won't be returned
- Perform a "ping -M do -s 4054 opnsense" from the Linux client to the OPNsense firewall
- See that pings will be returned
- Perform a "ping -M do -s 4055 opnsense" from the Linux client to the OPNsense firewall
- See that pings will NOT be returned
Expected behavior
If both the OPNsense and the client have set an MTU of 9000, then a ping with a packet size of 8972 bytes should work.
Additional context
I did some investigation into the FreeBSD driver code for axgbe. It seems that the receive buffer size is limited to 4k:
int
xgbe_calc_rx_buf_size(struct ifnet *netdev, unsigned int mtu)
{
unsigned int rx_buf_size;
if (mtu > XGMAC_JUMBO_PACKET_MTU)
return (-EINVAL);
rx_buf_size = mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
rx_buf_size = min(max(rx_buf_size, XGBE_RX_MIN_BUF_SIZE), PAGE_SIZE);
rx_buf_size = (rx_buf_size + XGBE_RX_BUF_ALIGN - 1) &
~(XGBE_RX_BUF_ALIGN - 1);
return (rx_buf_size);
}
The line rx_buf_size = min(max(rx_buf_size, XGBE_RX_MIN_BUF_SIZE), PAGE_SIZE); will effectively limit the buffer size to the page size. I suspect that either multiple (possibly continguous) pages would need to be allocated, or maybe the hardware also supports chaining multiple memory pages.
I did some research, and it seems that the AMD Ryzen V1500B is used in a couple of NAS devices from Synology and QNAP, which support 10GBit interfaces with jumbo frames of at least 9000 bytes. I could not find a test with an explicit test of the jumbo frame functionality (i.e. using a ping with appropriate packet sizes), but some people were using jumbo frames with 9000 bytes. At least with Synology, I trust that if one can configure 9000 bytes jumbo frames, then this will also work.
Therefore I assume that this is a driver limitation and not a hardware limitation.
Also see the discussion thread at https://forum.opnsense.org/index.php?topic=29359.0
Environment
OPNsense 25.4 business edition (amd64)
DEC2752 (AMD Ryzen V1500B)