Skip to content

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

@kupferk

Description

@kupferk

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)

Metadata

Metadata

Assignees

Labels

featureAdding new functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions