Lines Matching refs:lio

263 	struct lio *lio = GET_LIO(netdev);  in print_link_info()  local
265 if (!ifstate_check(lio, LIO_IFSTATE_RESETTING) && in print_link_info()
266 ifstate_check(lio, LIO_IFSTATE_REGISTERED)) { in print_link_info()
267 struct oct_link_info *linfo = &lio->linfo; in print_link_info()
270 netif_info(lio, link, lio->netdev, "%d Mbps %s Duplex UP\n", in print_link_info()
274 netif_info(lio, link, lio->netdev, "Link Down\n"); in print_link_info()
286 struct lio *lio = (struct lio *)wk->ctxptr; in octnet_link_status_change() local
293 dev_set_mtu(lio->netdev, lio->linfo.link.s.mtu); in octnet_link_status_change()
303 struct lio *lio = GET_LIO(netdev); in setup_link_status_change_wq() local
304 struct octeon_device *oct = lio->oct_dev; in setup_link_status_change_wq()
306 lio->link_status_wq.wq = alloc_workqueue("link-status", in setup_link_status_change_wq()
308 if (!lio->link_status_wq.wq) { in setup_link_status_change_wq()
312 INIT_DELAYED_WORK(&lio->link_status_wq.wk.work, in setup_link_status_change_wq()
314 lio->link_status_wq.wk.ctxptr = lio; in setup_link_status_change_wq()
321 struct lio *lio = GET_LIO(netdev); in cleanup_link_status_change_wq() local
323 if (lio->link_status_wq.wq) { in cleanup_link_status_change_wq()
324 cancel_delayed_work_sync(&lio->link_status_wq.wk.work); in cleanup_link_status_change_wq()
325 destroy_workqueue(lio->link_status_wq.wq); in cleanup_link_status_change_wq()
340 struct lio *lio = GET_LIO(netdev); in update_link_status() local
341 int current_max_mtu = lio->linfo.link.s.mtu; in update_link_status()
342 struct octeon_device *oct = lio->oct_dev; in update_link_status()
344 if ((lio->intf_open) && (lio->linfo.link.u64 != ls->u64)) { in update_link_status()
345 lio->linfo.link.u64 = ls->u64; in update_link_status()
348 lio->link_changes++; in update_link_status()
350 if (lio->linfo.link.s.link_up) { in update_link_status()
358 if (lio->linfo.link.s.mtu != current_max_mtu) { in update_link_status()
361 current_max_mtu, lio->linfo.link.s.mtu); in update_link_status()
362 netdev->max_mtu = lio->linfo.link.s.mtu; in update_link_status()
365 if (lio->linfo.link.s.mtu < netdev->mtu) { in update_link_status()
368 netdev->mtu, lio->linfo.link.s.mtu); in update_link_status()
369 queue_delayed_work(lio->link_status_wq.wq, in update_link_status()
370 &lio->link_status_wq.wk.work, 0); in update_link_status()
595 static int send_rx_ctrl_cmd(struct lio *lio, int start_stop) in send_rx_ctrl_cmd() argument
597 struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; in send_rx_ctrl_cmd()
602 if (oct->props[lio->ifidx].rx_on == start_stop) in send_rx_ctrl_cmd()
609 netif_info(lio, rx_err, lio->netdev, in send_rx_ctrl_cmd()
622 sc->iq_no = lio->linfo.txpciq[0].s.q_no; in send_rx_ctrl_cmd()
632 netif_info(lio, rx_err, lio->netdev, "Failed to send RX Control message\n"); in send_rx_ctrl_cmd()
642 oct->props[lio->ifidx].rx_on = start_stop; in send_rx_ctrl_cmd()
662 struct lio *lio; in liquidio_destroy_nic_device() local
670 lio = GET_LIO(netdev); in liquidio_destroy_nic_device()
674 if (atomic_read(&lio->ifstate) & LIO_IFSTATE_RUNNING) in liquidio_destroy_nic_device()
677 if (oct->props[lio->ifidx].napi_enabled == 1) { in liquidio_destroy_nic_device()
681 oct->props[lio->ifidx].napi_enabled = 0; in liquidio_destroy_nic_device()
692 if (atomic_read(&lio->ifstate) & LIO_IFSTATE_REGISTERED) in liquidio_destroy_nic_device()
699 lio_delete_glists(lio); in liquidio_destroy_nic_device()
714 struct lio *lio; in liquidio_stop_nic_module() local
728 lio = GET_LIO(oct->props[i].netdev); in liquidio_stop_nic_module()
731 lio->linfo.rxpciq[j].s.q_no); in liquidio_stop_nic_module()
804 struct lio *lio; in free_netbuf() local
808 lio = finfo->lio; in free_netbuf()
810 dma_unmap_single(&lio->oct_dev->pci_dev->dev, finfo->dptr, skb->len, in free_netbuf()
826 struct lio *lio; in free_netsgbuf() local
830 lio = finfo->lio; in free_netsgbuf()
834 dma_unmap_single(&lio->oct_dev->pci_dev->dev, in free_netsgbuf()
842 dma_unmap_page(&lio->oct_dev->pci_dev->dev, in free_netsgbuf()
848 iq = skb_iq(lio->oct_dev, skb); in free_netsgbuf()
850 spin_lock(&lio->glist_lock[iq]); in free_netsgbuf()
851 list_add_tail(&g->list, &lio->glist[iq]); in free_netsgbuf()
852 spin_unlock(&lio->glist_lock[iq]); in free_netsgbuf()
868 struct lio *lio; in free_netsgbuf_with_resp() local
874 lio = finfo->lio; in free_netsgbuf_with_resp()
878 dma_unmap_single(&lio->oct_dev->pci_dev->dev, in free_netsgbuf_with_resp()
886 dma_unmap_page(&lio->oct_dev->pci_dev->dev, in free_netsgbuf_with_resp()
892 iq = skb_iq(lio->oct_dev, skb); in free_netsgbuf_with_resp()
894 spin_lock(&lio->glist_lock[iq]); in free_netsgbuf_with_resp()
895 list_add_tail(&g->list, &lio->glist[iq]); in free_netsgbuf_with_resp()
896 spin_unlock(&lio->glist_lock[iq]); in free_netsgbuf_with_resp()
907 struct lio *lio = GET_LIO(netdev); in liquidio_open() local
908 struct octeon_device *oct = lio->oct_dev; in liquidio_open()
913 if (!oct->props[lio->ifidx].napi_enabled) { in liquidio_open()
919 oct->props[lio->ifidx].napi_enabled = 1; in liquidio_open()
924 ifstate_set(lio, LIO_IFSTATE_RUNNING); in liquidio_open()
927 lio->intf_open = 1; in liquidio_open()
929 netif_info(lio, ifup, lio->netdev, "Interface Open, ready for traffic\n"); in liquidio_open()
932 INIT_DELAYED_WORK(&lio->stats_wk.work, lio_fetch_stats); in liquidio_open()
933 lio->stats_wk.ctxptr = lio; in liquidio_open()
934 schedule_delayed_work(&lio->stats_wk.work, msecs_to_jiffies in liquidio_open()
938 ret = send_rx_ctrl_cmd(lio, 1); in liquidio_open()
953 struct lio *lio = GET_LIO(netdev); in liquidio_stop() local
954 struct octeon_device *oct = lio->oct_dev; in liquidio_stop()
960 ret = send_rx_ctrl_cmd(lio, 0); in liquidio_stop()
964 netif_info(lio, ifdown, lio->netdev, "Stopping interface!\n"); in liquidio_stop()
966 lio->intf_open = 0; in liquidio_stop()
967 lio->linfo.link.s.link_up = 0; in liquidio_stop()
970 lio->link_changes++; in liquidio_stop()
972 ifstate_reset(lio, LIO_IFSTATE_RUNNING); in liquidio_stop()
978 netif_info(lio, rx_err, lio->netdev, in liquidio_stop()
981 if (oct->props[lio->ifidx].napi_enabled == 1) { in liquidio_stop()
985 oct->props[lio->ifidx].napi_enabled = 0; in liquidio_stop()
992 cancel_delayed_work_sync(&lio->stats_wk.work); in liquidio_stop()
1034 struct lio *lio = GET_LIO(netdev); in liquidio_set_uc_list() local
1035 struct octeon_device *oct = lio->oct_dev; in liquidio_set_uc_list()
1040 if (lio->netdev_uc_count == netdev_uc_count(netdev)) in liquidio_set_uc_list()
1048 lio->netdev_uc_count = netdev_uc_count(netdev); in liquidio_set_uc_list()
1052 nctrl.ncmd.s.more = lio->netdev_uc_count; in liquidio_set_uc_list()
1054 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in liquidio_set_uc_list()
1065 octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in liquidio_set_uc_list()
1075 struct lio *lio = GET_LIO(netdev); in liquidio_set_mcast_list() local
1076 struct octeon_device *oct = lio->oct_dev; in liquidio_set_mcast_list()
1103 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in liquidio_set_mcast_list()
1109 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in liquidio_set_mcast_list()
1126 struct lio *lio = GET_LIO(netdev); in liquidio_set_mac() local
1127 struct octeon_device *oct = lio->oct_dev; in liquidio_set_mac()
1137 if (lio->linfo.macaddr_is_admin_asgnd) in liquidio_set_mac()
1146 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in liquidio_set_mac()
1153 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in liquidio_set_mac()
1166 ether_addr_copy(((u8 *)&lio->linfo.hw_addr) + 2, addr->sa_data); in liquidio_set_mac()
1175 struct lio *lio = GET_LIO(netdev); in liquidio_get_stats64() local
1182 oct = lio->oct_dev; in liquidio_get_stats64()
1184 if (ifstate_check(lio, LIO_IFSTATE_RESETTING)) in liquidio_get_stats64()
1188 iq_no = lio->linfo.txpciq[i].s.q_no; in liquidio_get_stats64()
1204 oq_no = lio->linfo.rxpciq[i].s.q_no; in liquidio_get_stats64()
1245 struct lio *lio = GET_LIO(netdev); in hwtstamp_ioctl() local
1284 ifstate_set(lio, LIO_IFSTATE_RX_TIMESTAMP_ENABLED); in hwtstamp_ioctl()
1287 ifstate_reset(lio, LIO_IFSTATE_RX_TIMESTAMP_ENABLED); in hwtstamp_ioctl()
1314 struct lio *lio; in handle_timestamp() local
1317 lio = finfo->lio; in handle_timestamp()
1319 oct = lio->oct_dev; in handle_timestamp()
1334 netif_info(lio, tx_done, lio->netdev, in handle_timestamp()
1337 ts.hwtstamp = ns_to_ktime(ns + lio->ptp_adjust); in handle_timestamp()
1357 struct lio *lio; in send_nic_timestamp_pkt() local
1361 lio = finfo->lio; in send_nic_timestamp_pkt()
1393 netif_info(lio, tx_queued, lio->netdev, "Queued timestamp packet\n"); in send_nic_timestamp_pkt()
1417 struct lio *lio; in liquidio_xmit() local
1423 lio = GET_LIO(netdev); in liquidio_xmit()
1424 oct = lio->oct_dev; in liquidio_xmit()
1426 q_idx = skb_iq(lio->oct_dev, skb); in liquidio_xmit()
1428 iq_no = lio->linfo.txpciq[q_idx].s.q_no; in liquidio_xmit()
1435 if (!(atomic_read(&lio->ifstate) & LIO_IFSTATE_RUNNING) || in liquidio_xmit()
1436 (!lio->linfo.link.s.link_up) || (skb->len <= 0)) { in liquidio_xmit()
1437 netif_info(lio, tx_err, lio->netdev, "Transmit failed link_status : %d\n", in liquidio_xmit()
1438 lio->linfo.link.s.link_up); in liquidio_xmit()
1446 finfo->lio = lio; in liquidio_xmit()
1459 netif_info(lio, tx_err, lio->netdev, "Transmit failed iq:%d full\n", in liquidio_xmit()
1506 spin_lock(&lio->glist_lock[q_idx]); in liquidio_xmit()
1508 lio_list_delete_head(&lio->glist[q_idx]); in liquidio_xmit()
1509 spin_unlock(&lio->glist_lock[q_idx]); in liquidio_xmit()
1512 netif_info(lio, tx_err, lio->netdev, in liquidio_xmit()
1598 netif_info(lio, tx_queued, lio->netdev, "Transmit queued successfully\n"); in liquidio_xmit()
1618 netif_info(lio, tx_err, lio->netdev, "IQ%d Transmit dropped:%llu\n", in liquidio_xmit()
1637 struct lio *lio; in liquidio_tx_timeout() local
1639 lio = GET_LIO(netdev); in liquidio_tx_timeout()
1641 netif_info(lio, tx_err, lio->netdev, in liquidio_tx_timeout()
1652 struct lio *lio = GET_LIO(netdev); in liquidio_vlan_rx_add_vid() local
1653 struct octeon_device *oct = lio->oct_dev; in liquidio_vlan_rx_add_vid()
1662 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in liquidio_vlan_rx_add_vid()
1666 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in liquidio_vlan_rx_add_vid()
1680 struct lio *lio = GET_LIO(netdev); in liquidio_vlan_rx_kill_vid() local
1681 struct octeon_device *oct = lio->oct_dev; in liquidio_vlan_rx_kill_vid()
1690 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in liquidio_vlan_rx_kill_vid()
1694 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in liquidio_vlan_rx_kill_vid()
1714 struct lio *lio = GET_LIO(netdev); in liquidio_set_rxcsum_command() local
1715 struct octeon_device *oct = lio->oct_dev; in liquidio_set_rxcsum_command()
1724 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in liquidio_set_rxcsum_command()
1728 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in liquidio_set_rxcsum_command()
1749 struct lio *lio = GET_LIO(netdev); in liquidio_vxlan_port_command() local
1750 struct octeon_device *oct = lio->oct_dev; in liquidio_vxlan_port_command()
1760 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in liquidio_vxlan_port_command()
1764 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in liquidio_vxlan_port_command()
1812 struct lio *lio = netdev_priv(netdev); in liquidio_fix_features() local
1815 !(lio->dev_capability & NETIF_F_RXCSUM)) in liquidio_fix_features()
1819 !(lio->dev_capability & NETIF_F_HW_CSUM)) in liquidio_fix_features()
1822 if ((request & NETIF_F_TSO) && !(lio->dev_capability & NETIF_F_TSO)) in liquidio_fix_features()
1825 if ((request & NETIF_F_TSO6) && !(lio->dev_capability & NETIF_F_TSO6)) in liquidio_fix_features()
1828 if ((request & NETIF_F_LRO) && !(lio->dev_capability & NETIF_F_LRO)) in liquidio_fix_features()
1833 (lio->dev_capability & NETIF_F_LRO)) in liquidio_fix_features()
1846 struct lio *lio = netdev_priv(netdev); in liquidio_set_features() local
1851 if ((features & NETIF_F_LRO) && (lio->dev_capability & NETIF_F_LRO)) in liquidio_set_features()
1855 (lio->dev_capability & NETIF_F_LRO)) in liquidio_set_features()
1859 (lio->enc_dev_capability & NETIF_F_RXCSUM) && in liquidio_set_features()
1864 (lio->enc_dev_capability & NETIF_F_RXCSUM) && in liquidio_set_features()
1941 struct lio *lio = NULL; in setup_nic_devices() local
2053 lio = GET_LIO(netdev); in setup_nic_devices()
2055 memset(lio, 0, sizeof(struct lio)); in setup_nic_devices()
2057 lio->ifidx = ifidx_or_pfnum; in setup_nic_devices()
2063 lio->linfo.num_rxpciq = num_oqueues; in setup_nic_devices()
2064 lio->linfo.num_txpciq = num_iqueues; in setup_nic_devices()
2067 lio->linfo.rxpciq[j].u64 = in setup_nic_devices()
2071 lio->linfo.txpciq[j].u64 = in setup_nic_devices()
2075 lio->linfo.hw_addr = resp->cfg_info.linfo.hw_addr; in setup_nic_devices()
2076 lio->linfo.gmxport = resp->cfg_info.linfo.gmxport; in setup_nic_devices()
2077 lio->linfo.link.u64 = resp->cfg_info.linfo.link.u64; in setup_nic_devices()
2078 lio->linfo.macaddr_is_admin_asgnd = in setup_nic_devices()
2080 lio->linfo.macaddr_spoofchk = in setup_nic_devices()
2083 lio->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); in setup_nic_devices()
2085 lio->dev_capability = NETIF_F_HIGHDMA in setup_nic_devices()
2096 lio->enc_dev_capability = NETIF_F_IP_CSUM in setup_nic_devices()
2105 (lio->enc_dev_capability & ~NETIF_F_LRO); in setup_nic_devices()
2108 netdev->vlan_features = lio->dev_capability; in setup_nic_devices()
2110 lio->dev_capability |= NETIF_F_HW_VLAN_CTAG_FILTER | in setup_nic_devices()
2114 netdev->features = (lio->dev_capability & ~NETIF_F_LRO); in setup_nic_devices()
2116 netdev->hw_features = lio->dev_capability; in setup_nic_devices()
2128 lio->oct_dev = octeon_dev; in setup_nic_devices()
2129 lio->octprops = props; in setup_nic_devices()
2130 lio->netdev = netdev; in setup_nic_devices()
2134 lio->linfo.gmxport, CVM_CAST64(lio->linfo.hw_addr)); in setup_nic_devices()
2137 octeon_swap_8B_data(&lio->linfo.hw_addr, 1); in setup_nic_devices()
2139 mac[j] = *((u8 *)(((u8 *)&lio->linfo.hw_addr) + 2 + j)); in setup_nic_devices()
2145 lio->linfo.num_txpciq, in setup_nic_devices()
2146 lio->linfo.num_rxpciq)) { in setup_nic_devices()
2151 ifstate_set(lio, LIO_IFSTATE_DROQ_OPS); in setup_nic_devices()
2162 lio->txq = lio->linfo.txpciq[0].s.q_no; in setup_nic_devices()
2163 lio->rxq = lio->linfo.rxpciq[0].s.q_no; in setup_nic_devices()
2165 lio->tx_qsize = octeon_get_tx_qsize(octeon_dev, lio->txq); in setup_nic_devices()
2166 lio->rx_qsize = octeon_get_rx_qsize(octeon_dev, lio->rxq); in setup_nic_devices()
2168 if (lio_setup_glists(octeon_dev, lio, num_iqueues)) { in setup_nic_devices()
2176 if (lio->oct_dev->chip_id == OCTEON_CN23XX_VF_VID) in setup_nic_devices()
2201 lio->link_changes++; in setup_nic_devices()
2203 ifstate_set(lio, LIO_IFSTATE_REGISTERED); in setup_nic_devices()