Date: Thu, 16 May 2019 15:58:38 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347733 - stable/12/sys/dev/mlx5/mlx5_core Message-ID: <201905161558.x4GFwcQV052496@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu May 16 15:58:37 2019 New Revision: 347733 URL: https://svnweb.freebsd.org/changeset/base/347733 Log: MFC r347269: Add sysctl(8) to control fast unload support in mlx5core. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu May 16 15:57:59 2019 (r347732) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu May 16 15:58:37 2019 (r347733) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2019, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -68,6 +68,11 @@ MODULE_PARM_DESC(prof_sel, "profile selector. Valid ra SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW, 0, "mlx5 HW controls"); +static int mlx5_fast_unload_enabled = 1; +SYSCTL_INT(_hw_mlx5, OID_AUTO, fast_unload_enabled, CTLFLAG_RWTUN, + &mlx5_fast_unload_enabled, 0, + "Set to enable fast unload. Clear to disable."); + #define NUMA_NO_NODE -1 static LIST_HEAD(intf_list); @@ -1417,6 +1422,11 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev * { bool fast_teardown, force_teardown; int err; + + if (!mlx5_fast_unload_enabled) { + mlx5_core_dbg(dev, "fast unload is disabled by user\n"); + return -EOPNOTSUPP; + } fast_teardown = MLX5_CAP_GEN(dev, fast_teardown); force_teardown = MLX5_CAP_GEN(dev, force_teardown);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161558.x4GFwcQV052496>