FreeBSD/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
/*
 * SW MTU does not include headers,
 * HW MTU includes all headers and checksums.
 */
SW MTU does not include headers,
HW MTU includes all headers and checksums.
SW MTU does not include headers HW MTU includes all headers and checksums .
static int
mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu)
{
	struct mlx5e_priv *priv = ifp->if_softc;
	struct mlx5_core_dev *mdev = priv->mdev;
	int hw_mtu;
	int err;
	err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu));
	if (err) {
		if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n",
		    __func__, sw_mtu, err);
		return (err);
	}
	err = mlx5_query_port_oper_mtu(mdev, &hw_mtu);
	if (!err) {
		ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu);
		if (ifp->if_mtu != sw_mtu) {
			if_printf(ifp, "Port MTU %d is different than "
			    "ifp mtu %d\n", sw_mtu, (int)ifp->if_mtu);
		}
	} else {
		if_printf(ifp, "Query port MTU, after setting new "
		    "MTU value, failed\n");
		ifp->if_mtu = sw_mtu;
	}
	return (0);
}
static int mlx5e_set_dev_port_mtu ( struct ifnet * ifp , int sw_mtu ) { struct mlx5e_priv * priv = ifp -> if_softc ; struct mlx5_core_dev * mdev = priv -> mdev ; int hw_mtu ; int err ; err = mlx5_set_port_mtu ( mdev , MLX5E_SW2HW_MTU ( sw_mtu ) ) ; if ( err ) { if_printf ( ifp , " \n " , __func__ , sw_mtu , err ) ; return ( err ) ; } err = mlx5_query_port_oper_mtu ( mdev , & hw_mtu ) ; if ( ! err ) { ifp -> if_mtu = MLX5E_HW2SW_MTU ( hw_mtu ) ; if ( ifp -> if_mtu != sw_mtu ) { if_printf ( ifp , " " " \n " , sw_mtu , ( int ) ifp -> if_mtu ) ; } } else { if_printf ( ifp , " " " \n " ) ; ifp -> if_mtu = sw_mtu ; } return ( 0 ) ; }
SW MTU does not include headers,
 HW MTU includes all headers and checksums.
SW MTU does not include headers HW MTU includes all headers and checksums .