Lines Matching refs:netdev
149 static int liquidio_stop(struct net_device *netdev);
153 static int liquidio_set_vf_link_state(struct net_device *netdev, int vfidx,
464 int numqs = lio->netdev->real_num_tx_queues; in check_txq_status()
474 if (__netif_subqueue_stopped(lio->netdev, q)) { in check_txq_status()
475 netif_wake_subqueue(lio->netdev, q); in check_txq_status()
489 static void print_link_info(struct net_device *netdev) in print_link_info() argument
491 struct lio *lio = GET_LIO(netdev); in print_link_info()
498 netif_info(lio, link, lio->netdev, "%d Mbps %s Duplex UP\n", in print_link_info()
502 netif_info(lio, link, lio->netdev, "Link Down\n"); in print_link_info()
521 dev_set_mtu(lio->netdev, lio->linfo.link.s.mtu); in octnet_link_status_change()
529 static inline int setup_link_status_change_wq(struct net_device *netdev) in setup_link_status_change_wq() argument
531 struct lio *lio = GET_LIO(netdev); in setup_link_status_change_wq()
547 static inline void cleanup_link_status_change_wq(struct net_device *netdev) in cleanup_link_status_change_wq() argument
549 struct lio *lio = GET_LIO(netdev); in cleanup_link_status_change_wq()
565 static inline void update_link_status(struct net_device *netdev, in update_link_status() argument
568 struct lio *lio = GET_LIO(netdev); in update_link_status()
578 print_link_info(netdev); in update_link_status()
583 netif_carrier_on(netdev); in update_link_status()
584 wake_txqs(netdev); in update_link_status()
587 netif_carrier_off(netdev); in update_link_status()
588 stop_txqs(netdev); in update_link_status()
591 netif_info(lio, probe, lio->netdev, "Max MTU changed from %d to %d\n", in update_link_status()
593 netdev->max_mtu = lio->linfo.link.s.mtu; in update_link_status()
595 if (lio->linfo.link.s.mtu < netdev->mtu) { in update_link_status()
598 netdev->mtu, lio->linfo.link.s.mtu); in update_link_status()
662 static inline int setup_sync_octeon_time_wq(struct net_device *netdev) in setup_sync_octeon_time_wq() argument
664 struct lio *lio = GET_LIO(netdev); in setup_sync_octeon_time_wq()
691 static inline void cleanup_sync_octeon_time_wq(struct net_device *netdev) in cleanup_sync_octeon_time_wq() argument
693 struct lio *lio = GET_LIO(netdev); in cleanup_sync_octeon_time_wq()
730 struct net_device *netdev; in disable_all_vf_links() local
739 netdev = oct->props[i].netdev; in disable_all_vf_links()
740 if (!netdev) in disable_all_vf_links()
744 liquidio_set_vf_link_state(netdev, vf, in disable_all_vf_links()
1161 netif_info(lio, rx_err, lio->netdev, in send_rx_ctrl_cmd()
1184 netif_info(lio, rx_err, lio->netdev, "Failed to send RX Control message\n"); in send_rx_ctrl_cmd()
1211 struct net_device *netdev = oct->props[ifidx].netdev; in liquidio_destroy_nic_device() local
1216 if (!netdev) { in liquidio_destroy_nic_device()
1222 lio = GET_LIO(netdev); in liquidio_destroy_nic_device()
1227 liquidio_stop(netdev); in liquidio_destroy_nic_device()
1230 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) in liquidio_destroy_nic_device()
1240 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) in liquidio_destroy_nic_device()
1246 unregister_netdev(netdev); in liquidio_destroy_nic_device()
1248 cleanup_sync_octeon_time_wq(netdev); in liquidio_destroy_nic_device()
1249 cleanup_link_status_change_wq(netdev); in liquidio_destroy_nic_device()
1251 cleanup_rx_oom_poll_fn(netdev); in liquidio_destroy_nic_device()
1255 free_netdev(netdev); in liquidio_destroy_nic_device()
1259 oct->props[ifidx].netdev = NULL; in liquidio_destroy_nic_device()
1292 lio = GET_LIO(oct->props[i].netdev); in liquidio_stop_nic_module()
1631 static void oct_ptp_open(struct net_device *netdev) in oct_ptp_open() argument
1633 struct lio *lio = GET_LIO(netdev); in oct_ptp_open()
1638 snprintf(lio->ptp_info.name, 16, "%s", netdev->name); in oct_ptp_open()
1737 static inline int setup_tx_poll_fn(struct net_device *netdev) in setup_tx_poll_fn() argument
1739 struct lio *lio = GET_LIO(netdev); in setup_tx_poll_fn()
1756 static inline void cleanup_tx_poll_fn(struct net_device *netdev) in cleanup_tx_poll_fn() argument
1758 struct lio *lio = GET_LIO(netdev); in cleanup_tx_poll_fn()
1770 static int liquidio_open(struct net_device *netdev) in liquidio_open() argument
1772 struct lio *lio = GET_LIO(netdev); in liquidio_open()
1781 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) in liquidio_open()
1791 oct_ptp_open(netdev); in liquidio_open()
1796 ret = setup_tx_poll_fn(netdev); in liquidio_open()
1801 netif_tx_start_all_queues(netdev); in liquidio_open()
1806 netif_info(lio, ifup, lio->netdev, "Interface Open, ready for traffic\n"); in liquidio_open()
1820 netdev->name); in liquidio_open()
1826 cleanup_tx_poll_fn(netdev); in liquidio_open()
1834 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) in liquidio_open()
1850 static int liquidio_stop(struct net_device *netdev) in liquidio_stop() argument
1852 struct lio *lio = GET_LIO(netdev); in liquidio_stop()
1863 stop_txqs(netdev); in liquidio_stop()
1866 netif_carrier_off(netdev); in liquidio_stop()
1867 netif_tx_disable(netdev); in liquidio_stop()
1879 cleanup_tx_poll_fn(netdev); in liquidio_stop()
1881 cleanup_tx_poll_fn(netdev); in liquidio_stop()
1893 netif_info(lio, rx_err, lio->netdev, in liquidio_stop()
1897 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) in liquidio_stop()
1908 dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name); in liquidio_stop()
1920 static inline enum octnet_ifflags get_new_flags(struct net_device *netdev) in get_new_flags() argument
1924 if (netdev->flags & IFF_PROMISC) in get_new_flags()
1927 if (netdev->flags & IFF_ALLMULTI) in get_new_flags()
1930 if (netdev->flags & IFF_MULTICAST) { in get_new_flags()
1936 if (netdev_mc_count(netdev) > MAX_OCTEON_MULTICAST_ADDR) in get_new_flags()
1940 if (netdev->flags & IFF_BROADCAST) in get_new_flags()
1950 static void liquidio_set_mcast_list(struct net_device *netdev) in liquidio_set_mcast_list() argument
1952 struct lio *lio = GET_LIO(netdev); in liquidio_set_mcast_list()
1958 int mc_count = min(netdev_mc_count(netdev), MAX_OCTEON_MULTICAST_ADDR); in liquidio_set_mcast_list()
1965 nctrl.ncmd.s.param1 = get_new_flags(netdev); in liquidio_set_mcast_list()
1969 nctrl.netpndev = (u64)netdev; in liquidio_set_mcast_list()
1974 netdev_for_each_mc_addr(ha, netdev) { in liquidio_set_mcast_list()
1999 static int liquidio_set_mac(struct net_device *netdev, void *p) in liquidio_set_mac() argument
2002 struct lio *lio = GET_LIO(netdev); in liquidio_set_mac()
2017 nctrl.netpndev = (u64)netdev; in liquidio_set_mac()
2036 eth_hw_addr_set(netdev, addr->sa_data); in liquidio_set_mac()
2043 liquidio_get_stats64(struct net_device *netdev, in liquidio_get_stats64() argument
2046 struct lio *lio = GET_LIO(netdev); in liquidio_get_stats64()
2119 static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr) in hwtstamp_ioctl() argument
2122 struct lio *lio = GET_LIO(netdev); in hwtstamp_ioctl()
2174 static int liquidio_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) in liquidio_ioctl() argument
2176 struct lio *lio = GET_LIO(netdev); in liquidio_ioctl()
2181 return hwtstamp_ioctl(netdev, ifr); in liquidio_ioctl()
2222 netif_info(lio, tx_done, lio->netdev, in handle_timestamp()
2288 netif_info(lio, tx_queued, lio->netdev, "Queued timestamp packet\n"); in send_nic_timestamp_pkt()
2302 static netdev_tx_t liquidio_xmit(struct sk_buff *skb, struct net_device *netdev) in liquidio_xmit() argument
2318 lio = GET_LIO(netdev); in liquidio_xmit()
2333 netif_info(lio, tx_err, lio->netdev, in liquidio_xmit()
2356 netif_info(lio, tx_err, lio->netdev, "Transmit failed iq:%d full\n", in liquidio_xmit()
2418 netif_info(lio, tx_err, lio->netdev, in liquidio_xmit()
2515 netif_info(lio, tx_queued, lio->netdev, "Transmit queued successfully\n"); in liquidio_xmit()
2518 netif_stop_subqueue(netdev, q_idx); in liquidio_xmit()
2520 netif_trans_update(netdev); in liquidio_xmit()
2532 netif_info(lio, tx_err, lio->netdev, "IQ%d Transmit dropped:%llu\n", in liquidio_xmit()
2549 static void liquidio_tx_timeout(struct net_device *netdev, unsigned int txqueue) in liquidio_tx_timeout() argument
2553 lio = GET_LIO(netdev); in liquidio_tx_timeout()
2555 netif_info(lio, tx_err, lio->netdev, in liquidio_tx_timeout()
2557 netdev->stats.tx_dropped); in liquidio_tx_timeout()
2558 netif_trans_update(netdev); in liquidio_tx_timeout()
2559 wake_txqs(netdev); in liquidio_tx_timeout()
2562 static int liquidio_vlan_rx_add_vid(struct net_device *netdev, in liquidio_vlan_rx_add_vid() argument
2566 struct lio *lio = GET_LIO(netdev); in liquidio_vlan_rx_add_vid()
2577 nctrl.netpndev = (u64)netdev; in liquidio_vlan_rx_add_vid()
2591 static int liquidio_vlan_rx_kill_vid(struct net_device *netdev, in liquidio_vlan_rx_kill_vid() argument
2595 struct lio *lio = GET_LIO(netdev); in liquidio_vlan_rx_kill_vid()
2606 nctrl.netpndev = (u64)netdev; in liquidio_vlan_rx_kill_vid()
2626 static int liquidio_set_rxcsum_command(struct net_device *netdev, int command, in liquidio_set_rxcsum_command() argument
2629 struct lio *lio = GET_LIO(netdev); in liquidio_set_rxcsum_command()
2640 nctrl.netpndev = (u64)netdev; in liquidio_set_rxcsum_command()
2663 static int liquidio_vxlan_port_command(struct net_device *netdev, int command, in liquidio_vxlan_port_command() argument
2666 struct lio *lio = GET_LIO(netdev); in liquidio_vxlan_port_command()
2678 nctrl.netpndev = (u64)netdev; in liquidio_vxlan_port_command()
2692 static int liquidio_udp_tunnel_set_port(struct net_device *netdev, in liquidio_udp_tunnel_set_port() argument
2696 return liquidio_vxlan_port_command(netdev, in liquidio_udp_tunnel_set_port()
2702 static int liquidio_udp_tunnel_unset_port(struct net_device *netdev, in liquidio_udp_tunnel_unset_port() argument
2707 return liquidio_vxlan_port_command(netdev, in liquidio_udp_tunnel_unset_port()
2727 static netdev_features_t liquidio_fix_features(struct net_device *netdev, in liquidio_fix_features() argument
2730 struct lio *lio = netdev_priv(netdev); in liquidio_fix_features()
2750 if (!(request & NETIF_F_RXCSUM) && (netdev->features & NETIF_F_LRO) && in liquidio_fix_features()
2766 static int liquidio_set_features(struct net_device *netdev, in liquidio_set_features() argument
2769 struct lio *lio = netdev_priv(netdev); in liquidio_set_features()
2773 !(netdev->features & NETIF_F_LRO)) in liquidio_set_features()
2774 liquidio_set_feature(netdev, OCTNET_CMD_LRO_ENABLE, in liquidio_set_features()
2778 (netdev->features & NETIF_F_LRO)) in liquidio_set_features()
2779 liquidio_set_feature(netdev, OCTNET_CMD_LRO_DISABLE, in liquidio_set_features()
2785 if (!(netdev->features & NETIF_F_RXCSUM) && in liquidio_set_features()
2788 liquidio_set_rxcsum_command(netdev, in liquidio_set_features()
2791 else if ((netdev->features & NETIF_F_RXCSUM) && in liquidio_set_features()
2794 liquidio_set_rxcsum_command(netdev, OCTNET_CMD_TNL_RX_CSUM_CTL, in liquidio_set_features()
2799 !(netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) in liquidio_set_features()
2800 liquidio_set_feature(netdev, OCTNET_CMD_VLAN_FILTER_CTL, in liquidio_set_features()
2804 (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) in liquidio_set_features()
2805 liquidio_set_feature(netdev, OCTNET_CMD_VLAN_FILTER_CTL, in liquidio_set_features()
2811 static int __liquidio_set_vf_mac(struct net_device *netdev, int vfidx, in __liquidio_set_vf_mac() argument
2814 struct lio *lio = GET_LIO(netdev); in __liquidio_set_vf_mac()
2833 nctrl.netpndev = (u64)netdev; in __liquidio_set_vf_mac()
2852 static int liquidio_set_vf_mac(struct net_device *netdev, int vfidx, u8 *mac) in liquidio_set_vf_mac() argument
2854 struct lio *lio = GET_LIO(netdev); in liquidio_set_vf_mac()
2861 retval = __liquidio_set_vf_mac(netdev, vfidx, mac, true); in liquidio_set_vf_mac()
2868 static int liquidio_set_vf_spoofchk(struct net_device *netdev, int vfidx, in liquidio_set_vf_spoofchk() argument
2871 struct lio *lio = GET_LIO(netdev); in liquidio_set_vf_spoofchk()
2877 netif_info(lio, drv, lio->netdev, in liquidio_set_vf_spoofchk()
2883 netif_info(lio, drv, lio->netdev, "Invalid vfidx %d\n", vfidx); in liquidio_set_vf_spoofchk()
2911 netif_info(lio, drv, lio->netdev, in liquidio_set_vf_spoofchk()
2918 netif_info(lio, drv, lio->netdev, "VF %u spoofchk is %s\n", vfidx, in liquidio_set_vf_spoofchk()
2924 static int liquidio_set_vf_vlan(struct net_device *netdev, int vfidx, in liquidio_set_vf_vlan() argument
2927 struct lio *lio = GET_LIO(netdev); in liquidio_set_vf_vlan()
2976 static int liquidio_get_vf_config(struct net_device *netdev, int vfidx, in liquidio_get_vf_config() argument
2979 struct lio *lio = GET_LIO(netdev); in liquidio_get_vf_config()
3042 static int liquidio_set_vf_trust(struct net_device *netdev, int vfidx, in liquidio_set_vf_trust() argument
3045 struct lio *lio = GET_LIO(netdev); in liquidio_set_vf_trust()
3054 netif_info(lio, drv, lio->netdev, "Invalid vfidx %d\n", vfidx); in liquidio_set_vf_trust()
3066 netif_info(lio, drv, lio->netdev, "More than one trusted VF is not allowed\n"); in liquidio_set_vf_trust()
3084 netif_info(lio, drv, lio->netdev, "VF %u is %strusted\n", vfidx, in liquidio_set_vf_trust()
3087 netif_info(lio, drv, lio->netdev, "Failed to set VF trusted\n"); in liquidio_set_vf_trust()
3094 static int liquidio_set_vf_link_state(struct net_device *netdev, int vfidx, in liquidio_set_vf_link_state() argument
3097 struct lio *lio = GET_LIO(netdev); in liquidio_set_vf_link_state()
3197 static int liquidio_get_vf_stats(struct net_device *netdev, int vfidx, in liquidio_get_vf_stats() argument
3200 struct lio *lio = GET_LIO(netdev); in liquidio_get_vf_stats()
3318 update_link_status(oct->props[i].netdev, ls); in lio_nic_info()
3341 struct net_device *netdev; in setup_nic_devices() local
3507 netdev = alloc_etherdev_mq(LIO_SIZE, max_num_queues); in setup_nic_devices()
3509 if (!netdev) { in setup_nic_devices()
3515 SET_NETDEV_DEV(netdev, &octeon_dev->pci_dev->dev); in setup_nic_devices()
3520 netdev->netdev_ops = &lionetdevops; in setup_nic_devices()
3522 retval = netif_set_real_num_rx_queues(netdev, num_oqueues); in setup_nic_devices()
3530 retval = netif_set_real_num_tx_queues(netdev, num_iqueues); in setup_nic_devices()
3538 lio = GET_LIO(netdev); in setup_nic_devices()
3546 props->netdev = netdev; in setup_nic_devices()
3576 netif_set_tso_max_size(netdev, OCTNIC_GSO_MAX_SIZE); in setup_nic_devices()
3589 netdev->hw_enc_features = (lio->enc_dev_capability & in setup_nic_devices()
3592 netdev->udp_tunnel_nic_info = &liquidio_udp_tunnels; in setup_nic_devices()
3596 netdev->vlan_features = lio->dev_capability; in setup_nic_devices()
3602 netdev->features = (lio->dev_capability & ~NETIF_F_LRO); in setup_nic_devices()
3604 netdev->hw_features = lio->dev_capability; in setup_nic_devices()
3606 netdev->hw_features = netdev->hw_features & in setup_nic_devices()
3610 netdev->min_mtu = LIO_MIN_MTU_SIZE; in setup_nic_devices()
3611 netdev->max_mtu = LIO_MAX_MTU_SIZE; in setup_nic_devices()
3618 lio->netdev = netdev; in setup_nic_devices()
3628 if (__liquidio_set_vf_mac(netdev, j, vfmac, false)) { in setup_nic_devices()
3643 eth_hw_addr_set(netdev, mac); in setup_nic_devices()
3669 liquidio_set_ethtool_ops(netdev); in setup_nic_devices()
3675 if (netdev->features & NETIF_F_LRO) in setup_nic_devices()
3676 liquidio_set_feature(netdev, OCTNET_CMD_LRO_ENABLE, in setup_nic_devices()
3679 liquidio_set_feature(netdev, OCTNET_CMD_VLAN_FILTER_CTL, in setup_nic_devices()
3683 liquidio_set_feature(netdev, in setup_nic_devices()
3686 if (setup_link_status_change_wq(netdev)) in setup_nic_devices()
3691 setup_sync_octeon_time_wq(netdev)) in setup_nic_devices()
3694 if (setup_rx_oom_poll_fn(netdev)) in setup_nic_devices()
3698 if (register_netdev(netdev)) { in setup_nic_devices()
3706 netif_carrier_off(netdev); in setup_nic_devices()
3715 liquidio_set_rxcsum_command(netdev, OCTNET_CMD_TNL_RX_CSUM_CTL, in setup_nic_devices()
3717 liquidio_set_feature(netdev, OCTNET_CMD_TNL_TX_CSUM_CTL, in setup_nic_devices()