mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
nvethernet: move err injec code to vltest
issue: HSI error injection logic is enabled by default and is exposed as an ioctl which is a safety-related concern. fix: move HSI error injection code only for VLTEST build Jira NET-1235 Bug 4449611 Bug 4910958 Signed-off-by: Narayan Reddy <narayanr@nvidia.com> Change-Id: I4a15a40807466693ce673a3b9b00f51c077f2bd8 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3078250 (cherry picked from commit e01c63215d861b6de8f4a26596a4e5e9450878a3) Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292992 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
00761e184e
commit
b03396851a
@@ -59,5 +59,9 @@ nvethernet-objs:= ether_linux.o \
|
|||||||
|
|
||||||
include $(srctree.nvidia-oot)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/config.tmk
|
include $(srctree.nvidia-oot)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/config.tmk
|
||||||
|
|
||||||
|
ifeq ($(NV_BUILD_CONFIGURATION_IS_VLTEST),1)
|
||||||
|
ccflags-y += -DNV_VLTEST_BUILD
|
||||||
|
endif
|
||||||
|
|
||||||
# Undefine HSI_SUPPORT if CONFIG_TEGRA_EPL is not defined.
|
# Undefine HSI_SUPPORT if CONFIG_TEGRA_EPL is not defined.
|
||||||
ccflags-y += $(if $(CONFIG_TEGRA_EPL),,-UHSI_SUPPORT)
|
ccflags-y += $(if $(CONFIG_TEGRA_EPL),,-UHSI_SUPPORT)
|
||||||
|
|||||||
@@ -2543,8 +2543,7 @@ static DEVICE_ATTR(nvgro_dump, 0644,
|
|||||||
ether_nvgro_dump_show, NULL);
|
ether_nvgro_dump_show, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HSI_SUPPORT
|
#if defined HSI_SUPPORT && defined(NV_VLTEST_BUILD) && (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
||||||
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
|
||||||
static int hsi_inject_err_fsi(unsigned int inst_id,
|
static int hsi_inject_err_fsi(unsigned int inst_id,
|
||||||
struct epl_error_report_frame error_report,
|
struct epl_error_report_frame error_report,
|
||||||
void *data)
|
void *data)
|
||||||
@@ -2562,7 +2561,6 @@ static int hsi_inject_err_fsi(unsigned int inst_id,
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Shows HSI feature enabled status
|
* @brief Shows HSI feature enabled status
|
||||||
@@ -2611,10 +2609,8 @@ static ssize_t hsi_enable_store(struct device *dev,
|
|||||||
struct osi_core_priv_data *osi_core = pdata->osi_core;
|
struct osi_core_priv_data *osi_core = pdata->osi_core;
|
||||||
struct osi_ioctl ioctl_data = {};
|
struct osi_ioctl ioctl_data = {};
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
|
||||||
u32 inst_id = osi_core->instance_id;
|
u32 inst_id = osi_core->instance_id;
|
||||||
u32 ip_type[2] = {IP_EQOS, IP_MGBE};
|
u32 ip_type[2] = {IP_EQOS, IP_MGBE};
|
||||||
#endif
|
|
||||||
|
|
||||||
if (osi_core->use_virtualization == OSI_ENABLE) {
|
if (osi_core->use_virtualization == OSI_ENABLE) {
|
||||||
dev_err(pdata->dev, "Not supported with Ethernet virtualization enabled\n");
|
dev_err(pdata->dev, "Not supported with Ethernet virtualization enabled\n");
|
||||||
@@ -2636,7 +2632,6 @@ static ssize_t hsi_enable_store(struct device *dev,
|
|||||||
} else {
|
} else {
|
||||||
osi_core->hsi.enabled = OSI_ENABLE;
|
osi_core->hsi.enabled = OSI_ENABLE;
|
||||||
dev_info(pdata->dev, "HSI Enabled\n");
|
dev_info(pdata->dev, "HSI Enabled\n");
|
||||||
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
|
||||||
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
||||||
inst_id = 0;
|
inst_id = 0;
|
||||||
|
|
||||||
@@ -2646,7 +2641,6 @@ static ssize_t hsi_enable_store(struct device *dev,
|
|||||||
dev_err(pdata->dev, "Err inj callback registration failed: %d",
|
dev_err(pdata->dev, "Err inj callback registration failed: %d",
|
||||||
ret);
|
ret);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} else if (strncmp(buf, "disable", 7) == OSI_NONE) {
|
} else if (strncmp(buf, "disable", 7) == OSI_NONE) {
|
||||||
ioctl_data.arg1_u32 = OSI_DISABLE;
|
ioctl_data.arg1_u32 = OSI_DISABLE;
|
||||||
@@ -2657,7 +2651,6 @@ static ssize_t hsi_enable_store(struct device *dev,
|
|||||||
} else {
|
} else {
|
||||||
osi_core->hsi.enabled = OSI_DISABLE;
|
osi_core->hsi.enabled = OSI_DISABLE;
|
||||||
dev_info(pdata->dev, "HSI Disabled\n");
|
dev_info(pdata->dev, "HSI Disabled\n");
|
||||||
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
|
||||||
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
||||||
inst_id = 0;
|
inst_id = 0;
|
||||||
|
|
||||||
@@ -2666,7 +2659,6 @@ static ssize_t hsi_enable_store(struct device *dev,
|
|||||||
dev_err(pdata->dev, "Err inj callback deregistration failed: %d",
|
dev_err(pdata->dev, "Err inj callback deregistration failed: %d",
|
||||||
ret);
|
ret);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dev_err(pdata->dev,
|
dev_err(pdata->dev,
|
||||||
@@ -2728,7 +2720,7 @@ static struct attribute *ether_sysfs_attrs[] = {
|
|||||||
&dev_attr_nvgro_stats.attr,
|
&dev_attr_nvgro_stats.attr,
|
||||||
&dev_attr_nvgro_dump.attr,
|
&dev_attr_nvgro_dump.attr,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HSI_SUPPORT
|
#if defined HSI_SUPPORT && defined(NV_VLTEST_BUILD) && (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
||||||
&dev_attr_hsi_enable.attr,
|
&dev_attr_hsi_enable.attr,
|
||||||
#endif
|
#endif
|
||||||
#endif /* OSI_STRIPPED_LIB */
|
#endif /* OSI_STRIPPED_LIB */
|
||||||
@@ -2756,7 +2748,7 @@ static struct attribute *ether_sysfs_attrs_without_macsec[] = {
|
|||||||
&dev_attr_nvgro_dump.attr,
|
&dev_attr_nvgro_dump.attr,
|
||||||
#endif
|
#endif
|
||||||
#endif /* OSI_STRIPPED_LIB */
|
#endif /* OSI_STRIPPED_LIB */
|
||||||
#ifdef HSI_SUPPORT
|
#if defined HSI_SUPPORT && defined(NV_VLTEST_BUILD) && (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
||||||
&dev_attr_hsi_enable.attr,
|
&dev_attr_hsi_enable.attr,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
|
|||||||
Reference in New Issue
Block a user