Lines Matching defs:npinfo
60 struct netpoll_info *npinfo =
65 while ((skb = skb_dequeue(&npinfo->txq))) {
82 skb_queue_head(&npinfo->txq, skb);
86 schedule_delayed_work(&npinfo->tx_work, HZ/10);
129 static int poll_one_napi(struct netpoll_info *npinfo,
141 npinfo->rx_flags |= NETPOLL_RX_DROP;
150 npinfo->rx_flags &= ~NETPOLL_RX_DROP;
163 budget = poll_one_napi(dev->npinfo, napi, budget);
198 service_arp_queue(dev->npinfo);
297 /* It is up to the caller to keep npinfo alive. */
298 struct netpoll_info *npinfo = np->dev->npinfo;
300 if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) {
306 if (skb_queue_len(&npinfo->txq) == 0 && !netpoll_owner_active(dev)) {
345 skb_queue_tail(&npinfo->txq, skb);
346 schedule_delayed_work(&npinfo->tx_work,0);
415 struct netpoll_info *npinfo = skb->dev->npinfo;
426 if (list_empty(&npinfo->rx_np))
431 spin_lock_irqsave(&npinfo->rx_lock, flags);
432 list_for_each_entry_safe(np, tmp, &npinfo->rx_np, rx) {
436 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
476 spin_lock_irqsave(&npinfo->rx_lock, flags);
477 list_for_each_entry_safe(np, tmp, &npinfo->rx_np, rx) {
528 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
537 struct netpoll_info *npinfo = skb->dev->npinfo;
540 if (list_empty(&npinfo->rx_np))
549 skb_queue_tail(&npinfo->arp_tx, skb);
594 list_for_each_entry_safe(np, tmp, &npinfo->rx_np, rx) {
736 struct netpoll_info *npinfo;
749 if (!ndev->npinfo) {
750 npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);
751 if (!npinfo) {
756 npinfo->rx_flags = 0;
757 INIT_LIST_HEAD(&npinfo->rx_np);
759 spin_lock_init(&npinfo->rx_lock);
760 skb_queue_head_init(&npinfo->arp_tx);
761 skb_queue_head_init(&npinfo->txq);
762 INIT_DELAYED_WORK(&npinfo->tx_work, queue_process);
764 atomic_set(&npinfo->refcnt, 1);
768 err = ops->ndo_netpoll_setup(ndev, npinfo);
773 npinfo = ndev->npinfo;
774 atomic_inc(&npinfo->refcnt);
777 npinfo->netpoll = np;
780 spin_lock_irqsave(&npinfo->rx_lock, flags);
781 npinfo->rx_flags |= NETPOLL_RX_ENABLED;
782 list_add_tail(&np->rx, &npinfo->rx_np);
783 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
787 rcu_assign_pointer(ndev->npinfo, npinfo);
792 kfree(npinfo);
899 struct netpoll_info *npinfo;
902 npinfo = np->dev->npinfo;
903 if (!npinfo)
906 if (!list_empty(&npinfo->rx_np)) {
907 spin_lock_irqsave(&npinfo->rx_lock, flags);
909 if (list_empty(&npinfo->rx_np))
910 npinfo->rx_flags &= ~NETPOLL_RX_ENABLED;
911 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
914 if (atomic_dec_and_test(&npinfo->refcnt)) {
921 rcu_assign_pointer(np->dev->npinfo, NULL);
923 /* avoid racing with NAPI reading npinfo */
926 skb_queue_purge(&npinfo->arp_tx);
927 skb_queue_purge(&npinfo->txq);
928 cancel_rearming_delayed_work(&npinfo->tx_work);
931 __skb_queue_purge(&npinfo->txq);
932 kfree(npinfo);