Lines Matching refs:netdev

144 			netdev_err(nic->netdev,  in nicvf_send_msg_to_pf()
162 netdev_err(nic->netdev, in nicvf_check_pf_ready()
194 netdev_dbg(nic->netdev, "Mbox message: msg: 0x%x\n", mbx.msg.msg); in nicvf_handle_mbx_intr()
202 ether_addr_copy(nic->netdev->dev_addr, in nicvf_handle_mbx_intr()
230 netdev_info(nic->netdev, "%s: Link is Up %d Mbps %s\n", in nicvf_handle_mbx_intr()
231 nic->netdev->name, nic->speed, in nicvf_handle_mbx_intr()
234 netif_carrier_on(nic->netdev); in nicvf_handle_mbx_intr()
235 netif_tx_start_all_queues(nic->netdev); in nicvf_handle_mbx_intr()
237 netdev_info(nic->netdev, "%s: Link is Down\n", in nicvf_handle_mbx_intr()
238 nic->netdev->name); in nicvf_handle_mbx_intr()
239 netif_carrier_off(nic->netdev); in nicvf_handle_mbx_intr()
240 netif_tx_stop_all_queues(nic->netdev); in nicvf_handle_mbx_intr()
264 netdev_err(nic->netdev, in nicvf_handle_mbx_intr()
271 static int nicvf_hw_set_mac_addr(struct nicvf *nic, struct net_device *netdev) in nicvf_hw_set_mac_addr() argument
277 ether_addr_copy(mbx.mac.mac_addr, netdev->dev_addr); in nicvf_hw_set_mac_addr()
434 nicvf_open(nic->snicvf[sqs]->netdev); in nicvf_request_sqs()
439 nicvf_set_real_num_queues(nic->netdev, in nicvf_request_sqs()
465 int nicvf_set_real_num_queues(struct net_device *netdev, in nicvf_set_real_num_queues() argument
470 err = netif_set_real_num_tx_queues(netdev, tx_queues); in nicvf_set_real_num_queues()
472 netdev_err(netdev, in nicvf_set_real_num_queues()
477 err = netif_set_real_num_rx_queues(netdev, rx_queues); in nicvf_set_real_num_queues()
479 netdev_err(netdev, in nicvf_set_real_num_queues()
497 netdev_err(nic->netdev, in nicvf_init_resources()
508 static void nicvf_snd_pkt_handler(struct net_device *netdev, in nicvf_snd_pkt_handler() argument
513 struct nicvf *nic = netdev_priv(netdev); in nicvf_snd_pkt_handler()
523 netdev_dbg(nic->netdev, in nicvf_snd_pkt_handler()
539 static inline void nicvf_set_rxhash(struct net_device *netdev, in nicvf_set_rxhash() argument
546 if (!(netdev->features & NETIF_F_RXHASH)) in nicvf_set_rxhash()
567 static void nicvf_rcv_pkt_handler(struct net_device *netdev, in nicvf_rcv_pkt_handler() argument
573 struct nicvf *nic = netdev_priv(netdev); in nicvf_rcv_pkt_handler()
582 netdev = nic->netdev; in nicvf_rcv_pkt_handler()
592 netdev_dbg(nic->netdev, "Packet not received\n"); in nicvf_rcv_pkt_handler()
597 netdev_info(nic->netdev, "%s: skb 0x%p, len=%d\n", netdev->name, in nicvf_rcv_pkt_handler()
611 nicvf_set_rxhash(netdev, cqe_rx, skb); in nicvf_rcv_pkt_handler()
614 if (netdev->hw_features & NETIF_F_RXCSUM) { in nicvf_rcv_pkt_handler()
621 skb->protocol = eth_type_trans(skb, netdev); in nicvf_rcv_pkt_handler()
628 if (napi && (netdev->features & NETIF_F_GRO)) in nicvf_rcv_pkt_handler()
634 static int nicvf_cq_intr_handler(struct net_device *netdev, u8 cq_idx, in nicvf_cq_intr_handler() argument
639 struct nicvf *nic = netdev_priv(netdev); in nicvf_cq_intr_handler()
658 netdev_dbg(nic->netdev, "%s CQ%d cqe_count %d cqe_head %d\n", in nicvf_cq_intr_handler()
673 netdev_dbg(nic->netdev, "CQ%d cq_desc->cqe_type %d\n", in nicvf_cq_intr_handler()
677 nicvf_rcv_pkt_handler(netdev, napi, cq, in nicvf_cq_intr_handler()
682 nicvf_snd_pkt_handler(netdev, cq, in nicvf_cq_intr_handler()
695 netdev_dbg(nic->netdev, in nicvf_cq_intr_handler()
709 netdev = nic->pnicvf->netdev; in nicvf_cq_intr_handler()
710 txq = netdev_get_tx_queue(netdev, in nicvf_cq_intr_handler()
713 if (netif_tx_queue_stopped(txq) && netif_carrier_ok(netdev)) { in nicvf_cq_intr_handler()
717 netdev_warn(netdev, in nicvf_cq_intr_handler()
719 netdev->name, cq_idx); in nicvf_cq_intr_handler()
731 struct net_device *netdev = napi->dev; in nicvf_poll() local
732 struct nicvf *nic = netdev_priv(netdev); in nicvf_poll()
736 work_done = nicvf_cq_intr_handler(netdev, cq->cq_idx, napi, budget); in nicvf_poll()
763 netif_tx_disable(nic->netdev); in nicvf_handle_qs_err()
774 nicvf_cq_intr_handler(nic->netdev, qidx, NULL, 0); in nicvf_handle_qs_err()
776 nicvf_sq_free_used_descs(nic->netdev, &qs->sq[qidx], qidx); in nicvf_handle_qs_err()
782 netif_tx_start_all_queues(nic->netdev); in nicvf_handle_qs_err()
790 netdev_info(nic->netdev, "%s: interrupt status 0x%llx\n", in nicvf_dump_intr_status()
791 nic->netdev->name, nicvf_reg_read(nic, NIC_VF_INT)); in nicvf_dump_intr_status()
877 netdev_err(nic->netdev, in nicvf_enable_msix()
944 netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq); in nicvf_register_interrupts()
1008 static netdev_tx_t nicvf_xmit(struct sk_buff *skb, struct net_device *netdev) in nicvf_xmit() argument
1010 struct nicvf *nic = netdev_priv(netdev); in nicvf_xmit()
1012 struct netdev_queue *txq = netdev_get_tx_queue(netdev, qid); in nicvf_xmit()
1024 netdev_warn(netdev, in nicvf_xmit()
1026 netdev->name, qid); in nicvf_xmit()
1047 int nicvf_stop(struct net_device *netdev) in nicvf_stop() argument
1050 struct nicvf *nic = netdev_priv(netdev); in nicvf_stop()
1058 netif_carrier_off(netdev); in nicvf_stop()
1059 netif_tx_stop_all_queues(nic->netdev); in nicvf_stop()
1067 nicvf_stop(nic->snicvf[qidx]->netdev); in nicvf_stop()
1103 netif_tx_disable(netdev); in nicvf_stop()
1125 int nicvf_open(struct net_device *netdev) in nicvf_open() argument
1128 struct nicvf *nic = netdev_priv(netdev); in nicvf_open()
1132 nic->mtu = netdev->mtu; in nicvf_open()
1134 netif_carrier_off(netdev); in nicvf_open()
1149 netif_napi_add(netdev, &cq_poll->napi, nicvf_poll, in nicvf_open()
1156 if (is_zero_ether_addr(netdev->dev_addr)) { in nicvf_open()
1157 eth_hw_addr_random(netdev); in nicvf_open()
1158 nicvf_hw_set_mac_addr(nic, netdev); in nicvf_open()
1163 nicvf_hw_set_mac_addr(nic, netdev); in nicvf_open()
1244 static int nicvf_change_mtu(struct net_device *netdev, int new_mtu) in nicvf_change_mtu() argument
1246 struct nicvf *nic = netdev_priv(netdev); in nicvf_change_mtu()
1256 netdev->mtu = new_mtu; in nicvf_change_mtu()
1262 static int nicvf_set_mac_address(struct net_device *netdev, void *p) in nicvf_set_mac_address() argument
1265 struct nicvf *nic = netdev_priv(netdev); in nicvf_set_mac_address()
1270 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); in nicvf_set_mac_address()
1273 if (nicvf_hw_set_mac_addr(nic, netdev)) in nicvf_set_mac_address()
1287 if (!netif_running(nic->netdev)) in nicvf_update_lmac_stats()
1360 static struct rtnl_link_stats64 *nicvf_get_stats64(struct net_device *netdev, in nicvf_get_stats64() argument
1363 struct nicvf *nic = netdev_priv(netdev); in nicvf_get_stats64()
1398 if (!netif_running(nic->netdev)) in nicvf_reset_task()
1401 nicvf_stop(nic->netdev); in nicvf_reset_task()
1402 nicvf_open(nic->netdev); in nicvf_reset_task()
1403 nic->netdev->trans_start = jiffies; in nicvf_reset_task()
1418 static netdev_features_t nicvf_fix_features(struct net_device *netdev, in nicvf_fix_features() argument
1421 struct nicvf *nic = netdev_priv(netdev); in nicvf_fix_features()
1424 netif_running(netdev) && !nic->loopback_supported) in nicvf_fix_features()
1430 static int nicvf_set_features(struct net_device *netdev, in nicvf_set_features() argument
1433 struct nicvf *nic = netdev_priv(netdev); in nicvf_set_features()
1434 netdev_features_t changed = features ^ netdev->features; in nicvf_set_features()
1439 if ((changed & NETIF_F_LOOPBACK) && netif_running(netdev)) in nicvf_set_features()
1460 struct net_device *netdev; in nicvf_probe() local
1498 netdev = alloc_etherdev_mqs(sizeof(struct nicvf), qcount, qcount); in nicvf_probe()
1499 if (!netdev) { in nicvf_probe()
1504 pci_set_drvdata(pdev, netdev); in nicvf_probe()
1506 SET_NETDEV_DEV(netdev, &pdev->dev); in nicvf_probe()
1508 nic = netdev_priv(netdev); in nicvf_probe()
1509 nic->netdev = netdev; in nicvf_probe()
1537 err = nicvf_set_real_num_queues(netdev, nic->tx_queues, nic->rx_queues); in nicvf_probe()
1541 netdev->hw_features = (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_SG | in nicvf_probe()
1545 netdev->hw_features |= NETIF_F_RXHASH; in nicvf_probe()
1547 netdev->features |= netdev->hw_features; in nicvf_probe()
1548 netdev->hw_features |= NETIF_F_LOOPBACK; in nicvf_probe()
1550 netdev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; in nicvf_probe()
1552 netdev->netdev_ops = &nicvf_netdev_ops; in nicvf_probe()
1553 netdev->watchdog_timeo = NICVF_TX_TIMEOUT; in nicvf_probe()
1557 err = register_netdev(netdev); in nicvf_probe()
1565 nicvf_set_ethtool_ops(netdev); in nicvf_probe()
1573 free_netdev(netdev); in nicvf_probe()
1583 struct net_device *netdev = pci_get_drvdata(pdev); in nicvf_remove() local
1587 if (!netdev) in nicvf_remove()
1590 nic = netdev_priv(netdev); in nicvf_remove()
1591 pnetdev = nic->pnicvf->netdev; in nicvf_remove()
1600 free_netdev(netdev); in nicvf_remove()