[Qemu-devel] [PATCH 0/4] net: introduce common net_crc32() and net_crc32_le() functions

Mark Cave-Ayland posted 4 patches 6 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1503065708-28277-1-git-send-email-mark.cave-ayland@ilande.co.uk
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
hw/net/eepro100.c |   19 +------------------
hw/net/pcnet.c    |   16 +---------------
include/net/net.h |    5 ++++-
net/net.c         |   38 +++++++++++++++++++++++++++++++++-----
4 files changed, 39 insertions(+), 39 deletions(-)
[Qemu-devel] [PATCH 0/4] net: introduce common net_crc32() and net_crc32_le() functions
Posted by Mark Cave-Ayland 6 years, 8 months ago
Whilst trying to debug a CRC32 endian issue for NIC multicast hash lookups, it
struck me that it would make sense to have a common set of standard ethernet
CRC32 functions (both little and big endian variants) in net.c.

The first two patches introduce the relevant functions while the last two patches
switch the pcnet and eepro100 drivers over to use them, allowing us to remove
their private implementations.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Mark Cave-Ayland (4):
  net: move CRC32 calculation from compute_mcast_idx() into its own
    net_crc32() function
  net: introduce net_crc32_le() function
  pcnet: switch lnc_mchash() over to use net_crc32_le()
  eepro100: switch e100_compute_mcast_idx() over to use net_crc32()

 hw/net/eepro100.c |   19 +------------------
 hw/net/pcnet.c    |   16 +---------------
 include/net/net.h |    5 ++++-
 net/net.c         |   38 +++++++++++++++++++++++++++++++++-----
 4 files changed, 39 insertions(+), 39 deletions(-)

-- 
1.7.10.4


Re: [Qemu-devel] [PATCH 0/4] net: introduce common net_crc32() and net_crc32_le() functions
Posted by Mark Cave-Ayland 6 years, 7 months ago
On 18/08/17 15:15, Mark Cave-Ayland wrote:

> Whilst trying to debug a CRC32 endian issue for NIC multicast hash lookups, it
> struck me that it would make sense to have a common set of standard ethernet
> CRC32 functions (both little and big endian variants) in net.c.
> 
> The first two patches introduce the relevant functions while the last two patches
> switch the pcnet and eepro100 drivers over to use them, allowing us to remove
> their private implementations.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> Mark Cave-Ayland (4):
>   net: move CRC32 calculation from compute_mcast_idx() into its own
>     net_crc32() function
>   net: introduce net_crc32_le() function
>   pcnet: switch lnc_mchash() over to use net_crc32_le()
>   eepro100: switch e100_compute_mcast_idx() over to use net_crc32()
> 
>  hw/net/eepro100.c |   19 +------------------
>  hw/net/pcnet.c    |   16 +---------------
>  include/net/net.h |    5 ++++-
>  net/net.c         |   38 +++++++++++++++++++++++++++++++++-----
>  4 files changed, 39 insertions(+), 39 deletions(-)

Hi Jason,

Any thoughts on this patchset? I now have another virtual NIC
implementation for upstream that makes use of the new net_crc32_le()
function created by this patchset and I would really like to use this
instead of copy/pasting yet another different CRC32 implementation :)


ATB,

Mark.