From patchwork Fri Jun 8 12:44:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 926758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 412NCk4X3dz9s3x for ; Fri, 8 Jun 2018 23:14:10 +1000 (AEST) Received: from localhost ([::1]:35581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRHDU-00012g-8h for incoming@patchwork.ozlabs.org; Fri, 08 Jun 2018 09:14:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRGlk-000307-GZ for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:45:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRGlj-0004DP-R8 for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:45:28 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:42590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRGlj-0004D2-Jj for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:45:27 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fRGli-0003fM-Hr for qemu-devel@nongnu.org; Fri, 08 Jun 2018 13:45:26 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 8 Jun 2018 13:44:57 +0100 Message-Id: <20180608124517.29475-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180608124517.29475-1-peter.maydell@linaro.org> References: <20180608124517.29475-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 11/31] 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cédric Le Goater Based on the multicast hash calculation of the FTGMAC100 Linux driver. Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Message-id: 20180530061711.23673-4-clg@kaod.org Signed-off-by: Peter Maydell --- 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 abf80655f28..8a7f274dc11 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -776,8 +776,8 @@ static int ftgmac100_filter(FTGMAC100State *s, const uint8_t *buf, size_t len) return 0; } - /* TODO: this does not seem to work for ftgmac100 */ - mcast_idx = net_crc32(buf, ETH_ALEN) >> 26; + mcast_idx = net_crc32_le(buf, ETH_ALEN); + mcast_idx = (~(mcast_idx >> 2)) & 0x3f; if (!(s->math[mcast_idx / 32] & (1 << (mcast_idx % 32)))) { return 0; }