]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/niu.c
drivers/net/wireless/b43: fix sparse warnings: make symbols static
[karo-tx-linux.git] / drivers / net / niu.c
index 7b6cdd07c85f0b761a9b42db7b7c3f8860c5b815..0c0b752315cae844c6944b912d8605032070e93c 100644 (file)
@@ -3558,6 +3558,9 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
                if (unlikely(misc & RXMISC_OFLOW))
                        dev_err(np->device, "rx-%d: Counter overflow "
                                "RXMISC discard\n", rx_channel);
+
+               niudbg(RX_ERR, "%s-rx-%d: MISC drop=%u over=%u\n",
+                      np->dev->name, rx_channel, misc, misc-limit);
        }
 
        /* WRED (Weighted Random Early Discard) by hardware */
@@ -3569,6 +3572,9 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
                if (unlikely(wred & RED_DIS_CNT_OFLOW))
                        dev_err(np->device, "rx-%d: Counter overflow "
                                "WRED discard\n", rx_channel);
+
+               niudbg(RX_ERR, "%s-rx-%d: WRED drop=%u over=%u\n",
+                      np->dev->name, rx_channel, wred, wred-limit);
        }
 }
 
@@ -3612,7 +3618,9 @@ static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget)
 
        nw64(RX_DMA_CTL_STAT(rp->rx_channel), stat);
 
-       niu_sync_rx_discard_stats(np, rp, 0x7FFF);
+       /* Only sync discards stats when qlen indicate potential for drops */
+       if (qlen > 10)
+               niu_sync_rx_discard_stats(np, rp, 0x7FFF);
 
        return work_done;
 }
@@ -3661,7 +3669,7 @@ static int niu_poll(struct napi_struct *napi, int budget)
        work_done = niu_poll_core(np, lp, budget);
 
        if (work_done < budget) {
-               netif_rx_complete(np->dev, napi);
+               netif_rx_complete(napi);
                niu_ldg_rearm(np, lp, 1);
        }
        return work_done;
@@ -4080,12 +4088,12 @@ static void __niu_fastpath_interrupt(struct niu *np, int ldg, u64 v0)
 static void niu_schedule_napi(struct niu *np, struct niu_ldg *lp,
                              u64 v0, u64 v1, u64 v2)
 {
-       if (likely(netif_rx_schedule_prep(np->dev, &lp->napi))) {
+       if (likely(netif_rx_schedule_prep(&lp->napi))) {
                lp->v0 = v0;
                lp->v1 = v1;
                lp->v2 = v2;
                __niu_fastpath_interrupt(np, lp->ldg_num, v0);
-               __netif_rx_schedule(np->dev, &lp->napi);
+               __netif_rx_schedule(&lp->napi);
        }
 }
 
@@ -8898,7 +8906,7 @@ static u64 niu_pci_map_page(struct device *dev, struct page *page,
 static void niu_pci_unmap_page(struct device *dev, u64 dma_address,
                               size_t size, enum dma_data_direction direction)
 {
-       return dma_unmap_page(dev, dma_address, size, direction);
+       dma_unmap_page(dev, dma_address, size, direction);
 }
 
 static u64 niu_pci_map_single(struct device *dev, void *cpu_addr,