From nobody Sun Nov 2 16:40:00 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 1527575502828363.3454700126879; Mon, 28 May 2018 23:31:42 -0700 (PDT) Received: from localhost ([::1]:59206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNYAQ-0002kA-Ci for importer@patchew.org; Tue, 29 May 2018 02:31:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNY83-0001Mh-TA for qemu-devel@nongnu.org; Tue, 29 May 2018 02:29:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNY80-0001Wv-Kc for qemu-devel@nongnu.org; Tue, 29 May 2018 02:29:07 -0400 Received: from 7.mo2.mail-out.ovh.net ([188.165.48.182]:38675) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNY80-0001WB-EM for qemu-devel@nongnu.org; Tue, 29 May 2018 02:29:04 -0400 Received: from player718.ha.ovh.net (unknown [10.109.108.63]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id 08BE7139F68 for ; Tue, 29 May 2018 08:29:02 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-TOU-1-49-10.w86-201.abo.wanadoo.fr [86.201.141.10]) (Authenticated sender: clg@kaod.org) by player718.ha.ovh.net (Postfix) with ESMTPSA id AF1B84E0087; Tue, 29 May 2018 08:28:57 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org Date: Tue, 29 May 2018 08:28:35 +0200 Message-Id: <20180529062838.20556-4-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180529062838.20556-1-clg@kaod.org> References: <20180529062838.20556-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17522943200272550832 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrheejgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 188.165.48.182 Subject: [Qemu-devel] [PATCH 3/6] net/ftgmac100: fix multicast hash routine 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: , Cc: Samuel Thibault , Jason Wang , qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Based on the multicast hash calculation of the FTGMAC100 Linux driver. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 50af1222464a..fd7699b1c05e 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -778,8 +778,8 @@ static int ftgmac100_filter(FTGMAC100State *s, const ui= nt8_t *buf, size_t len) return 0; } =20 - /* TODO: this does not seem to work for ftgmac100 */ - mcast_idx =3D net_crc32(buf, ETH_ALEN) >> 26; + mcast_idx =3D net_crc32_le(buf, ETH_ALEN); + mcast_idx =3D (~(mcast_idx >> 2)) & 0x3f; if (!(s->math[mcast_idx / 32] & (1 << (mcast_idx % 32)))) { return 0; } --=20 2.13.6