From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: qemu-arm@nongnu.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>,
Jason Wang <jasowang@redhat.com>,
qemu-devel@nongnu.org, yurovsky@gmail.com
Subject: [Qemu-devel] [PATCH 02/17] imx_fec: Do not calculate FEC
Date: Mon, 18 Sep 2017 12:50:45 -0700 [thread overview]
Message-ID: <20170918195100.17593-3-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20170918195100.17593-1-andrew.smirnov@gmail.com>
Save some computation time and avoid calculating CRC's frame
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
Cc: yurovsky@gmail.com
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
hw/net/imx_fec.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 88b4b049d7..75822344fc 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -1032,9 +1032,7 @@ static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
IMXENETBufDesc bd;
uint32_t flags = 0;
uint32_t addr;
- uint32_t crc;
uint32_t buf_addr;
- uint8_t *crc_ptr;
unsigned int buf_len;
size_t size = len;
@@ -1048,8 +1046,6 @@ static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
/* 4 bytes for the CRC. */
size += 4;
- crc = cpu_to_be32(crc32(~0, buf, size));
- crc_ptr = (uint8_t *) &crc;
/* Huge frames are truncted. */
if (size > ENET_MAX_FRAME_SIZE) {
@@ -1090,9 +1086,10 @@ static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
dma_memory_write(&address_space_memory, buf_addr, buf, buf_len);
buf += buf_len;
if (size < 4) {
+ const uint8_t zeros[4] = { 0 };
+
dma_memory_write(&address_space_memory, buf_addr + buf_len,
- crc_ptr, 4 - size);
- crc_ptr += 4 - size;
+ zeros, 4 - size);
}
bd.flags &= ~ENET_BD_E;
if (size == 0) {
--
2.13.5
next prev parent reply other threads:[~2017-09-18 19:51 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 19:50 [Qemu-devel] [PATCH 00/17] Initial i.MX7 support Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 01/17] imx_fec: Do not link to netdev Andrey Smirnov
2017-10-06 13:46 ` Peter Maydell
2017-09-18 19:50 ` Andrey Smirnov [this message]
2017-10-06 13:48 ` [Qemu-devel] [PATCH 02/17] imx_fec: Do not calculate FEC Peter Maydell
2017-10-09 14:47 ` Andrey Smirnov
2017-10-09 17:03 ` Peter Maydell
2017-09-18 19:50 ` [Qemu-devel] [PATCH 03/17] imx_fec: Refactor imx_eth_enable_rx() Andrey Smirnov
2017-10-06 13:49 ` Peter Maydell
2017-09-18 19:50 ` [Qemu-devel] [PATCH 04/17] imx_fec: Change queue flushing heuristics Andrey Smirnov
2017-09-22 7:27 ` Jason Wang
2017-09-25 18:10 ` Andrey Smirnov
2017-10-06 13:56 ` Peter Maydell
2017-10-09 14:57 ` Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 05/17] imx_fec: Use ENET_FTRL to determine truncation length Andrey Smirnov
2017-09-30 0:17 ` Philippe Mathieu-Daudé
2017-10-06 14:00 ` Peter Maydell
2017-10-09 15:19 ` Andrey Smirnov
2017-10-06 14:03 ` Peter Maydell
2017-09-18 19:50 ` [Qemu-devel] [PATCH 06/17] imx_fec: Use MIN instead of explicit ternary operator Andrey Smirnov
2017-09-30 0:19 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2017-09-18 19:50 ` [Qemu-devel] [PATCH 07/17] imx_fec: Emulate SHIFT16 in ENETx_RACC Andrey Smirnov
2017-10-06 14:02 ` Peter Maydell
2017-10-09 15:22 ` Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 08/17] imx_fec: Add support for multiple Tx DMA rings Andrey Smirnov
2017-09-22 7:33 ` Jason Wang
2017-09-25 18:23 ` Andrey Smirnov
2017-10-06 14:10 ` Peter Maydell
2017-10-09 15:38 ` Andrey Smirnov
2017-10-09 17:06 ` Peter Maydell
2017-09-18 19:50 ` [Qemu-devel] [PATCH 09/17] imx_fec: Use correct length for packet size Andrey Smirnov
2017-10-06 14:12 ` Peter Maydell
2017-09-18 19:50 ` [Qemu-devel] [PATCH 10/17] sdhci: Add i.MX specific subtype of SDHCI Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 11/17] sdhci: Implement write method of ACMD12ERRSTS register Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 12/17] i.MX: Add i.MX7 CCM, PMU and ANALOG device Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 13/17] i.MX: Add code to emulate i.MX2 watchdog IP block Andrey Smirnov
2017-10-06 14:22 ` Peter Maydell
2017-10-09 15:54 ` Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 14/17] i.MX7: Add code to emulate SNVS IP-block Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 15/17] include/qemu: Add sizes.h from Linux Andrey Smirnov
2017-10-06 14:13 ` Peter Maydell
2017-10-09 15:55 ` Andrey Smirnov
2017-09-18 19:50 ` [Qemu-devel] [PATCH 16/17] i.MX: Add i.MX7 SOC implementation Andrey Smirnov
2017-10-06 14:38 ` Peter Maydell
2017-10-09 16:18 ` Andrey Smirnov
2017-10-09 17:09 ` Peter Maydell
2017-09-18 19:51 ` [Qemu-devel] [PATCH 17/17] Implement support for i.MX7 Sabre board Andrey Smirnov
2017-10-06 14:42 ` Peter Maydell
2017-10-09 16:30 ` Andrey Smirnov
2017-09-18 21:00 ` [Qemu-devel] [PATCH 00/17] Initial i.MX7 support no-reply
2017-10-06 14:46 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918195100.17593-3-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=yurovsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).