# The legacy XOFF calculation method in mlx5 is outdated, new configuration methods and interfaces are required

**URL:** <https://forums.developer.nvidia.com/t/the-legacy-xoff-calculation-method-in-mlx5-is-outdated-new-configuration-methods-and-interfaces-are-required/370562>\
**Category:** Enterprise Networking\
**Tags:** kernel\
**Created:** [May 19, 2026, 4:02am UTC](https://forums.developer.nvidia.com/t/the-legacy-xoff-calculation-method-in-mlx5-is-outdated-new-configuration-methods-and-interfaces-are-required/370562 "2026-05-19T04:02:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gangxie112](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@gangxie112](https://forums.developer.nvidia.com/u/gangxie112)\
**Post date:** [May 19, 2026, 4:02am UTC](https://forums.developer.nvidia.com/t/the-legacy-xoff-calculation-method-in-mlx5-is-outdated-new-configuration-methods-and-interfaces-are-required/370562/1 "2026-05-19T04:02:43Z")

</div>

Hello,

Currently, in the mlx5 driver, XOFF thresholds are dynamically configured solely based on cable length. This approach is increasingly inapplicable in high-speed AI networking scenarios. Especially in GPU Direct RDMA deployments, larger headroom values and wider XOFF-XON hysteresis ranges are necessary to mitigate traffic jitter smoothly. Accordingly, the driver needs to expose dedicated interfaces for direct manual configuration of XOFF and XON parameters.

> /\* xoff = ((301+2.16 \* len [m]) \* speed [Gbps] + 2.72 MTU [B])
> 
> \* minimum speed value is 40Gbps
> 
> \*/
> 
> static u32 calculate\_xoff(struct mlx5e\_priv \*priv, unsigned int mtu)
> 
> {
> 
> ```
> u32 speed;
> 
> u32 xoff;
> 
> int err;
> 
> err = mlx5e_port_linkspeed(priv->mdev, &speed);
> 
> if (err)
> 
> speed = SPEED_40000;
> 
> speed = max_t(u32, speed, SPEED_40000);
> 
> xoff = (301 + 216 \* priv->dcbx.cable_len / 100) \* speed / 1000 + 272 \* mtu / 100;
> 
> netdev_dbg(priv->netdev, "%s: xoff=%d\\n", \__func_\_, xoff);
> 
> return xoff;
> 
> ```
> 
> }
