opnsense / opnsense/src

axgbe: Jumbo frames only work up to 4082 bytes for MTU

Open
#251 13 comments 0 reactions 1 assignee View on GitHub

@swhite2 is already working on this.

Since May 11, 2025.

feature
Dominant language
C
Stars
505
Forks
202
PR merge metrics
No merged PRs in 30d

Description

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

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:

  1. Enable a MTU of 9000 for one of the axgbe interfaces (ax0 or ax1)
  2. Connect a Linux client, also with a MTU of 9000 to the corresponding port of the OPNsense firewall
  3. Perform a "ping -M do -s 8972 opnsense" from the Linux client to the OPNsense firewall
  4. See that pings won't be returned
  5. Perform a "ping -M do -s 4054 opnsense" from the Linux client to the OPNsense firewall
  6. See that pings will be returned
  7. Perform a "ping -M do -s 4055 opnsense" from the Linux client to the OPNsense firewall
  8. 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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.