|
@@ -40,20 +40,6 @@ MODULE_PARM_DESC(debug, "NETIF_MSG debug bits");
|
|
|
|
|
|
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
|
|
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
|
|
|
|
|
|
-struct liquidio_if_cfg_context {
|
|
|
|
- int octeon_id;
|
|
|
|
-
|
|
|
|
- wait_queue_head_t wc;
|
|
|
|
-
|
|
|
|
- int cond;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-struct liquidio_if_cfg_resp {
|
|
|
|
- u64 rh;
|
|
|
|
- struct liquidio_if_cfg_info cfg_info;
|
|
|
|
- u64 status;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
struct liquidio_rx_ctl_context {
|
|
struct liquidio_rx_ctl_context {
|
|
int octeon_id;
|
|
int octeon_id;
|
|
|
|
|
|
@@ -564,8 +550,12 @@ static void octnet_link_status_change(struct work_struct *work)
|
|
struct cavium_wk *wk = (struct cavium_wk *)work;
|
|
struct cavium_wk *wk = (struct cavium_wk *)work;
|
|
struct lio *lio = (struct lio *)wk->ctxptr;
|
|
struct lio *lio = (struct lio *)wk->ctxptr;
|
|
|
|
|
|
|
|
+ /* lio->linfo.link.s.mtu always contains max MTU of the lio interface.
|
|
|
|
+ * this API is invoked only when new max-MTU of the interface is
|
|
|
|
+ * less than current MTU.
|
|
|
|
+ */
|
|
rtnl_lock();
|
|
rtnl_lock();
|
|
- call_netdevice_notifiers(NETDEV_CHANGEMTU, lio->netdev);
|
|
|
|
|
|
+ dev_set_mtu(lio->netdev, lio->linfo.link.s.mtu);
|
|
rtnl_unlock();
|
|
rtnl_unlock();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -613,6 +603,7 @@ static void update_link_status(struct net_device *netdev,
|
|
union oct_link_status *ls)
|
|
union oct_link_status *ls)
|
|
{
|
|
{
|
|
struct lio *lio = GET_LIO(netdev);
|
|
struct lio *lio = GET_LIO(netdev);
|
|
|
|
+ int current_max_mtu = lio->linfo.link.s.mtu;
|
|
struct octeon_device *oct = lio->oct_dev;
|
|
struct octeon_device *oct = lio->oct_dev;
|
|
|
|
|
|
if ((lio->intf_open) && (lio->linfo.link.u64 != ls->u64)) {
|
|
if ((lio->intf_open) && (lio->linfo.link.u64 != ls->u64)) {
|
|
@@ -629,18 +620,17 @@ static void update_link_status(struct net_device *netdev,
|
|
txqs_stop(netdev);
|
|
txqs_stop(netdev);
|
|
}
|
|
}
|
|
|
|
|
|
- if (lio->linfo.link.s.mtu != netdev->max_mtu) {
|
|
|
|
- dev_info(&oct->pci_dev->dev, "Max MTU Changed from %d to %d\n",
|
|
|
|
- netdev->max_mtu, lio->linfo.link.s.mtu);
|
|
|
|
|
|
+ if (lio->linfo.link.s.mtu != current_max_mtu) {
|
|
|
|
+ dev_info(&oct->pci_dev->dev,
|
|
|
|
+ "Max MTU Changed from %d to %d\n",
|
|
|
|
+ current_max_mtu, lio->linfo.link.s.mtu);
|
|
netdev->max_mtu = lio->linfo.link.s.mtu;
|
|
netdev->max_mtu = lio->linfo.link.s.mtu;
|
|
}
|
|
}
|
|
|
|
|
|
if (lio->linfo.link.s.mtu < netdev->mtu) {
|
|
if (lio->linfo.link.s.mtu < netdev->mtu) {
|
|
dev_warn(&oct->pci_dev->dev,
|
|
dev_warn(&oct->pci_dev->dev,
|
|
- "PF has changed the MTU for gmx port. Reducing the mtu from %d to %d\n",
|
|
|
|
|
|
+ "Current MTU is higher than new max MTU; Reducing the current mtu from %d to %d\n",
|
|
netdev->mtu, lio->linfo.link.s.mtu);
|
|
netdev->mtu, lio->linfo.link.s.mtu);
|
|
- lio->mtu = lio->linfo.link.s.mtu;
|
|
|
|
- netdev->mtu = lio->linfo.link.s.mtu;
|
|
|
|
queue_delayed_work(lio->link_status_wq.wq,
|
|
queue_delayed_work(lio->link_status_wq.wq,
|
|
&lio->link_status_wq.wk.work, 0);
|
|
&lio->link_status_wq.wk.work, 0);
|
|
}
|
|
}
|
|
@@ -1537,41 +1527,6 @@ static struct net_device_stats *liquidio_get_stats(struct net_device *netdev)
|
|
return stats;
|
|
return stats;
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- * \brief Net device change_mtu
|
|
|
|
- * @param netdev network device
|
|
|
|
- */
|
|
|
|
-static int liquidio_change_mtu(struct net_device *netdev, int new_mtu)
|
|
|
|
-{
|
|
|
|
- struct octnic_ctrl_pkt nctrl;
|
|
|
|
- struct octeon_device *oct;
|
|
|
|
- struct lio *lio;
|
|
|
|
- int ret = 0;
|
|
|
|
-
|
|
|
|
- lio = GET_LIO(netdev);
|
|
|
|
- oct = lio->oct_dev;
|
|
|
|
-
|
|
|
|
- memset(&nctrl, 0, sizeof(struct octnic_ctrl_pkt));
|
|
|
|
-
|
|
|
|
- nctrl.ncmd.u64 = 0;
|
|
|
|
- nctrl.ncmd.s.cmd = OCTNET_CMD_CHANGE_MTU;
|
|
|
|
- nctrl.ncmd.s.param1 = new_mtu;
|
|
|
|
- nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
|
|
|
|
- nctrl.wait_time = LIO_CMD_WAIT_TM;
|
|
|
|
- nctrl.netpndev = (u64)netdev;
|
|
|
|
- nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
|
|
|
|
-
|
|
|
|
- ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
|
|
|
|
- if (ret < 0) {
|
|
|
|
- dev_err(&oct->pci_dev->dev, "Failed to set MTU\n");
|
|
|
|
- return -EIO;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- lio->mtu = new_mtu;
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* \brief Handler for SIOCSHWTSTAMP ioctl
|
|
* \brief Handler for SIOCSHWTSTAMP ioctl
|
|
* @param netdev network device
|
|
* @param netdev network device
|