xref: /freebsd/sys/dev/ice/ice_common_sysctls.h (revision 015f8cc5b0c10336a048f37a7071ea03516de242)
171d10453SEric Joyner /* SPDX-License-Identifier: BSD-3-Clause */
2*015f8cc5SEric Joyner /*  Copyright (c) 2024, Intel Corporation
371d10453SEric Joyner  *  All rights reserved.
471d10453SEric Joyner  *
571d10453SEric Joyner  *  Redistribution and use in source and binary forms, with or without
671d10453SEric Joyner  *  modification, are permitted provided that the following conditions are met:
771d10453SEric Joyner  *
871d10453SEric Joyner  *   1. Redistributions of source code must retain the above copyright notice,
971d10453SEric Joyner  *      this list of conditions and the following disclaimer.
1071d10453SEric Joyner  *
1171d10453SEric Joyner  *   2. Redistributions in binary form must reproduce the above copyright
1271d10453SEric Joyner  *      notice, this list of conditions and the following disclaimer in the
1371d10453SEric Joyner  *      documentation and/or other materials provided with the distribution.
1471d10453SEric Joyner  *
1571d10453SEric Joyner  *   3. Neither the name of the Intel Corporation nor the names of its
1671d10453SEric Joyner  *      contributors may be used to endorse or promote products derived from
1771d10453SEric Joyner  *      this software without specific prior written permission.
1871d10453SEric Joyner  *
1971d10453SEric Joyner  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2071d10453SEric Joyner  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2171d10453SEric Joyner  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2271d10453SEric Joyner  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2371d10453SEric Joyner  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2471d10453SEric Joyner  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2571d10453SEric Joyner  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2671d10453SEric Joyner  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2771d10453SEric Joyner  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2871d10453SEric Joyner  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2971d10453SEric Joyner  *  POSSIBILITY OF SUCH DAMAGE.
3071d10453SEric Joyner  */
3171d10453SEric Joyner 
3271d10453SEric Joyner /**
3371d10453SEric Joyner  * @file ice_common_sysctls.h
3471d10453SEric Joyner  * @brief driver wide sysctls not related to the iflib stack
3571d10453SEric Joyner  *
3671d10453SEric Joyner  * Contains static sysctl values which are driver wide and configure all
3771d10453SEric Joyner  * devices of the driver at once.
3871d10453SEric Joyner  *
3971d10453SEric Joyner  * Device specific sysctls are setup by functions in ice_lib.c
4071d10453SEric Joyner  */
4171d10453SEric Joyner 
4271d10453SEric Joyner #ifndef _ICE_COMMON_SYSCTLS_H_
4371d10453SEric Joyner #define _ICE_COMMON_SYSCTLS_H_
4471d10453SEric Joyner 
4571d10453SEric Joyner #include <sys/sysctl.h>
4671d10453SEric Joyner 
4771d10453SEric Joyner /**
488a13362dSEric Joyner  * @var ice_enable_irdma
498a13362dSEric Joyner  * @brief boolean indicating if the iRDMA client interface is enabled
508a13362dSEric Joyner  *
518a13362dSEric Joyner  * Global sysctl variable indicating whether the RDMA client interface feature
528a13362dSEric Joyner  * is enabled.
538a13362dSEric Joyner  */
548a13362dSEric Joyner bool ice_enable_irdma = true;
558a13362dSEric Joyner 
568a13362dSEric Joyner /**
5771d10453SEric Joyner  * @var ice_enable_tx_fc_filter
5871d10453SEric Joyner  * @brief boolean indicating if the Tx Flow Control filter should be enabled
5971d10453SEric Joyner  *
6071d10453SEric Joyner  * Global sysctl variable indicating whether the Tx Flow Control filters
6171d10453SEric Joyner  * should be enabled. If true, Ethertype 0x8808 packets will be dropped if
6271d10453SEric Joyner  * they come from non-HW sources. If false, packets coming from software will
6371d10453SEric Joyner  * not be dropped. Leave this on if unless you must send flow control frames
6471d10453SEric Joyner  * (or other control frames) from software.
6571d10453SEric Joyner  *
6671d10453SEric Joyner  * @remark each PF has a separate sysctl which can override this value.
6771d10453SEric Joyner  */
6871d10453SEric Joyner bool ice_enable_tx_fc_filter = true;
6971d10453SEric Joyner 
7071d10453SEric Joyner /**
7171d10453SEric Joyner  * @var ice_enable_tx_lldp_filter
7271d10453SEric Joyner  * @brief boolean indicating if the Tx LLDP filter should be enabled
7371d10453SEric Joyner  *
7471d10453SEric Joyner  * Global sysctl variable indicating whether the Tx Flow Control filters
7571d10453SEric Joyner  * should be enabled. If true, Ethertype 0x88cc packets will be dropped if
7671d10453SEric Joyner  * they come from non-HW sources. If false, packets coming from software will
7771d10453SEric Joyner  * not be dropped. Leave this on if unless you must send LLDP frames from
7871d10453SEric Joyner  * software.
7971d10453SEric Joyner  *
8071d10453SEric Joyner  * @remark each PF has a separate sysctl which can override this value.
8171d10453SEric Joyner  */
8271d10453SEric Joyner bool ice_enable_tx_lldp_filter = true;
8371d10453SEric Joyner 
849cf1841cSEric Joyner /**
859cf1841cSEric Joyner  * @var ice_enable_health_events
869cf1841cSEric Joyner  * @brief boolean indicating if health status events from the FW should be reported
879cf1841cSEric Joyner  *
889cf1841cSEric Joyner  * Global sysctl variable indicating whether the Health Status events from the
899cf1841cSEric Joyner  * FW should be enabled. If true, if an event occurs, the driver will print out
909cf1841cSEric Joyner  * a message with a description of the event and possible actions to take.
919cf1841cSEric Joyner  *
929cf1841cSEric Joyner  * @remark each PF has a separate sysctl which can override this value.
939cf1841cSEric Joyner  */
949cf1841cSEric Joyner bool ice_enable_health_events = true;
959cf1841cSEric Joyner 
968a13362dSEric Joyner /**
978923de59SPiotr Kubaj  * @var ice_tx_balance_en
988923de59SPiotr Kubaj  * @brief boolean permitting the 5-layer scheduler topology enablement
998923de59SPiotr Kubaj  *
1008923de59SPiotr Kubaj  * Global sysctl variable indicating whether the driver will allow the
1018923de59SPiotr Kubaj  * 5-layer scheduler topology feature to be enabled. It's _not_
1028923de59SPiotr Kubaj  * specifically enabling the feature, just allowing it depending on what
1038923de59SPiotr Kubaj  * the DDP package allows.
1048923de59SPiotr Kubaj  */
1058923de59SPiotr Kubaj bool ice_tx_balance_en = true;
1068923de59SPiotr Kubaj 
1078923de59SPiotr Kubaj /**
1088a13362dSEric Joyner  * @var ice_rdma_max_msix
1098a13362dSEric Joyner  * @brief maximum number of MSI-X vectors to reserve for RDMA interface
1108a13362dSEric Joyner  *
1118a13362dSEric Joyner  * Global sysctl variable indicating the maximum number of MSI-X vectors to
1128a13362dSEric Joyner  * reserve for a single RDMA interface.
1138a13362dSEric Joyner  */
1148a13362dSEric Joyner static uint16_t ice_rdma_max_msix = ICE_RDMA_MAX_MSIX;
1158a13362dSEric Joyner 
11671d10453SEric Joyner /* sysctls marked as tunable, (i.e. with the CTLFLAG_TUN set) will
11771d10453SEric Joyner  * automatically load tunable values, without the need to manually create the
11871d10453SEric Joyner  * TUNABLE definition.
11971d10453SEric Joyner  *
12071d10453SEric Joyner  * This works since at least FreeBSD 11, and was backported into FreeBSD 10
12171d10453SEric Joyner  * before the FreeBSD 10.1-RELEASE.
12271d10453SEric Joyner  *
12371d10453SEric Joyner  * If the tunable needs a custom loader, mark the SYSCTL as CTLFLAG_NOFETCH,
12471d10453SEric Joyner  * and create the tunable manually.
12571d10453SEric Joyner  */
12671d10453SEric Joyner 
12771d10453SEric Joyner static SYSCTL_NODE(_hw, OID_AUTO, ice, CTLFLAG_RD, 0, "ICE driver parameters");
12871d10453SEric Joyner 
12971d10453SEric Joyner static SYSCTL_NODE(_hw_ice, OID_AUTO, debug, ICE_CTLFLAG_DEBUG | CTLFLAG_RD, 0,
13071d10453SEric Joyner 		   "ICE driver debug parameters");
13171d10453SEric Joyner 
1329cf1841cSEric Joyner SYSCTL_BOOL(_hw_ice, OID_AUTO, enable_health_events, CTLFLAG_RDTUN,
1339cf1841cSEric Joyner 	    &ice_enable_health_events, 0,
1349cf1841cSEric Joyner 	    "Enable FW health event reporting globally");
1359cf1841cSEric Joyner 
1368a13362dSEric Joyner SYSCTL_BOOL(_hw_ice, OID_AUTO, irdma, CTLFLAG_RDTUN, &ice_enable_irdma, 0,
1378a13362dSEric Joyner 	    "Enable iRDMA client interface");
1388a13362dSEric Joyner 
1398a13362dSEric Joyner SYSCTL_U16(_hw_ice, OID_AUTO, rdma_max_msix, CTLFLAG_RDTUN, &ice_rdma_max_msix,
1408a13362dSEric Joyner 	   0, "Maximum number of MSI-X vectors to reserve per RDMA interface");
1418a13362dSEric Joyner 
14271d10453SEric Joyner SYSCTL_BOOL(_hw_ice_debug, OID_AUTO, enable_tx_fc_filter, CTLFLAG_RDTUN,
14371d10453SEric Joyner 	    &ice_enable_tx_fc_filter, 0,
14471d10453SEric Joyner 	    "Drop Ethertype 0x8808 control frames originating from non-HW sources");
14571d10453SEric Joyner 
14671d10453SEric Joyner SYSCTL_BOOL(_hw_ice_debug, OID_AUTO, enable_tx_lldp_filter, CTLFLAG_RDTUN,
14771d10453SEric Joyner 	    &ice_enable_tx_lldp_filter, 0,
14871d10453SEric Joyner 	    "Drop Ethertype 0x88cc LLDP frames originating from non-HW sources");
14971d10453SEric Joyner 
1508923de59SPiotr Kubaj SYSCTL_BOOL(_hw_ice_debug, OID_AUTO, tx_balance_en, CTLFLAG_RWTUN,
1518923de59SPiotr Kubaj 	    &ice_tx_balance_en, 0,
1528923de59SPiotr Kubaj 	    "Enable 5-layer scheduler topology");
1538923de59SPiotr Kubaj 
15471d10453SEric Joyner #endif /* _ICE_COMMON_SYSCTLS_H_ */
155