nvethernet: add interface to configure debug interrupt

Add ioctl ETHER_DEBUG_INTR_CONFIG to enable and disable
debug related interrupt at runtime

Bug 3600647
Change-Id: Ie22a7decc1bd2feb90126841a8d8a0eaafa7dc66
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2703340
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Om Prakash Singh
2022-04-27 08:13:55 +05:30
committed by Revanth Kumar Uppala
parent ef1378ba02
commit fc25e06026
2 changed files with 45 additions and 1 deletions

View File

@@ -1157,6 +1157,44 @@ static int ether_config_fpe(struct net_device *dev,
return ret;
}
#ifdef OSI_DEBUG
/**
* @brief handle ETHER_DEBUG_INTR_CONFIG ioctl
*
* Algorithm:
* - Call OSI_DMA_DEBUG_INTR_CONFIG to enable/disable debug interrupt
* - Call OSI_CMD_DEBUG_INTR_CONFIG to enable/disable debug interrupt
*
* @param[in] ndev: network device structure
* @param[in] ifdata: interface private data structure
*
* @note Ethernet interface need to be up.
*
* @retval 0 on Success
* @retval "nagative value" on Failure
*/
static int ether_debug_intr_config(struct net_device *ndev,
struct ether_ifr_data *ifdata)
{
struct ether_priv_data *pdata = netdev_priv(ndev);
struct osi_core_priv_data *osi_core = pdata->osi_core;
struct osi_ioctl ioctl_data = {};
struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
unsigned int enable = ifdata->if_flags;
int ret = -1;
osi_dma->ioctl_data.cmd = OSI_DMA_IOCTL_CMD_DEBUG_INTR_CONFIG;
osi_dma->ioctl_data.arg_u32 = enable;
ret = osi_dma_ioctl(osi_dma);
if (ret < 0)
return ret;
ioctl_data.cmd = OSI_CMD_DEBUG_INTR_CONFIG;
ioctl_data.arg1_u32 = enable;
return osi_handle_ioctl(osi_core, &ioctl_data);
}
#endif
/**
* @brief ether_priv_ioctl - Handle private IOCTLs
*
@@ -1347,6 +1385,9 @@ int ether_handle_priv_ioctl(struct net_device *ndev,
ioctl_data.cmd = OSI_CMD_STRUCTS_DUMP;
ret = osi_handle_ioctl(pdata->osi_core, &ioctl_data);
break;
case ETHER_DEBUG_INTR_CONFIG:
ret = ether_debug_intr_config(ndev, &ifdata);
break;
#endif
case ETHER_CAP_TSC_PTP:
ret = ether_get_tsc_ptp_cap(ndev, &ifdata);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -79,6 +79,9 @@
#endif /* OSI_DEBUG */
#define ETHER_CAP_TSC_PTP 58
#define ETHER_M2M_TSYNC 59
#ifdef OSI_DEBUG
#define ETHER_DEBUG_INTR_CONFIG 60
#endif
/** @} */