nvethernet: Check for HW MTU support

Issue:
When the ethernet server got enabled
MTU changes are not getting communicated
to the ethernet server.

Fix:
Call OSI IOCTL to update MTU change
to ethernet server.

Bug 3402313

Change-Id: I1ac0768cb16dc2fe4e6f78be3703c27208a47855
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2610187
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mohan Thadikamalla
2021-10-13 20:46:47 +05:30
committed by Revanth Kumar Uppala
parent 4612ee1b1e
commit a54d1536bd

View File

@@ -3762,6 +3762,8 @@ static int ether_change_mtu(struct net_device *ndev, int new_mtu)
struct ether_priv_data *pdata = netdev_priv(ndev);
struct osi_core_priv_data *osi_core = pdata->osi_core;
struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
struct osi_ioctl ioctl_data = {};
int ret = 0;
if (netif_running(ndev)) {
netdev_err(pdata->ndev, "must be stopped to change its MTU\n");
@@ -3777,6 +3779,15 @@ static int ether_change_mtu(struct net_device *ndev, int new_mtu)
return -EINVAL;
}
ioctl_data.cmd = OSI_CMD_MAC_MTU;
ioctl_data.arg1_u32 = new_mtu;
ret = osi_handle_ioctl(osi_core, &ioctl_data);
if (ret < 0) {
dev_info(pdata->dev, "HW Fail to set MTU to %d\n",
new_mtu);
return -EINVAL;
}
ndev->mtu = new_mtu;
osi_core->mtu = new_mtu;
osi_dma->mtu = new_mtu;