nvethernet: change MTU only if DEBUG_MACSEC enable

Bug 200730979

Change-Id: I87cfdff095a2c4ce34362adc538e8311b1ece844
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2537482
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
This commit is contained in:
Bhadram Varka
2021-05-31 19:17:44 +05:30
committed by Revanth Kumar Uppala
parent 975e946c85
commit 3e4fa7b56a

View File

@@ -3384,6 +3384,7 @@ static int ether_change_mtu(struct net_device *ndev, int new_mtu)
osi_dma->mtu = new_mtu;
#ifdef MACSEC_SUPPORT
#ifdef DEBUG_MACSEC
/* Macsec is enabled, reduce MTU
*/
osi_core->mtu -= MACSEC_TAG_ICV_LEN;
@@ -3391,6 +3392,7 @@ static int ether_change_mtu(struct net_device *ndev, int new_mtu)
ndev->mtu = osi_core->mtu;
netdev_info(pdata->ndev, "Macsec: Reduced MTU: %d Max: %d\n",
ndev->mtu, ndev->max_mtu);
#endif /* DEBUG_MACSEC */
#endif /* MACSEC_SUPPORT */
netdev_update_features(ndev);
@@ -5566,6 +5568,7 @@ static int ether_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "Macsec not enabled - ignore\n");
}
#ifdef DEBUG_MACSEC
/* Macsec is enabled, reduce MTU
*/
osi_core->mtu -= MACSEC_TAG_ICV_LEN;
@@ -5573,6 +5576,7 @@ static int ether_probe(struct platform_device *pdev)
ndev->mtu = osi_core->mtu;
dev_info(&pdev->dev, "Macsec: Reduced MTU: %d Max: %d\n",
ndev->mtu, ndev->max_mtu);
#endif /* DEBUG_MACSEC */
#endif /* MACSEC_SUPPORT */
ret = register_netdev(ndev);