nvethernet: macsec: Add module param for macsec.

Add module parameter to enable/disable macsec.

By default macsec will be enabled and it can be disabled
with help of module parameter "macsec_enable"

Bug 4640382

Change-Id: I3b6ffde52a73760cd65f02abe472c3133996b698
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3156387
(cherry picked from commit f870a5f9fc)
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3138588
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Revanth Kumar Uppala
2024-05-15 16:55:40 +00:00
committed by mobile promotions
parent 6f80c397ed
commit 19e5f2fafa
2 changed files with 9 additions and 3 deletions

View File

@@ -7385,7 +7385,7 @@ static int ether_probe(struct platform_device *pdev)
goto err_macsec; goto err_macsec;
} else if (ret == 1) { } else if (ret == 1) {
/* Nothing to do, macsec is not supported */ /* Nothing to do, macsec is not supported */
dev_info(&pdev->dev, "Macsec not supported/Not enabled in DT\n"); dev_info(&pdev->dev, "Macsec not supported/Not enabled\n");
} else { } else {
dev_info(&pdev->dev, "Macsec not enabled\n"); dev_info(&pdev->dev, "Macsec not enabled\n");
/* Macsec is supported, reduce MTU */ /* Macsec is supported, reduce MTU */

View File

@@ -9,6 +9,11 @@
#ifdef HSI_SUPPORT #ifdef HSI_SUPPORT
#include <linux/tegra-epl.h> #include <linux/tegra-epl.h>
#endif #endif
static bool macsec_enable = true;
module_param(macsec_enable, bool, 0644);
MODULE_PARM_DESC(macsec_enable, "Enable Macsec for nvethernet module");
static int macsec_get_tx_next_pn(struct sk_buff *skb, struct genl_info *info); static int macsec_get_tx_next_pn(struct sk_buff *skb, struct genl_info *info);
#ifndef MACSEC_KEY_PROGRAM #ifndef MACSEC_KEY_PROGRAM
@@ -1379,9 +1384,10 @@ int macsec_probe(struct ether_priv_data *pdata)
/* Read if macsec is enabled in DT */ /* Read if macsec is enabled in DT */
ret = of_property_read_u32(np, "nvidia,macsec-enable", ret = of_property_read_u32(np, "nvidia,macsec-enable",
&macsec_pdata->is_macsec_enabled_in_dt); &macsec_pdata->is_macsec_enabled_in_dt);
if ((ret != 0) || (macsec_pdata->is_macsec_enabled_in_dt == 0U)) { if (ret != 0 || !macsec_enable ||
macsec_pdata->is_macsec_enabled_in_dt == 0U) {
dev_info(dev, dev_info(dev,
"macsec param in DT is missing or disabled\n"); "macsec parameter is missing or disabled\n");
ret = 1; ret = 1;
goto init_err; goto init_err;
} }