qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7d08c7: e1000, e1000e: Move per-packet TX off


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7d08c7: e1000, e1000e: Move per-packet TX offload flags ou...
Date: Mon, 08 Jan 2018 02:10:00 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7d08c73e7bdc39b10e5f2f5acdce700f17ffe962
      
https://github.com/qemu/qemu/commit/7d08c73e7bdc39b10e5f2f5acdce700f17ffe962
  Author: Ed Swierk via Qemu-devel <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/e1000.c
    M hw/net/e1000e.c
    M hw/net/e1000e_core.c
    M hw/net/e1000e_core.h
    M hw/net/e1000x_common.h

  Log Message:
  -----------
  e1000, e1000e: Move per-packet TX offload flags out of context state

sum_needed and cptse flags are received from the guest within each
transmit data descriptor. They are not part of the offload context;
instead, they determine how to apply a previously received context to
the packet being transmitted:

- If cptse is set, perform both segmentation and checksum offload
  using the parameters in the TSO context; otherwise just do checksum
  offload. (Currently the e1000 device incorrectly stores only one
  context, which will be fixed in a subsequent patch.)

- Depending on the bits set in sum_needed, possibly perform L4
  checksum offload and/or IP checksum offload, using the parameters in
  the appropriate context.

Move these flags out of struct e1000x_txd_props, which is otherwise
dedicated to storing values from a context descriptor, and into the
per-packet TX struct.

Signed-off-by: Ed Swierk <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: d62644b46a86bce2c069af7122501e3ffd349d3c
      
https://github.com/qemu/qemu/commit/d62644b46a86bce2c069af7122501e3ffd349d3c
  Author: Ed Swierk via Qemu-devel <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/e1000.c

  Log Message:
  -----------
  e1000: Separate TSO and non-TSO contexts, fixing UDP TX corruption

The device is supposed to maintain two distinct contexts for transmit
offloads: one has parameters for both segmentation and checksum
offload, the other only for checksum offload. The guest driver can
send two context descriptors, one for each context (the TSE flag
specifies which). Then the guest can refer to one or the other context
in subsequent transmit data descriptors, depending on what offloads it
wants applied to each packet.

Currently the e1000 device stores just one context, and misinterprets
the TSE flags in the context and data descriptors. This is often okay:
Linux happens to send a fresh context descriptor before every data
descriptor, so forgetting the other context doesn't matter. Windows
does rely on separate contexts for TSO vs. non-TSO packets, but for
mostly-TCP traffic the two contexts have identical TCP-specific
offload parameters so confusing them doesn't matter.

One case where this confusion matters is when a Windows guest sets up
a TSO context for TCP and a non-TSO context for UDP, and then
transmits both TCP and UDP traffic in parallel. The e1000 device
sometimes ends up using TCP-specific parameters while doing checksum
offload on a UDP datagram: it writes the checksum to offset 16 (the
correct location for a TCP checksum), stomping on two bytes of UDP
data, and leaving the wrong value in the actual UDP checksum field at
offset 6. (Even worse, the host network stack may then recompute the
UDP checksum, "correcting" it to match the corrupt data before sending
it out a physical interface.)

Correct this by tracking the TSO context independently of the non-TSO
context, and selecting the appropriate context based on the TSE flag
in each transmit data descriptor.

Signed-off-by: Ed Swierk <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: eaba8f34f0dac5e9296df9c2046d9601264c46a4
      
https://github.com/qemu/qemu/commit/eaba8f34f0dac5e9296df9c2046d9601264c46a4
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/eepro100.c
    M include/net/net.h
    M net/net.c

  Log Message:
  -----------
  net: move CRC32 calculation from compute_mcast_idx() into its own net_crc32() 
function

Separate out the standard ethernet CRC32 calculation into a new net_crc32()
function, renaming the constant POLYNOMIAL to POLYNOMIAL_BE to make it clear
that this is a big-endian CRC32 calculation.

As part of the constant rename, remove the duplicate definition of POLYNOMIAL
from eepro100.c and use the new POLYNOMIAL_BE constant instead.

Once this is complete remove the existing CRC32 implementation from
compute_mcast_idx() and call the new net_crc32() function in its place.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: f1a7deb900f4d87ca7ff602454e35aa65ff81567
      
https://github.com/qemu/qemu/commit/f1a7deb900f4d87ca7ff602454e35aa65ff81567
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M include/net/net.h
    M net/net.c

  Log Message:
  -----------
  net: introduce net_crc32_le() function

This provides a standard ethernet CRC32 little-endian implementation.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: cbbeca91819c8e08f4b85777f8dd1671314db586
      
https://github.com/qemu/qemu/commit/cbbeca91819c8e08f4b85777f8dd1671314db586
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/pcnet.c

  Log Message:
  -----------
  pcnet: switch pcnet over to use net_crc32_le()

Instead of lnc_mchash() using its own implementation, we can simply call
net_crc32_le() directly and apply the bit shift inline.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 7c0348bd633aff5ff27d5c393008495175ca416b
      
https://github.com/qemu/qemu/commit/7c0348bd633aff5ff27d5c393008495175ca416b
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/eepro100.c

  Log Message:
  -----------
  eepro100: switch eepro100 e100_compute_mcast_idx() over to use net_crc32()

Instead of e100_compute_mcast_idx() using its own implementation, we can
simply call net_crc32() directly and apply the bit shift inline.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Stefan Weil <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: a89a6b052abff87871800406bd3c598fcf406426
      
https://github.com/qemu/qemu/commit/a89a6b052abff87871800406bd3c598fcf406426
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/sunhme.c

  Log Message:
  -----------
  sunhme: switch sunhme over to use net_crc32_le()

Instead of sunhme_crc32_le() using its own implementation, we can simply call
net_crc32_le() directly and apply the bit shift inline.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 8f90bc2f8fbba3c98116e80afd537fb0ca90be2e
      
https://github.com/qemu/qemu/commit/8f90bc2f8fbba3c98116e80afd537fb0ca90be2e
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/sungem.c

  Log Message:
  -----------
  sungem: fix multicast filter CRC calculation

>From the Linux sungem driver, we know that the multicast filter CRC is
implemented using ether_crc_le() which isn't the same as calling zlib's
crc32() function (the zlib implementation requires a complemented initial value
and also returns the complemented result).

Fix the multicast filter by simply using the new net_crc32_le() function.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: d00d6d005424dd2447f8b0394e945909852a4282
      
https://github.com/qemu/qemu/commit/d00d6d005424dd2447f8b0394e945909852a4282
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/eepro100.c

  Log Message:
  -----------
  eepro100: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 308913bb431104f34f5c2e35eaaf297ff3e8ec7b
      
https://github.com/qemu/qemu/commit/308913bb431104f34f5c2e35eaaf297ff3e8ec7b
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/opencores_eth.c

  Log Message:
  -----------
  opencores_eth: use inline net_crc32() and bitshift instead of 
compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: eedeaee73ac47341efca4c06e3ccb0029ee9332f
      
https://github.com/qemu/qemu/commit/eedeaee73ac47341efca4c06e3ccb0029ee9332f
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/lan9118.c

  Log Message:
  -----------
  lan9118: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 4227be63f081e939ae7313b1921d8f60a5d8d714
      
https://github.com/qemu/qemu/commit/4227be63f081e939ae7313b1921d8f60a5d8d714
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/ftgmac100.c

  Log Message:
  -----------
  ftgmac100: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 084e2b111bb9c809fd53563e3b5ef1ea3bef08ad
      
https://github.com/qemu/qemu/commit/084e2b111bb9c809fd53563e3b5ef1ea3bef08ad
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/ne2000.c

  Log Message:
  -----------
  ne2000: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: e7a58fc71ca039ae46590e9395467cea283d259c
      
https://github.com/qemu/qemu/commit/e7a58fc71ca039ae46590e9395467cea283d259c
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M hw/net/rtl8139.c

  Log Message:
  -----------
  rtl8139: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: d9caeb09b107e91122d10ba4a08a4af2b59c69cf
      
https://github.com/qemu/qemu/commit/d9caeb09b107e91122d10ba4a08a4af2b59c69cf
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M net/net.c

  Log Message:
  -----------
  net: remove unused compute_mcast_idx() function

Now that all of the callers have been converted to compute the multicast index
inline using new net CRC functions, this function can now be dropped.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 3a22ee27340aee063b442daa37ae684e9a114a91
      
https://github.com/qemu/qemu/commit/3a22ee27340aee063b442daa37ae684e9a114a91
  Author: Thomas Huth <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M include/net/slirp.h
    M net/net.c
    M net/slirp.c
    M qemu-doc.texi

  Log Message:
  -----------
  net: Remove the legacy "-net channel" parameter

It has never been documented, so hardly anybody knows about this
parameter, and it is marked as deprecated since QEMU v2.6.
Time to let it go now.

Reviewed-by: Samuel Thibault <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 0e60a82d9b15be9531c2567cf9f0b509006f174f
      
https://github.com/qemu/qemu/commit/0e60a82d9b15be9531c2567cf9f0b509006f174f
  Author: Thomas Huth <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  qemu-doc: The "-net nic" option can be used with "netdev=...", too

Looks like we missed to document that it is also possible to specify
a netdev with "-net nic" - which is very useful if you want to
configure your on-board NIC to use a backend that has been specified
with "-netdev".

Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 0065e915192cdf83c2700bb377e5323c2649476e
      
https://github.com/qemu/qemu/commit/0065e915192cdf83c2700bb377e5323c2649476e
  Author: Thomas Huth <address@hidden>
  Date:   2017-12-22 (Fri, 22 Dec 2017)

  Changed paths:
    M qemu-doc.texi

  Log Message:
  -----------
  qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb

The information how to update the deprecated parameters was too scarce,
so that some people did not update to the new syntax yet. Provide some
more information to make sure that it is clear how to update from the
old syntax to the new one.

Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 8671016261cd5dfba1042aef0a632a77b0d387a2
      
https://github.com/qemu/qemu/commit/8671016261cd5dfba1042aef0a632a77b0d387a2
  Author: Peter Maydell <address@hidden>
  Date:   2018-01-08 (Mon, 08 Jan 2018)

  Changed paths:
    M hw/net/e1000.c
    M hw/net/e1000e.c
    M hw/net/e1000e_core.c
    M hw/net/e1000e_core.h
    M hw/net/e1000x_common.h
    M hw/net/eepro100.c
    M hw/net/ftgmac100.c
    M hw/net/lan9118.c
    M hw/net/ne2000.c
    M hw/net/opencores_eth.c
    M hw/net/pcnet.c
    M hw/net/rtl8139.c
    M hw/net/sungem.c
    M hw/net/sunhme.c
    M include/net/net.h
    M include/net/slirp.h
    M net/net.c
    M net/slirp.c
    M qemu-doc.texi
    M qemu-options.hx

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

# gpg: Signature made Fri 22 Dec 2017 02:12:29 GMT
# gpg:                using RSA key 0xEF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <address@hidden>"
# 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:
  qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb
  qemu-doc: The "-net nic" option can be used with "netdev=...", too
  net: Remove the legacy "-net channel" parameter
  net: remove unused compute_mcast_idx() function
  rtl8139: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  ne2000: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  ftgmac100: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  lan9118: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  opencores_eth: use inline net_crc32() and bitshift instead of 
compute_mcast_idx()
  eepro100: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  sungem: fix multicast filter CRC calculation
  sunhme: switch sunhme over to use net_crc32_le()
  eepro100: switch eepro100 e100_compute_mcast_idx() over to use net_crc32()
  pcnet: switch pcnet over to use net_crc32_le()
  net: introduce net_crc32_le() function
  net: move CRC32 calculation from compute_mcast_idx() into its own net_crc32() 
function
  e1000: Separate TSO and non-TSO contexts, fixing UDP TX corruption
  e1000, e1000e: Move per-packet TX offload flags out of context state

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


Compare: https://github.com/qemu/qemu/compare/281f327487c9...8671016261cd

reply via email to

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