Date: Wed, 8 May 2019 10:38:31 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347269 - head/sys/dev/mlx5/mlx5_core Message-ID: <201905081038.x48AcVNH045474@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed May 8 10:38:31 2019 New Revision: 347269 URL: https://svnweb.freebsd.org/changeset/base/347269 Log: Add sysctl(8) to control fast unload support in mlx5core. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:38:06 2019 (r347268) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:38:31 2019 (r347269) @@ -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?201905081038.x48AcVNH045474>