From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:6911:0:0:0:0:0 with SMTP id e17csp7734203lfc; Thu, 28 Nov 2019 07:46:39 -0800 (PST) X-Google-Smtp-Source: APXvYqy8O9sXNkE2gLrFViykz+U60Alc7lztmMxqTas0ZBTr6Wkt3suqYqJ+mjpQVnQwlgeRXuuE X-Received: by 2002:a05:6402:12ca:: with SMTP id k10mr38799181edx.255.1574955999028; Thu, 28 Nov 2019 07:46:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574955999; cv=none; d=google.com; s=arc-20160816; b=pVrIwzJIlviDn9CnnelTPjGnFTEnCVsU5niACpYfiFVI/r99KMpZRUMavq76vCbWuE Elxt/Irl3bdpVAMv4TG1ReplwUeH8ysNYrPeHY2sfDAU32s96P65F2Rrcykt/ISNei+8 HCMgvBzPUtRoBztjgzaS+13UT+Ofcpnk33xhYd28JPx1Z65KE5Rx2cht8Bx7mNLq6CW2 eg9H0S9OmhTvKDVNdMqZjRJiCFE5kalU8HVE9qJUNx+TbAaR20qx43NfyioR6YEaJteT P16IQtZyUllfMqR0Mp3ybqvCdoaVWuqM3e53hthj3Ye0LL6qoM12vW9fddtWS5XHFLtt dfUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :to:from:ironport-sdr:ironport-sdr; bh=R/+xaktGgkZSTImBHUBgHCoOZlz3eTlyLia9sp3DLtQ=; b=ohwUOn3GEJOjBIp3CKGFPeaDUmb89T3/j/WAgp4VRUorbYtgUgxNBWg9kxXs0AZiwC 7gtZ+JJ3Gqi/ws7RNlTlrhO/oO2mUcsHYQWtxGU8dEDLzn5lzNYbz0tqoTZF/0eUKRD1 85DilyJlCWDUm8UUNyr+tgsgh4Cn1V1qzb8H32hdY22MqBVsvJGqMdTAiprEaU4jWFlp +JDsOW/JTTG+HrqW/sTCX97i3j3dR4mgxxniLyTaF4CYvyTdWf/YSWiZYdxdQeLB9wsy kstMVxD4PzpIk0HEhv/YqpdMNCkH5iXh+Op5DjMkJvHYRjQ6vFvduKMm6GwnU9/gWU39 c8tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s10si12041681ejr.19.2019.11.28.07.46.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Nov 2019 07:46:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:50212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaM04-0007tw-VN for alex.bennee@linaro.org; Thu, 28 Nov 2019 10:46:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48375) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaLey-0005IN-IX for qemu-arm@nongnu.org; Thu, 28 Nov 2019 10:24:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaLRB-0006An-OV for qemu-arm@nongnu.org; Thu, 28 Nov 2019 10:10:39 -0500 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:46874) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iaLR6-0005Nl-QZ; Thu, 28 Nov 2019 10:10:29 -0500 IronPort-SDR: 0Qx/Hmk2Tm0jkHE9VaqRqg/re2aQRSOq5gcaUZwPGuCVTNKrKeaZ3z76CQtkYICti6U/vnR/2Z J7hY4TssFUIHoBaNYCSHItVtwiwfLk6dgaQ9Su9/yOBpUAkRVoQJMjYzzheemapP77fW5Df4Uy vMwe7AkINgDQJ4I3tM/wkHvVdFZHqwz3j5KU8SyQRoNmTlx5KLM7XwCL2Gxq9hO7afrDLsslEF XI4OcPB9jV+XsW0pFPe8t0CUYklEBco6JU5/inHA2gTWFZIHFsMTCV8KZrzG4QCVVJE48EUO21 Q6E= X-IronPort-AV: E=Sophos;i="5.69,253,1571731200"; d="scan'208,217";a="43544433" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 28 Nov 2019 07:10:21 -0800 IronPort-SDR: SN3mSj21GxZ1A4a2j+Wrih5vVWVzNqZIjEf3/7D7+s7JRVevWrGzC0whS3U+fPrj8vzbuVudWO /R1pdP/0L+QWZy8MNymyIEAuFEpBffRmSqEIhFlH9cggRgiEOSrG6QdoQa3nuU43okf0Dt8Cx2 kkSq1ngXLXJuP7diHpP2k6fAyjjZYcM1m8TDoawSKZcskAxvSX2UVlY8lLx38xqFytFaFP0YC+ BVdaQOjxNWvcWIlhBbZ8VTmyyW0DePQZ+TznhihHzkp9K3NZ4Xca1NBgZ6zBpSrJ2DsNBexIPb RA8= From: "Wasim, Bilal" To: "qemu-devel@nongnu.org" Subject: [PATCH] Updating the GEM MAC IP to properly filter out the multicast addresses Thread-Topic: [PATCH] Updating the GEM MAC IP to properly filter out the multicast addresses Thread-Index: AdWl/aPyGC40ldXeTIuqOxj9pJGCcw== Date: Thu, 28 Nov 2019 15:10:16 +0000 Message-ID: <2632212d4c8a40bead72ffdcf288e600@SVR-IES-MBX-03.mgc.mentorg.com> Accept-Language: en-GB, en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [137.202.0.90] Content-Type: multipart/alternative; boundary="_000_2632212d4c8a40bead72ffdcf288e600SVRIESMBX03mgcmentorgco_" MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 68.232.141.98 X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "alistair@alistair23.me" , "qemu-arm@nongnu.org" , "peter.maydell@linaro.org" Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: xdKICvQiOaJB --_000_2632212d4c8a40bead72ffdcf288e600SVRIESMBX03mgcmentorgco_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [PATCH] Updating the GEM MAC IP to properly filter out the multicast addresses. The current code makes a bad assumption that the most-significan= t byte of the MAC address is used to determine if the address is multicast or unicast, but in reality only a single bit is used to determine this. This caused IPv6 to not work.. Fix is now in place and has been tested with ZCU102-A53 / IPv6 on a TAP interface. Works well.. Signed-off-by: Bilal Wasim --- hw/net/cadence_gem.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index b8be73d..f8bcbb3 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -315,6 +315,12 @@ #define GEM_MODID_VALUE 0x00020118 +/* IEEE has specified that the most significant bit of the most significan= t byte be used for + * distinguishing between Unicast and Multicast addresses. + * If its a 1, that means multicast, 0 means unicast. */ +#define IS_MULTICAST(address) (((address[0] & 0x01) =3D=3D 0x01)= ? 1 : 0) +#define IS_UNICAST(address) (!IS_MULTICAST(address)) + static inline uint64_t tx_desc_get_buffer(CadenceGEMState *s, uint32_t *des= c) { uint64_t ret =3D desc[0]; @@ -690,21 +696,21 @@ static int gem_mac_address_filter(CadenceGEMState *s,= const uint8_t *packet) } /* Accept packets -w- hash match? */ - if ((packet[0] =3D=3D 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HA= SH)) || - (packet[0] !=3D 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH= ))) { + if ((IS_MULTICAST(packet) && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HAS= H)) || + (IS_UNICAST(packet) && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HAS= H))) { unsigned hash_index; hash_index =3D calc_mac_hash(packet); if (hash_index < 32) { if (s->regs[GEM_HASHLO] & (1<regs[GEM_HASHHI] & (1<

[PATCH] Updating the GEM MAC IP to properly filter o= ut the multicast

addresses. The current code makes a bad assumption t= hat the most-significant

byte of the MAC address is used to determine if the = address is multicast or

unicast, but in reality only a single bit is used to= determine this. This

caused IPv6 to not work.. Fix is now in place and ha= s been tested with

ZCU102-A53 / IPv6 on a TAP interface. Works well..

 

Signed-off-by: Bilal Wasim <bilal_wasim@mentor.co= m>

---

hw/net/cadence_gem.c | 18 +++++&= #43;++++++------

1 file changed, 12 insertions(+), 6 deletions(-)=

 

diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_g= em.c

index b8be73d..f8bcbb3 100644

--- a/hw/net/cadence_gem.c

+++ b/hw/net/cadence_gem.c

@@ -315,6 +315,12 @@

 #define GEM_MODID_VALUE 0x00020118<= /p>

+/* IEEE has specified that the most significant= bit of the most significant byte be used for

+ * distinguishing between Unicast and Multicast= addresses.

+ * If its a 1, that means multicast, 0 means un= icast.   */

+#define IS_MULTICAST(address)   =         (((address[0] & 0x01) =3D=3D= 0x01) ? 1 : 0)

+#define IS_UNICAST(address)   &n= bsp;         (!IS_MULTICAST(address= ))

+

static inline uint64_t tx_desc_get_buffer(CadenceGEM= State *s, uint32_t *desc)

{

     uint64_t ret =3D desc[0];

@@ -690,21 +696,21 @@ static int gem_mac_address= _filter(CadenceGEMState *s, const uint8_t *packet)

     }

     /* Accept packets -w- = hash match? */

-    if ((packet[0] =3D=3D 0x01 &= & (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) ||

-        (packet[= 0] !=3D 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH))= ) {

+    if ((IS_MULTICAST(packet) &a= mp;& (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) ||<= /p>

+        (IS_= UNICAST(packet)   && (s->regs[GEM_NWCFG] & GEM_NWC= FG_UCAST_HASH))) {

         uns= igned hash_index;

        &nbs= p;hash_index =3D calc_mac_hash(packet);

         if = (hash_index < 32) {

        &nbs= p;    if (s->regs[GEM_HASHLO] & (1<<hash_index)= ) {

-         &n= bsp;      return packet[0] =3D=3D 0x01 ? GEM_= RX_MULTICAST_HASH_ACCEPT :

-        &nb= sp;            =             &nb= sp;         GEM_RX_UNICAST_HASH_ACC= EPT;

+        = ;        return IS_MULTICAST(packet) ? G= EM_RX_MULTICAST_HASH_ACCEPT :

+        = ;            &n= bsp;            = ;             G= EM_RX_UNICAST_HASH_ACCEPT;

        &nbs= p;    }

         } e= lse {

        &nbs= p;    hash_index -=3D 32;

        &nbs= p;    if (s->regs[GEM_HASHHI] & (1<<hash_index)= ) {

-        &nb= sp;       return packet[0] =3D=3D 0x01 ? GEM_= RX_MULTICAST_HASH_ACCEPT :

-        &nb= sp;            =             &nb= sp;         GEM_RX_UNICAST_HASH_ACC= EPT;

+        = ;        return IS_MULTICAST(packet) ? G= EM_RX_MULTICAST_HASH_ACCEPT :

+        = ;            &n= bsp;            = ;             G= EM_RX_UNICAST_HASH_ACCEPT;

        &nbs= p;    }

         }

     }

--

2.9.3

 

--_000_2632212d4c8a40bead72ffdcf288e600SVRIESMBX03mgcmentorgco_-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF029C432C0 for ; Thu, 28 Nov 2019 16:29:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD50421774 for ; Thu, 28 Nov 2019 16:29:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD50421774 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaMfm-0006sM-Tl for qemu-devel@archiver.kernel.org; Thu, 28 Nov 2019 11:29:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46875) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaLf1-0004pP-Ju for qemu-devel@nongnu.org; Thu, 28 Nov 2019 10:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaLR7-0005t6-CY for qemu-devel@nongnu.org; Thu, 28 Nov 2019 10:10:30 -0500 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:46874) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iaLR6-0005Nl-QZ; Thu, 28 Nov 2019 10:10:29 -0500 IronPort-SDR: 0Qx/Hmk2Tm0jkHE9VaqRqg/re2aQRSOq5gcaUZwPGuCVTNKrKeaZ3z76CQtkYICti6U/vnR/2Z J7hY4TssFUIHoBaNYCSHItVtwiwfLk6dgaQ9Su9/yOBpUAkRVoQJMjYzzheemapP77fW5Df4Uy vMwe7AkINgDQJ4I3tM/wkHvVdFZHqwz3j5KU8SyQRoNmTlx5KLM7XwCL2Gxq9hO7afrDLsslEF XI4OcPB9jV+XsW0pFPe8t0CUYklEBco6JU5/inHA2gTWFZIHFsMTCV8KZrzG4QCVVJE48EUO21 Q6E= X-IronPort-AV: E=Sophos;i="5.69,253,1571731200"; d="scan'208,217";a="43544433" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 28 Nov 2019 07:10:21 -0800 IronPort-SDR: SN3mSj21GxZ1A4a2j+Wrih5vVWVzNqZIjEf3/7D7+s7JRVevWrGzC0whS3U+fPrj8vzbuVudWO /R1pdP/0L+QWZy8MNymyIEAuFEpBffRmSqEIhFlH9cggRgiEOSrG6QdoQa3nuU43okf0Dt8Cx2 kkSq1ngXLXJuP7diHpP2k6fAyjjZYcM1m8TDoawSKZcskAxvSX2UVlY8lLx38xqFytFaFP0YC+ BVdaQOjxNWvcWIlhBbZ8VTmyyW0DePQZ+TznhihHzkp9K3NZ4Xca1NBgZ6zBpSrJ2DsNBexIPb RA8= From: "Wasim, Bilal" To: "qemu-devel@nongnu.org" Subject: [PATCH] Updating the GEM MAC IP to properly filter out the multicast addresses Thread-Topic: [PATCH] Updating the GEM MAC IP to properly filter out the multicast addresses Thread-Index: AdWl/aPyGC40ldXeTIuqOxj9pJGCcw== Date: Thu, 28 Nov 2019 15:10:16 +0000 Message-ID: <2632212d4c8a40bead72ffdcf288e600@SVR-IES-MBX-03.mgc.mentorg.com> Accept-Language: en-GB, en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [137.202.0.90] Content-Type: multipart/alternative; boundary="_000_2632212d4c8a40bead72ffdcf288e600SVRIESMBX03mgcmentorgco_" MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 68.232.141.98 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "edgar.iglesias@gmail.com" , "alistair@alistair23.me" , "qemu-arm@nongnu.org" , "peter.maydell@linaro.org" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --_000_2632212d4c8a40bead72ffdcf288e600SVRIESMBX03mgcmentorgco_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [PATCH] Updating the GEM MAC IP to properly filter out the multicast addresses. The current code makes a bad assumption that the most-significan= t byte of the MAC address is used to determine if the address is multicast or unicast, but in reality only a single bit is used to determine this. This caused IPv6 to not work.. Fix is now in place and has been tested with ZCU102-A53 / IPv6 on a TAP interface. Works well.. Signed-off-by: Bilal Wasim --- hw/net/cadence_gem.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index b8be73d..f8bcbb3 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -315,6 +315,12 @@ #define GEM_MODID_VALUE 0x00020118 +/* IEEE has specified that the most significant bit of the most significan= t byte be used for + * distinguishing between Unicast and Multicast addresses. + * If its a 1, that means multicast, 0 means unicast. */ +#define IS_MULTICAST(address) (((address[0] & 0x01) =3D=3D 0x01)= ? 1 : 0) +#define IS_UNICAST(address) (!IS_MULTICAST(address)) + static inline uint64_t tx_desc_get_buffer(CadenceGEMState *s, uint32_t *des= c) { uint64_t ret =3D desc[0]; @@ -690,21 +696,21 @@ static int gem_mac_address_filter(CadenceGEMState *s,= const uint8_t *packet) } /* Accept packets -w- hash match? */ - if ((packet[0] =3D=3D 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HA= SH)) || - (packet[0] !=3D 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH= ))) { + if ((IS_MULTICAST(packet) && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HAS= H)) || + (IS_UNICAST(packet) && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HAS= H))) { unsigned hash_index; hash_index =3D calc_mac_hash(packet); if (hash_index < 32) { if (s->regs[GEM_HASHLO] & (1<regs[GEM_HASHHI] & (1<

[PATCH] Updating the GEM MAC IP to properly filter o= ut the multicast

addresses. The current code makes a bad assumption t= hat the most-significant

byte of the MAC address is used to determine if the = address is multicast or

unicast, but in reality only a single bit is used to= determine this. This

caused IPv6 to not work.. Fix is now in place and ha= s been tested with

ZCU102-A53 / IPv6 on a TAP interface. Works well..

 

Signed-off-by: Bilal Wasim <bilal_wasim@mentor.co= m>

---

hw/net/cadence_gem.c | 18 +++++&= #43;++++++------

1 file changed, 12 insertions(+), 6 deletions(-)=

 

diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_g= em.c

index b8be73d..f8bcbb3 100644

--- a/hw/net/cadence_gem.c

+++ b/hw/net/cadence_gem.c

@@ -315,6 +315,12 @@

 #define GEM_MODID_VALUE 0x00020118<= /p>

+/* IEEE has specified that the most significant= bit of the most significant byte be used for

+ * distinguishing between Unicast and Multicast= addresses.

+ * If its a 1, that means multicast, 0 means un= icast.   */

+#define IS_MULTICAST(address)   =         (((address[0] & 0x01) =3D=3D= 0x01) ? 1 : 0)

+#define IS_UNICAST(address)   &n= bsp;         (!IS_MULTICAST(address= ))

+

static inline uint64_t tx_desc_get_buffer(CadenceGEM= State *s, uint32_t *desc)

{

     uint64_t ret =3D desc[0];

@@ -690,21 +696,21 @@ static int gem_mac_address= _filter(CadenceGEMState *s, const uint8_t *packet)

     }

     /* Accept packets -w- = hash match? */

-    if ((packet[0] =3D=3D 0x01 &= & (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) ||

-        (packet[= 0] !=3D 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH))= ) {

+    if ((IS_MULTICAST(packet) &a= mp;& (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) ||<= /p>

+        (IS_= UNICAST(packet)   && (s->regs[GEM_NWCFG] & GEM_NWC= FG_UCAST_HASH))) {

         uns= igned hash_index;

        &nbs= p;hash_index =3D calc_mac_hash(packet);

         if = (hash_index < 32) {

        &nbs= p;    if (s->regs[GEM_HASHLO] & (1<<hash_index)= ) {

-         &n= bsp;      return packet[0] =3D=3D 0x01 ? GEM_= RX_MULTICAST_HASH_ACCEPT :

-        &nb= sp;            =             &nb= sp;         GEM_RX_UNICAST_HASH_ACC= EPT;

+        = ;        return IS_MULTICAST(packet) ? G= EM_RX_MULTICAST_HASH_ACCEPT :

+        = ;            &n= bsp;            = ;             G= EM_RX_UNICAST_HASH_ACCEPT;

        &nbs= p;    }

         } e= lse {

        &nbs= p;    hash_index -=3D 32;

        &nbs= p;    if (s->regs[GEM_HASHHI] & (1<<hash_index)= ) {

-        &nb= sp;       return packet[0] =3D=3D 0x01 ? GEM_= RX_MULTICAST_HASH_ACCEPT :

-        &nb= sp;            =             &nb= sp;         GEM_RX_UNICAST_HASH_ACC= EPT;

+        = ;        return IS_MULTICAST(packet) ? G= EM_RX_MULTICAST_HASH_ACCEPT :

+        = ;            &n= bsp;            = ;             G= EM_RX_UNICAST_HASH_ACCEPT;

        &nbs= p;    }

         }

     }

--

2.9.3

 

--_000_2632212d4c8a40bead72ffdcf288e600SVRIESMBX03mgcmentorgco_--