From nobody Wed Oct 29 07:16:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513363765121351.40890894643064; Fri, 15 Dec 2017 10:49:25 -0800 (PST) Received: from localhost ([::1]:48155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePv2k-0002ty-Ae for importer@patchew.org; Fri, 15 Dec 2017 13:49:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePv09-00019U-GR for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:46:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePv08-0005qR-MK for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:46:29 -0500 Received: from chuckie.co.uk ([82.165.15.123]:60869 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePv08-0005pA-GA for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:46:28 -0500 Received: from host109-153-37-215.range109-153.btcentralplus.com ([109.153.37.215] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ePuwG-0006JD-3g; Fri, 15 Dec 2017 18:42:29 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, jasowang@redhat.com, sw@weilnetz.de Date: Fri, 15 Dec 2017 18:41:53 +0000 Message-Id: <20171215184155.2543-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171215184155.2543-1-mark.cave-ayland@ilande.co.uk> References: <20171215184155.2543-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.153.37.215 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCHv3 11/13] ne2000: use inline net_crc32() and bitshift instead of compute_mcast_idx() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This makes it much easier to compare the multicast CRC calculation endian a= nd bitshift against the Linux driver implementation. Signed-off-by: Mark Cave-Ayland --- hw/net/ne2000.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 3938e6ddd8..7e3b77c00f 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "hw/pci/pci.h" #include "net/net.h" +#include "net/eth.h" #include "ne2000.h" #include "hw/loader.h" #include "sysemu/sysemu.h" @@ -201,7 +202,7 @@ ssize_t ne2000_receive(NetClientState *nc, const uint8_= t *buf, size_t size_) /* multicast */ if (!(s->rxcr & 0x08)) return size; - mcast_idx =3D compute_mcast_idx(buf); + mcast_idx =3D net_crc32(buf, ETH_ALEN) >> 26; if (!(s->mult[mcast_idx >> 3] & (1 << (mcast_idx & 7)))) return size; } else if (s->mem[0] =3D=3D buf[0] && --=20 2.11.0