Skip to content

Commit 251564f

Browse files
Veerasenareddy Burrudavem330
authored andcommitted
liquidio: update VF's netdev->max_mtu if there's a change in PF's MTU
A VF's MTU is capped at the parent PF's MTU. So if there's a change in the PF's MTU, then update the VF's netdev->max_mtu. Also remove duplicate log messages for MTU change. Signed-off-by: Veerasenareddy Burru <[email protected]> Signed-off-by: Raghu Vatsavayi <[email protected]> Signed-off-by: Felix Manlunas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5022111 commit 251564f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/net/ethernet/cavium/liquidio/lio_core.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ void liquidio_link_ctrl_cmd_completion(void *nctrl_ptr)
165165
/* If command is successful, change the MTU. */
166166
netif_info(lio, probe, lio->netdev, "MTU Changed from %d to %d\n",
167167
netdev->mtu, nctrl->ncmd.s.param1);
168-
dev_info(&oct->pci_dev->dev, "%s MTU Changed from %d to %d\n",
169-
netdev->name, netdev->mtu,
170-
nctrl->ncmd.s.param1);
171168
netdev->mtu = nctrl->ncmd.s.param1;
172169
queue_delayed_work(lio->link_status_wq.wq,
173170
&lio->link_status_wq.wk.work, 0);

drivers/net/ethernet/cavium/liquidio/lio_vf_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@ static void update_link_status(struct net_device *netdev,
630630
txqs_stop(netdev);
631631
}
632632

633+
if (lio->linfo.link.s.mtu != netdev->max_mtu) {
634+
dev_info(&oct->pci_dev->dev, "Max MTU Changed from %d to %d\n",
635+
netdev->max_mtu, lio->linfo.link.s.mtu);
636+
netdev->max_mtu = lio->linfo.link.s.mtu;
637+
}
638+
633639
if (lio->linfo.link.s.mtu < netdev->mtu) {
634640
dev_warn(&oct->pci_dev->dev,
635641
"PF has changed the MTU for gmx port. Reducing the mtu from %d to %d\n",
@@ -1539,14 +1545,11 @@ static struct net_device_stats *liquidio_get_stats(struct net_device *netdev)
15391545
static int liquidio_change_mtu(struct net_device *netdev, int new_mtu)
15401546
{
15411547
struct lio *lio = GET_LIO(netdev);
1542-
struct octeon_device *oct = lio->oct_dev;
15431548

15441549
lio->mtu = new_mtu;
15451550

15461551
netif_info(lio, probe, lio->netdev, "MTU Changed from %d to %d\n",
15471552
netdev->mtu, new_mtu);
1548-
dev_info(&oct->pci_dev->dev, "%s MTU Changed from %d to %d\n",
1549-
netdev->name, netdev->mtu, new_mtu);
15501553

15511554
netdev->mtu = new_mtu;
15521555

0 commit comments

Comments
 (0)