qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 88f632: dp8393x: Mask EOL bit from descriptor


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 88f632: dp8393x: Mask EOL bit from descriptor addresses
Date: Tue, 03 Mar 2020 05:45:17 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 88f632fbb1b3d31d5b6978d28f8735a6ed18b8f5
      
https://github.com/qemu/qemu/commit/88f632fbb1b3d31d5b6978d28f8735a6ed18b8f5
  Author: Finn Thain <address@hidden>
  Date:   2020-03-02 (Mon, 02 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Mask EOL bit from descriptor addresses

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 <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 3fe9a838ec3eae1374ced16b63bf56894b2ffbe6
      
https://github.com/qemu/qemu/commit/3fe9a838ec3eae1374ced16b63bf56894b2ffbe6
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Always use 32-bit accesses

The DP83932 and DP83934 have 32 data lines. The datasheet says,

    Data Bus: These bidirectional lines are used to transfer data on the
    system bus. When the SONIC is a bus master, 16-bit data is transferred
    on D15-D0 and 32-bit data is transferred on D31-D0. When the SONIC is
    accessed as a slave, register data is driven onto lines D15-D0.
    D31-D16 are held TRI-STATE if SONIC is in 16-bit mode. If SONIC is in
    32-bit mode, they are driven, but invalid.

Always use 32-bit accesses both as bus master and bus slave.

Force the MSW to zero in bus master mode.

This gets the Linux 'jazzsonic' driver working, and avoids the need for
prior hacks to make the NetBSD 'sn' driver work.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 46ffee9ad43185cbee4182c208bbd534814086ca
      
https://github.com/qemu/qemu/commit/46ffee9ad43185cbee4182c208bbd534814086ca
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Clean up endianness hacks

According to the datasheet, section 3.4.4, "in 32-bit mode ... the SONIC
always writes long words".

Therefore, use the same technique for the 'in_use' field that is used
everywhere else, and write the full long word.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 9e3cd456d85ad45e72bdba99203302342ce29b3b
      
https://github.com/qemu/qemu/commit/9e3cd456d85ad45e72bdba99203302342ce29b3b
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Have dp8393x_receive() return the packet size

This function re-uses its 'size' argument as a scratch variable.
Instead, declare a local 'size' variable for that purpose so that the
function result doesn't get messed up.

Signed-off-by: Finn Thain <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 5b0c98fcb7ac006bd8efe0e0fecba52c43a9d028
      
https://github.com/qemu/qemu/commit/5b0c98fcb7ac006bd8efe0e0fecba52c43a9d028
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Update LLFA and CRDA registers from rx descriptor

Follow the algorithm given in the National Semiconductor DP83932C
datasheet in section 3.4.7:

    At the next reception, the SONIC re-reads the last RXpkt.link field,
    and updates its CRDA register to point to the next descriptor.

The chip is designed to allow the host to provide a new list of
descriptors in this way.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: a3cce2825a0b12bb717a5106daaca245557cc9ae
      
https://github.com/qemu/qemu/commit/a3cce2825a0b12bb717a5106daaca245557cc9ae
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Clear RRRA command register bit only when appropriate

It doesn't make sense to clear the command register bit unless the
command was actually issued.

Signed-off-by: Finn Thain <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: ada74315270d1dcabf4c9d4fece19df7ef5b9577
      
https://github.com/qemu/qemu/commit/ada74315270d1dcabf4c9d4fece19df7ef5b9577
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Implement packet size limit and RBAE interrupt

Add a bounds check to prevent a large packet from causing a buffer
overflow. This is defensive programming -- I haven't actually tried
sending an oversized packet or a jumbo ethernet frame.

The SONIC handles packets that are too big for the buffer by raising
the RBAE interrupt and dropping them. Linux uses that interrupt to
count dropped packets.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: bae112b80c9c42cea21ee7623c283668c3451c2e
      
https://github.com/qemu/qemu/commit/bae112b80c9c42cea21ee7623c283668c3451c2e
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Don't clobber packet checksum

A received packet consumes pkt_size bytes in the buffer and the frame
checksum that's appended to it consumes another 4 bytes. The Receive
Buffer Address register takes the former quantity into account but
not the latter. So the next packet written to the buffer overwrites
the frame checksum. Fix this.

Signed-off-by: Finn Thain <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: ea2270279bc2e1635cb6e909e22e17e630198773
      
https://github.com/qemu/qemu/commit/ea2270279bc2e1635cb6e909e22e17e630198773
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Use long-word-aligned RRA pointers in 32-bit mode

Section 3.4.1 of the datasheet says,

    The alignment of the RRA is confined to either word or long word
    boundaries, depending upon the data width mode. In 16-bit mode,
    the RRA must be aligned to a word boundary (A0 is always zero)
    and in 32-bit mode, the RRA is aligned to a long word boundary
    (A0 and A1 are always zero).

This constraint has been implemented for 16-bit mode; implement it
for 32-bit mode too.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 350e7d9a77d3b9ac74d240e4b232db1ebe5c05bc
      
https://github.com/qemu/qemu/commit/350e7d9a77d3b9ac74d240e4b232db1ebe5c05bc
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Pad frames to word or long word boundary

The existing code has a bug where the Remaining Buffer Word Count (RBWC)
is calculated with a truncating division, which gives the wrong result
for odd-sized packets.

Section 1.4.1 of the datasheet says,

    Once the end of the packet has been reached, the serializer will
    fill out the last word (16-bit mode) or long word (32-bit mode)
    if the last byte did not end on a word or long word boundary
    respectively. The fill byte will be 0FFh.

Implement buffer padding so that buffer limits are correctly enforced.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: d9fae13196a31716f45dcddcdd958fbb8e59b35a
      
https://github.com/qemu/qemu/commit/d9fae13196a31716f45dcddcdd958fbb8e59b35a
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Clear descriptor in_use field to release packet

When the SONIC receives a packet into the last available descriptor, it
retains ownership of that descriptor for as long as necessary.

Section 3.4.7 of the datasheet says,

    When the system appends more descriptors, the SONIC releases ownership
    of the descriptor after writing 0000h to the RXpkt.in_use field.

The packet can now be processed by the host, so raise a PKTRX interrupt,
just like the normal case.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 80b60673ea598869050c66d95d8339480e4cefd0
      
https://github.com/qemu/qemu/commit/80b60673ea598869050c66d95d8339480e4cefd0
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Always update RRA pointers and sequence numbers

These operations need to take place regardless of whether or not
rx descriptors have been used up (that is, EOL flag was observed).

The algorithm is now the same for a packet that was withheld as for
a packet that was not.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 083e21bbdde7dbd326baf29d21f49fc3f5614496
      
https://github.com/qemu/qemu/commit/083e21bbdde7dbd326baf29d21f49fc3f5614496
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Don't reset Silicon Revision register

The jazzsonic driver in Linux uses the Silicon Revision register value
to probe the chip. The driver fails unless the SR register contains 4.
Unfortunately, reading this register in QEMU usually returns 0 because
the s->regs[] array gets wiped after a software reset.

Fixes: bd8f1ebce4 ("net/dp8393x: fix hardware reset")
Suggested-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Finn Thain <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: c2279bd0a19b35057f2e4c3b4df9a915717d1142
      
https://github.com/qemu/qemu/commit/c2279bd0a19b35057f2e4c3b4df9a915717d1142
  Author: Finn Thain <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Don't stop reception upon RBE interrupt assertion

Section 3.4.7 of the datasheet explains that,

    The RBE bit in the Interrupt Status register is set when the
    SONIC finishes using the second to last receive buffer and reads
    the last RRA descriptor. Actually, the SONIC is not truly out of
    resources, but gives the system an early warning of an impending
    out of resources condition.

RBE does not mean actual receive buffer exhaustion, and reception should
not be stopped. This is important because Linux will not check and clear
the RBE interrupt until it receives another packet. But that won't
happen if can_receive returns false. This bug causes the SONIC to become
deaf (until reset).

Fix this with a new flag to indicate actual receive buffer exhaustion.

Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: b559ea95eaee8cbf72d910e8f98d2601c7f74f97
      
https://github.com/qemu/qemu/commit/b559ea95eaee8cbf72d910e8f98d2601c7f74f97
  Author: Yuri Benditovich <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/e1000e_core.c

  Log Message:
  -----------
  e1000e: Avoid hw_error if legacy mode used

https://bugzilla.redhat.com/show_bug.cgi?id=1787142
The emulation issues hw_error if PSRCTL register
is written, for example, with zero value.
Such configuration does not present any problem when
DTYP bits of RCTL register define legacy format of
transfer descriptors. Current commit discards check
for BSIZE0 and BSIZE1 when legacy mode used.

Acked-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Yuri Benditovich <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 33bbc05eabe5109d270faf10493a3ebebd541ecd
      
https://github.com/qemu/qemu/commit/33bbc05eabe5109d270faf10493a3ebebd541ecd
  Author: Yuri Benditovich <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/net_rx_pkt.c
    M hw/net/net_rx_pkt.h
    M hw/net/trace-events

  Log Message:
  -----------
  NetRxPkt: Introduce support for additional hash types

Add support for following hash types:
IPV6 TCP with extension headers
IPV4 UDP
IPV6 UDP
IPV6 UDP with extension headers

Signed-off-by: Yuri Benditovich <address@hidden>
Acked-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 2683a927ff21b54a7300ac70c3c89652f2194969
      
https://github.com/qemu/qemu/commit/2683a927ff21b54a7300ac70c3c89652f2194969
  Author: Yuri Benditovich <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/e1000e_core.c
    M hw/net/net_rx_pkt.c

  Log Message:
  -----------
  NetRxPkt: fix hash calculation of IPV6 TCP

When requested to calculate the hash for TCPV6 packet,
ignore overrides of source and destination addresses
in in extension headers.
Use these overrides when new hash type NetPktRssIpV6TcpEx
requested.
Use this type in e1000e hash calculation for IPv6 TCP, which
should take in account overrides of the addresses.

Signed-off-by: Yuri Benditovich <address@hidden>
Acked-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: dda8f1854b8efae1dd30b666e8358f9b2ed8ae48
      
https://github.com/qemu/qemu/commit/dda8f1854b8efae1dd30b666e8358f9b2ed8ae48
  Author: Bin Meng <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M hw/net/cadence_gem.c

  Log Message:
  -----------
  hw: net: cadence_gem: Fix build errors in DB_PRINT()

When CADENCE_GEM_ERR_DEBUG is turned on, there are several
compilation errors in DB_PRINT(). Fix them.

While we are here, update to use appropriate modifiers in
the same DB_PRINT() call.

Signed-off-by: Bin Meng <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 08ddb4eb6d47d241257027751138001484c594b2
      
https://github.com/qemu/qemu/commit/08ddb4eb6d47d241257027751138001484c594b2
  Author: Lukas Straub <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M block/replication.c

  Log Message:
  -----------
  block/replication.c: Ignore requests after failover

After failover the Secondary side of replication shouldn't change state, because
it now functions as our primary disk.

In replication_start, replication_do_checkpoint, replication_stop, ignore
the request if current state is BLOCK_REPLICATION_DONE (sucessful failover) or
BLOCK_REPLICATION_FAILOVER (failover in progres i.e. currently merging active
and hidden images into the base image).

Signed-off-by: Lukas Straub <address@hidden>
Reviewed-by: Zhang Chen <address@hidden>
Acked-by: Max Reitz <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 7b9e215ed6381a1447d016a397f8b07d9dc652d3
      
https://github.com/qemu/qemu/commit/7b9e215ed6381a1447d016a397f8b07d9dc652d3
  Author: Lukas Straub <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M tests/test-replication.c

  Log Message:
  -----------
  tests/test-replication.c: Add test for for secondary node continuing 
replication

This simulates the case that happens when we resume COLO after failover.

Signed-off-by: Lukas Straub <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 1973136532f75fdcf78251317e3c97b950595155
      
https://github.com/qemu/qemu/commit/1973136532f75fdcf78251317e3c97b950595155
  Author: Lukas Straub <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M include/net/filter.h
    M net/filter.c
    M qemu-options.hx

  Log Message:
  -----------
  net/filter.c: Add Options to insert filters anywhere in the filter list

To switch the Secondary to Primary, we need to insert new filters
before the filter-rewriter.

Add the options insert= and position= to be able to insert filters
anywhere in the filter list.

position should be "head" or "tail" to insert at the head or
tail of the filter list or it should be "id=<id>" to specify
the id of another filter.
insert should be either "before" or "behind" to specify where to
insert the new filter relative to the one specified with position.

Signed-off-by: Lukas Straub <address@hidden>
Reviewed-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 90dfe59b33c9c20b81641d46a4dddbe89c5fba7a
      
https://github.com/qemu/qemu/commit/90dfe59b33c9c20b81641d46a4dddbe89c5fba7a
  Author: Lukas Straub <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M docs/COLO-FT.txt
    M docs/block-replication.txt

  Log Message:
  -----------
  colo: Update Documentation for continuous replication

Document the qemu command-line and qmp commands for continuous replication

Signed-off-by: Lukas Straub <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 21843dc48e38c27cbddb85b4719000c70a70b6bc
      
https://github.com/qemu/qemu/commit/21843dc48e38c27cbddb85b4719000c70a70b6bc
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  l2tpv3: fix RFC number typo in qemu-options.hx

The L2TPv3 RFC number is 3931:
https://tools.ietf.org/html/rfc3931

Reported-by: Henrik Johansson <address@hidden>
Reviewed-by: Stefan Weil <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 104933c4a973960dea605b06fcd5d0d478255d77
      
https://github.com/qemu/qemu/commit/104933c4a973960dea605b06fcd5d0d478255d77
  Author: Peter Maydell <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M block/replication.c
    M docs/COLO-FT.txt
    M docs/block-replication.txt
    M hw/net/cadence_gem.c
    M hw/net/dp8393x.c
    M hw/net/e1000e_core.c
    M hw/net/net_rx_pkt.c
    M hw/net/net_rx_pkt.h
    M hw/net/trace-events
    M include/net/filter.h
    M net/filter.c
    M qemu-options.hx
    M tests/test-replication.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into 
staging

# gpg: Signature made Tue 03 Mar 2020 10:06:06 GMT
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <address@hidden>" 
[marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request: (23 commits)
  l2tpv3: fix RFC number typo in qemu-options.hx
  colo: Update Documentation for continuous replication
  net/filter.c: Add Options to insert filters anywhere in the filter list
  tests/test-replication.c: Add test for for secondary node continuing 
replication
  block/replication.c: Ignore requests after failover
  hw: net: cadence_gem: Fix build errors in DB_PRINT()
  NetRxPkt: fix hash calculation of IPV6 TCP
  NetRxPkt: Introduce support for additional hash types
  e1000e: Avoid hw_error if legacy mode used
  dp8393x: Don't stop reception upon RBE interrupt assertion
  dp8393x: Don't reset Silicon Revision register
  dp8393x: Always update RRA pointers and sequence numbers
  dp8393x: Clear descriptor in_use field to release packet
  dp8393x: Pad frames to word or long word boundary
  dp8393x: Use long-word-aligned RRA pointers in 32-bit mode
  dp8393x: Don't clobber packet checksum
  dp8393x: Implement packet size limit and RBAE interrupt
  dp8393x: Clear RRRA command register bit only when appropriate
  dp8393x: Update LLFA and CRDA registers from rx descriptor
  dp8393x: Have dp8393x_receive() return the packet size
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/2ac031d171cc...104933c4a973



reply via email to

[Prev in Thread] Current Thread [Next in Thread]