From: Finn Thain <fthain@telegraphics.com.au>
To: Jason Wang <jasowang@redhat.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org,
Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PULL V2 01/23] dp8393x: Mask EOL bit from descriptor addresses
Date: Wed, 4 Mar 2020 09:44:42 +1100 (AEDT) [thread overview]
Message-ID: <alpine.LNX.2.22.394.2003040842130.9@nippy.intranet> (raw)
In-Reply-To: <1583230242-14597-2-git-send-email-jasowang@redhat.com>
Hi Jason,
The patch in this pull request (since merged) differs from the patch that
I sent. In particular, the change below is missing from commit 88f632fbb1
("dp8393x: Mask EOL bit from descriptor addresses") in mainline.
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -525,8 +525,8 @@ static void dp8393x_do_transmit_packets(dp8393xState *s)
* (4 + 3 * s->regs[SONIC_TFC]),
MEMTXATTRS_UNSPECIFIED, s->data,
size);
- s->regs[SONIC_CTDA] = dp8393x_get(s, width, 0) & ~0x1;
- if (dp8393x_get(s, width, 0) & SONIC_DESC_EOL) {
+ s->regs[SONIC_CTDA] = dp8393x_get(s, width, 0);
+ if (s->regs[SONIC_CTDA] & SONIC_DESC_EOL) {
/* EOL detected */
break;
}
Please compare with "[PATCH v4 01/14] dp8393x: Mask EOL bit from
descriptor addresses" in the mailing list archives:
https://lore.kernel.org/qemu-devel/d6e8d06ad4d02f4a30c4caa6001967f806f21a1a.1580290069.git.fthain@telegraphics.com.au/
It appears that this portion of my patch went missing when merge conflicts
were resolved. The conflicts were apparently caused by commit 19f7034773
("Avoid address_space_rw() with a constant is_write argument").
Regards,
Finn
On Tue, 3 Mar 2020, Jason Wang wrote:
> From: Finn Thain <fthain@telegraphics.com.au>
>
> The Least Significant bit of a descriptor address register is used as
> an EOL flag. It has to be masked when the register value is to be used
> as an actual address for copying memory around. But when the registers
> are to be updated the EOL bit should not be masked.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> Tested-by: Laurent Vivier <laurent@vivier.eu>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/net/dp8393x.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
> index 7045193..216d44b 100644
> --- a/hw/net/dp8393x.c
> +++ b/hw/net/dp8393x.c
> @@ -145,6 +145,9 @@ do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
> #define SONIC_ISR_PINT 0x0800
> #define SONIC_ISR_LCD 0x1000
>
> +#define SONIC_DESC_EOL 0x0001
> +#define SONIC_DESC_ADDR 0xFFFE
> +
> #define TYPE_DP8393X "dp8393x"
> #define DP8393X(obj) OBJECT_CHECK(dp8393xState, (obj), TYPE_DP8393X)
>
> @@ -197,7 +200,8 @@ static uint32_t dp8393x_crba(dp8393xState *s)
>
> static uint32_t dp8393x_crda(dp8393xState *s)
> {
> - return (s->regs[SONIC_URDA] << 16) | s->regs[SONIC_CRDA];
> + return (s->regs[SONIC_URDA] << 16) |
> + (s->regs[SONIC_CRDA] & SONIC_DESC_ADDR);
> }
>
> static uint32_t dp8393x_rbwc(dp8393xState *s)
> @@ -217,7 +221,8 @@ static uint32_t dp8393x_tsa(dp8393xState *s)
>
> static uint32_t dp8393x_ttda(dp8393xState *s)
> {
> - return (s->regs[SONIC_UTDA] << 16) | s->regs[SONIC_TTDA];
> + return (s->regs[SONIC_UTDA] << 16) |
> + (s->regs[SONIC_TTDA] & SONIC_DESC_ADDR);
> }
>
> static uint32_t dp8393x_wt(dp8393xState *s)
> @@ -509,7 +514,7 @@ static void dp8393x_do_transmit_packets(dp8393xState *s)
> MEMTXATTRS_UNSPECIFIED, s->data,
> size);
> s->regs[SONIC_CTDA] = dp8393x_get(s, width, 0) & ~0x1;
> - if (dp8393x_get(s, width, 0) & 0x1) {
> + if (dp8393x_get(s, width, 0) & SONIC_DESC_EOL) {
> /* EOL detected */
> break;
> }
> @@ -765,13 +770,13 @@ static ssize_t dp8393x_receive(NetClientState *nc, const uint8_t * buf,
> /* XXX: Check byte ordering */
>
> /* Check for EOL */
> - if (s->regs[SONIC_LLFA] & 0x1) {
> + if (s->regs[SONIC_LLFA] & SONIC_DESC_EOL) {
> /* Are we still in resource exhaustion? */
> size = sizeof(uint16_t) * 1 * width;
> address = dp8393x_crda(s) + sizeof(uint16_t) * 5 * width;
> address_space_read(&s->as, address, MEMTXATTRS_UNSPECIFIED,
> s->data, size);
> - if (dp8393x_get(s, width, 0) & 0x1) {
> + if (dp8393x_get(s, width, 0) & SONIC_DESC_EOL) {
> /* Still EOL ; stop reception */
> return -1;
> } else {
> @@ -831,7 +836,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, const uint8_t * buf,
> dp8393x_crda(s) + sizeof(uint16_t) * 5 * width,
> MEMTXATTRS_UNSPECIFIED, s->data, size);
> s->regs[SONIC_LLFA] = dp8393x_get(s, width, 0);
> - if (s->regs[SONIC_LLFA] & 0x1) {
> + if (s->regs[SONIC_LLFA] & SONIC_DESC_EOL) {
> /* EOL detected */
> s->regs[SONIC_ISR] |= SONIC_ISR_RDE;
> } else {
>
next prev parent reply other threads:[~2020-03-03 22:46 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 10:10 [PULL V2 00/23] Net patches Jason Wang
2020-03-03 10:10 ` [PULL V2 01/23] dp8393x: Mask EOL bit from descriptor addresses Jason Wang
2020-03-03 22:44 ` Finn Thain [this message]
2020-03-04 2:43 ` Jason Wang
2020-03-03 10:10 ` [PULL V2 02/23] dp8393x: Always use 32-bit accesses Jason Wang
2020-03-03 10:10 ` [PULL V2 03/23] dp8393x: Clean up endianness hacks Jason Wang
2020-03-03 10:10 ` [PULL V2 04/23] dp8393x: Have dp8393x_receive() return the packet size Jason Wang
2020-03-03 10:10 ` [PULL V2 05/23] dp8393x: Update LLFA and CRDA registers from rx descriptor Jason Wang
2020-03-03 10:10 ` [PULL V2 06/23] dp8393x: Clear RRRA command register bit only when appropriate Jason Wang
2020-03-03 10:10 ` [PULL V2 07/23] dp8393x: Implement packet size limit and RBAE interrupt Jason Wang
2020-03-03 10:10 ` [PULL V2 08/23] dp8393x: Don't clobber packet checksum Jason Wang
2020-03-03 10:10 ` [PULL V2 09/23] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode Jason Wang
2020-03-03 10:10 ` [PULL V2 10/23] dp8393x: Pad frames to word or long word boundary Jason Wang
2020-03-03 10:10 ` [PULL V2 11/23] dp8393x: Clear descriptor in_use field to release packet Jason Wang
2020-03-03 10:10 ` [PULL V2 12/23] dp8393x: Always update RRA pointers and sequence numbers Jason Wang
2020-03-03 10:10 ` [PULL V2 13/23] dp8393x: Don't reset Silicon Revision register Jason Wang
2020-03-03 10:10 ` [PULL V2 14/23] dp8393x: Don't stop reception upon RBE interrupt assertion Jason Wang
2020-03-03 10:10 ` [PULL V2 15/23] e1000e: Avoid hw_error if legacy mode used Jason Wang
2020-03-03 10:10 ` [PULL V2 16/23] NetRxPkt: Introduce support for additional hash types Jason Wang
2020-03-03 10:10 ` [PULL V2 17/23] NetRxPkt: fix hash calculation of IPV6 TCP Jason Wang
2020-03-03 10:10 ` [PULL V2 18/23] hw: net: cadence_gem: Fix build errors in DB_PRINT() Jason Wang
2020-03-03 10:10 ` [PULL V2 19/23] block/replication.c: Ignore requests after failover Jason Wang
2020-03-03 10:10 ` [PULL V2 20/23] tests/test-replication.c: Add test for for secondary node continuing replication Jason Wang
2020-03-03 10:10 ` [PULL V2 21/23] net/filter.c: Add Options to insert filters anywhere in the filter list Jason Wang
2020-03-03 10:10 ` [PULL V2 22/23] colo: Update Documentation for continuous replication Jason Wang
2020-03-03 10:10 ` [PULL V2 23/23] l2tpv3: fix RFC number typo in qemu-options.hx Jason Wang
2020-03-03 13:45 ` [PULL V2 00/23] Net patches 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=alpine.LNX.2.22.394.2003040842130.9@nippy.intranet \
--to=fthain@telegraphics.com.au \
--cc=jasowang@redhat.com \
--cc=laurent@vivier.eu \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).