diff options
author | Mykyta Iziumtsev <mykyta.iziumtsev@linaro.org> | 2017-10-19 09:47:36 +0200 |
---|---|---|
committer | Mykyta Iziumtsev <mykyta.iziumtsev@linaro.org> | 2017-10-19 16:37:00 +0200 |
commit | b1a13abb1fa6caeed3098d17dbd281d29db7d170 (patch) | |
tree | c5e4940805ad51d9b996e7109721fccbe7d4017e | |
parent | 57056106c9bf5defc74cf6535e2b89cccab9e698 (diff) |
drivers/e1000e: send 100 test TX packets instead of just 1
-rw-r--r-- | drivers/e1000e.c | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/drivers/e1000e.c b/drivers/e1000e.c index 43fbd66..f3e4cf6 100644 --- a/drivers/e1000e.c +++ b/drivers/e1000e.c @@ -210,26 +210,44 @@ void e1000e_xmit(void *txring, struct iomem data, volatile void *ioaddr) 0x04, 0x74, 0x65, 0x73, 0x74, 0x00, 0x00, 0x01, 0x00, 0x01 }; - const int idx = 0; - e1000_tx_desc_t *tx_desc = (e1000_tx_desc_t *)txring + idx; - char *tx_buff = (char *)(data.vaddr + idx * 2048); - uint32_t txd_cmd = E1000_TXD_CMD_IFCS | E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS | - E1000_TXD_CMD_IDE; - - /* XXX FIXME need proper packet size and sizeof(src) *NOT* dst */ - memcpy(tx_buff, pkt_udp, sizeof(pkt_udp)); - tx_desc->buffer_addr = odpdrv_cpu_to_le_64(data.iova + idx * 2048); - tx_desc->lower.data = odpdrv_cpu_to_le_32(txd_cmd | sizeof(pkt_udp)); - tx_desc->upper.data = odpdrv_cpu_to_le_32(0); - - dma_wmb(); - - printf("Triggering xmit of dummy packet\n"); - printf("tx_desc->buffer_addr == 0x%016lx\n", tx_desc->buffer_addr); - printf("tx_desc->lower == 0x%08x\n", tx_desc->lower.data); - printf("tx_desc->upper == 0x%08x\n", tx_desc->upper.data); - - io_write32(odpdrv_cpu_to_le_32(idx + 1), ioaddr + E1000_TDT_OFFSET); + int idx; + uint32_t txd_cmd = + E1000_TXD_CMD_IFCS | E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS | + E1000_TXD_CMD_IDE; + + for (idx = 0; idx < 100; idx++) { + e1000_tx_desc_t *tx_desc = + (e1000_tx_desc_t *) txring + idx; + char *tx_buff = (char *) (data.vaddr + idx * 2048); + + /* XXX FIXME need proper packet size and sizeof(src) *NOT* dst */ + memcpy(tx_buff, pkt_udp, sizeof(pkt_udp)); + tx_desc->buffer_addr = + odpdrv_cpu_to_le_64(data.iova + idx * 2048); + tx_desc->lower.data = + odpdrv_cpu_to_le_32(txd_cmd | sizeof(pkt_udp)); + tx_desc->upper.data = odpdrv_cpu_to_le_32(0); + + dma_wmb(); + + printf("Triggering xmit of dummy packet\n"); + printf("tx_desc->buffer_addr == 0x%016lx\n", + tx_desc->buffer_addr); + printf("tx_desc->lower == 0x%08x\n", tx_desc->lower.data); + printf("tx_desc->upper == 0x%08x\n", tx_desc->upper.data); + printf("TDT == 0x%08x\n", io_read32(ioaddr + E1000_TDT_OFFSET)); + printf("TDH == 0x%08x\n", io_read32(ioaddr + E1000_TDH_OFFSET)); + + usleep(100 * 1000); + + io_write32(odpdrv_cpu_to_le_32(idx + 1), + ioaddr + E1000_TDT_OFFSET); + + usleep(100 * 1000); + + printf("TDT == 0x%08x\n", io_read32(ioaddr + E1000_TDT_OFFSET)); + printf("TDH == 0x%08x\n", io_read32(ioaddr + E1000_TDH_OFFSET)); + } return; } |