From nobody Wed Oct 29 07:12:01 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 1513364018647464.3352794851653; Fri, 15 Dec 2017 10:53:38 -0800 (PST) Received: from localhost ([::1]:48179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePv6y-0006PP-2h for importer@patchew.org; Fri, 15 Dec 2017 13:53:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePv05-00015l-AJ for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:46:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePv04-0005ha-4z for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:46:25 -0500 Received: from chuckie.co.uk ([82.165.15.123]:60863 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 1ePv03-0005gF-Um for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:46:24 -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 1ePuwH-0006JD-7d; Fri, 15 Dec 2017 18:42:30 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, jasowang@redhat.com, sw@weilnetz.de Date: Fri, 15 Dec 2017 18:41:54 +0000 Message-Id: <20171215184155.2543-13-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 12/13] rtl8139: 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/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index a6b2a9f7a4..1cc95b8cba 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -882,7 +882,7 @@ static ssize_t rtl8139_do_receive(NetClientState *nc, c= onst uint8_t *buf, size_t return size; } =20 - int mcast_idx =3D compute_mcast_idx(buf); + int mcast_idx =3D net_crc32(buf, ETH_ALEN) >> 26; =20 if (!(s->mult[mcast_idx >> 3] & (1 << (mcast_idx & 7)))) { --=20 2.11.0