On Thu, 11 Sep 2025 23:17:52 -0700
Dimon Zhao <dimon.z...@nebula-matrix.com> wrote:

> +int nbl_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)
> +{
> +     struct rte_eth_dev_data *dev_data = eth_dev->data;
> +     struct nbl_adapter *adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev);
> +     struct nbl_dev_mgt *dev_mgt = NBL_ADAPTER_TO_DEV_MGT(adapter);
> +     struct nbl_dispatch_ops *disp_ops = NBL_DEV_MGT_TO_DISP_OPS(dev_mgt);
> +     uint32_t frame_size = mtu + NBL_ETH_OVERHEAD;
> +     int ret;
> +
> +     /* check if mtu is within the allowed range */
> +     if (mtu < RTE_ETHER_MIN_MTU || frame_size > NBL_FRAME_SIZE_MAX)
> +             return -EINVAL;
> +

Those checks are unnecessary. The code for set_mtu in ethdev already
calls info_get and does the same validation.

Reply via email to