From 1362f30a059bb44bc00a30e2e894fbdd0d6d5459 Mon Sep 17 00:00:00 2001 From: Patrick Bruenn Date: Tue, 12 Apr 2016 11:17:36 +0200 Subject: [PATCH] devices/ccat: revert "limit rx processing to one frame per poll" revert "limit rx processing to one frame per poll", which caused etherlab frame timeouts in setups with more than one frame per cycle. --- devices/ccat/module.h | 2 +- devices/ccat/netdev.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/devices/ccat/module.h b/devices/ccat/module.h index b0d139b6..529334d3 100644 --- a/devices/ccat/module.h +++ b/devices/ccat/module.h @@ -29,7 +29,7 @@ #include "../ecdev.h" #define DRV_EXTRAVERSION "-ec" -#define DRV_VERSION "0.14" DRV_EXTRAVERSION +#define DRV_VERSION "0.15" DRV_EXTRAVERSION #define DRV_DESCRIPTION "Beckhoff CCAT Ethernet/EtherCAT Network Driver" #undef pr_fmt diff --git a/devices/ccat/netdev.c b/devices/ccat/netdev.c index c8afc3c1..f104dbbf 100644 --- a/devices/ccat/netdev.c +++ b/devices/ccat/netdev.c @@ -291,7 +291,7 @@ static int ccat_dma_init(struct ccat_dma_mem *const dma, size_t channel, iowrite32((u32) phys | ((phys_hi) > 0), ioaddr); iowrite32(phys_hi, ioaddr + 4); - pr_debug + pr_info ("DMA%llu mem initialized\n base: 0x%p\n start: 0x%p\n phys: 0x%09llx\n pci addr: 0x%01x%08x\n size: %llu |%llx bytes.\n", (u64) channel, dma->base, fifo->dma.start, (u64) dma->phys, ioread32(ioaddr + 4), ioread32(ioaddr), @@ -749,12 +749,14 @@ static void poll_link(struct ccat_eth_priv *const priv) static void poll_rx(struct ccat_eth_priv *const priv) { struct ccat_eth_fifo *const fifo = &priv->rx_fifo; - const size_t len = fifo->ops->ready(fifo); + size_t rx_per_poll = FIFO_LENGTH / 2; + size_t len = fifo->ops->ready(fifo); - if (len) { + while (len && --rx_per_poll) { priv->receive(priv, len); fifo->ops->add(fifo); ccat_eth_fifo_inc(fifo); + len = fifo->ops->ready(fifo); } }