|
@@ -2365,11 +2365,14 @@ void liquidio_link_ctrl_cmd_completion(void *nctrl_ptr)
|
|
case OCTNET_CMD_CHANGE_MTU:
|
|
case OCTNET_CMD_CHANGE_MTU:
|
|
/* If command is successful, change the MTU. */
|
|
/* If command is successful, change the MTU. */
|
|
netif_info(lio, probe, lio->netdev, " MTU Changed from %d to %d\n",
|
|
netif_info(lio, probe, lio->netdev, " MTU Changed from %d to %d\n",
|
|
- netdev->mtu, nctrl->ncmd.s.param2);
|
|
|
|
|
|
+ netdev->mtu, nctrl->ncmd.s.param1);
|
|
dev_info(&oct->pci_dev->dev, "%s MTU Changed from %d to %d\n",
|
|
dev_info(&oct->pci_dev->dev, "%s MTU Changed from %d to %d\n",
|
|
netdev->name, netdev->mtu,
|
|
netdev->name, netdev->mtu,
|
|
- nctrl->ncmd.s.param2);
|
|
|
|
- netdev->mtu = nctrl->ncmd.s.param2;
|
|
|
|
|
|
+ nctrl->ncmd.s.param1);
|
|
|
|
+ rtnl_lock();
|
|
|
|
+ netdev->mtu = nctrl->ncmd.s.param1;
|
|
|
|
+ call_netdevice_notifiers(NETDEV_CHANGEMTU, netdev);
|
|
|
|
+ rtnl_unlock();
|
|
break;
|
|
break;
|
|
|
|
|
|
case OCTNET_CMD_GPIO_ACCESS:
|
|
case OCTNET_CMD_GPIO_ACCESS:
|
|
@@ -2657,18 +2660,16 @@ static int liquidio_change_mtu(struct net_device *netdev, int new_mtu)
|
|
struct lio *lio = GET_LIO(netdev);
|
|
struct lio *lio = GET_LIO(netdev);
|
|
struct octeon_device *oct = lio->oct_dev;
|
|
struct octeon_device *oct = lio->oct_dev;
|
|
struct octnic_ctrl_pkt nctrl;
|
|
struct octnic_ctrl_pkt nctrl;
|
|
- int max_frm_size = new_mtu + OCTNET_FRM_HEADER_SIZE;
|
|
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
- /* Limit the MTU to make sure the ethernet packets are between 64 bytes
|
|
|
|
- * and 65535 bytes
|
|
|
|
|
|
+ /* Limit the MTU to make sure the ethernet packets are between 68 bytes
|
|
|
|
+ * and 16000 bytes
|
|
*/
|
|
*/
|
|
- if ((max_frm_size < OCTNET_MIN_FRM_SIZE) ||
|
|
|
|
- (max_frm_size > OCTNET_MAX_FRM_SIZE)) {
|
|
|
|
|
|
+ if ((new_mtu < LIO_MIN_MTU_SIZE) ||
|
|
|
|
+ (new_mtu > LIO_MAX_MTU_SIZE)) {
|
|
dev_err(&oct->pci_dev->dev, "Invalid MTU: %d\n", new_mtu);
|
|
dev_err(&oct->pci_dev->dev, "Invalid MTU: %d\n", new_mtu);
|
|
dev_err(&oct->pci_dev->dev, "Valid range %d and %d\n",
|
|
dev_err(&oct->pci_dev->dev, "Valid range %d and %d\n",
|
|
- (OCTNET_MIN_FRM_SIZE - OCTNET_FRM_HEADER_SIZE),
|
|
|
|
- (OCTNET_MAX_FRM_SIZE - OCTNET_FRM_HEADER_SIZE));
|
|
|
|
|
|
+ LIO_MIN_MTU_SIZE, LIO_MAX_MTU_SIZE);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|