[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/6] net/ftgmac100: fix multicast hash routine
From: |
Cédric Le Goater |
Subject: |
[Qemu-devel] [PATCH 3/6] net/ftgmac100: fix multicast hash routine |
Date: |
Tue, 29 May 2018 08:28:35 +0200 |
Based on the multicast hash calculation of the FTGMAC100 Linux driver.
Signed-off-by: Cédric Le Goater <address@hidden>
---
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
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;
}
--
2.13.6
- [Qemu-devel] [PATCH 0/6] ftgmac100 and NC-SI enhancements for the Aspeed SoC, Cédric Le Goater, 2018/05/29
- [Qemu-devel] [PATCH 2/6] ftgmac100: add IEEE 802.1Q VLAN support, Cédric Le Goater, 2018/05/29
- [Qemu-devel] [PATCH 1/6] ftgmac100: compute maximum frame size depending on the protocol, Cédric Le Goater, 2018/05/29
- [Qemu-devel] [PATCH 3/6] net/ftgmac100: fix multicast hash routine,
Cédric Le Goater <=
- [Qemu-devel] [PATCH 4/6] slirp/ncsi: fix "Get Version ID" payload length, Cédric Le Goater, 2018/05/29
- [Qemu-devel] [PATCH 5/6] slirp/ncsi: add a "Get Parameter" response, Cédric Le Goater, 2018/05/29
- [Qemu-devel] [PATCH 6/6] slirp/ncsi: add checksum support, Cédric Le Goater, 2018/05/29
- Re: [Qemu-devel] [Qemu-arm] [PATCH 0/6] ftgmac100 and NC-SI enhancements for the Aspeed SoC, Philippe Mathieu-Daudé, 2018/05/29