From patchwork Tue Jun 11 06:24:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrew.Yuan" X-Patchwork-Id: 13693146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B20DCC25B76 for ; Tue, 11 Jun 2024 06:25:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGuwR-0002Sd-UF; Tue, 11 Jun 2024 02:25:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGuwP-0002S2-4f; Tue, 11 Jun 2024 02:25:09 -0400 Received: from mail-tyzapc01on20701.outbound.protection.outlook.com ([2a01:111:f403:2011::701] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGuwL-00050K-W4; Tue, 11 Jun 2024 02:25:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BEllZEamrs2Sdxp499fAx9twGLpngQaCYJdfuy7/wC0gPTxqbnnutI6MFFfJzYJip8Q0mXsmCA+q2omYmdion6FeZ5Ooj/d5JF2rWspWxszgpviuV3tKdvaU3iKAf8q8AU+86d+CafRDUkrAhi2CWCgoOo9kkpIW71E4snT+DPda2AvW2k0LqmuDc6YD67pQCGqtyK9NRcphlNSrfxmEOIiryLq1lMKtzfgi8g0bGQKsgJR4Fh+txHkaIUwOMx0b4xP/miEdeJDXFpEuOprAAbG98vGsuI/lbVoYYleOSNT7QfVjW4tmsd2+QEJFszXDj47ZP3R18N76z+Wgn4CLRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+C+oKG7aoIwIyTa0GHeBkzV8qsJMTwv4HyEQ84ETdlE=; b=nRQSPuB1QwaIlfrHcF7OuLkIP2znh9PxxupMFYmACKSrBfb9Yy1cgq+c8r5X1EIJJ8MhSTm0CZ9m7lPTjhYF7lWgp93Mec63RIyD9fTgGrnqmC0FHxODkUP8zMa4JNuIZFVEJFq3A7jWvoF43D9kcSBvc4/OHGhi6MHr8pJheCAx79Uo+6zzpfpmSqF2S9UGpMfhZJ8bb09bJ8366nab7R493OigWyaQ1IrPG9XxiTDmf4ykpOCCYPjTAWW/yEtwhD/DbcTT0taV2KGK41fuWbo1Es6/g+sRTn9qnDkXRC4FHIgVGLQg6T2X4Q/b38eMIXgSisDFyQaplHE3TlYx1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+C+oKG7aoIwIyTa0GHeBkzV8qsJMTwv4HyEQ84ETdlE=; b=nCuGoAvQEcUb26U4VMgPQOO7zYnIdd/yDy81l/AhN9y88DRRugwrR/7KxunHkhNJKEdkflI4W3T15Drx6v8UatYVonsfialMpGIcDKE6sxuzBBy60GFscQe4/Za1d9Tf3wG8f9MR+dMcWsmBZGBQs8fsynjKh5Sy2WtQEkKVi1d9YY2dPn43fpTqzBldQsHt1mA6jo6cRDkeO0VUp/NH5pc3ywStlxVonUd1vfYasDCLcnG+UXUo17g9pp13GTUKCUh6S5PZpuH5Cieq66PjmrPZsnquq/zaSuFuli9kGo9sZKOXPVbMFiyPGrnjlozA4PcKwKecSwUy434CGS4zuA== Received: from KL1PR0601MB4891.apcprd06.prod.outlook.com (2603:1096:820:ae::7) by TYZPR06MB6991.apcprd06.prod.outlook.com (2603:1096:405:3e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 06:24:53 +0000 Received: from KL1PR0601MB4891.apcprd06.prod.outlook.com ([fe80::8950:42de:2354:91b2]) by KL1PR0601MB4891.apcprd06.prod.outlook.com ([fe80::8950:42de:2354:91b2%7]) with mapi id 15.20.7633.036; Tue, 11 Jun 2024 06:24:53 +0000 From: andrew Yuan To: "Edgar E. Iglesias" CC: "luc.michel@amd.com" , "alistair@alistair23.me" , "peter.maydell@linaro.org" , "jasowang@redhat.com" , "qemu-arm@nongnu.org" , "qemu-devel@nongnu.org" Subject: =?utf-8?b?562U5aSNOiBbUEFUQ0hdIGh3L25ldDogY2FkZW5jZV9nZW06IGZpeDog?= =?utf-8?b?dHlwZTJfY29tcGFyZV94X3dvcmRfMCBlcnJvcg==?= Thread-Topic: [PATCH] hw/net: cadence_gem: fix: type2_compare_x_word_0 error Thread-Index: AQHauAFEOQ7GdOLLmEKNogHiM0xNN7HCH68w Date: Tue, 11 Jun 2024 06:24:53 +0000 Message-ID: References: <20240606095952.2133-1-andrew.yuan@jaguarmicro.com> In-Reply-To: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: KL1PR0601MB4891:EE_|TYZPR06MB6991:EE_ x-ms-office365-filtering-correlation-id: e019f559-f5c1-42fd-6da1-08dc89df34d8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?q?73u10Jh6czNovbjGRQoEX8XrNt1U7wo?= =?utf-8?q?OjnDC/B3FHvunq8qxGt0iSVUakbX33oiP1IMRHdnKVQ5P+Chd507UbLbT7pRveIAm?= =?utf-8?q?smJm7kv28POLhfY7ySVy0KrZIqVEtOC1Vz35dGR7IojIVUtGcx86wXuC2d4Xhi2Hr?= =?utf-8?q?96ByX36F7Isv6YORs25UAHbtwXwLdnegIj6RrEaxthFbHyxI8f+Zo7o91OcyZOPbs?= =?utf-8?q?5+xaMgZ50McVwz08vyoAS22rw5KN/8XYYNCOUtG47LL4eYtG7M060E+K+Km/GuXJf?= =?utf-8?q?ewfCyKdSdqZp4gkm+Jw3KjxApUWoacLHQ5vywQgqKcQbqr0tEtt+cxRA9FRNDA6cP?= =?utf-8?q?nY/elWeBkasmqT5o+ic6cq9KIjPc4yyXMrYYfYCZlZC0ic10pcUi8Z0Y2Xzuu6mt4?= =?utf-8?q?yLnFZPzEB3+gN7a0IKIwEPNXafamxoLIS4xPzTfoDePOCR9SdtpxS49D6rB7+Gu/g?= =?utf-8?q?OGoEeuAqPMrjI+OEr2289buazVE+U6GOwqbL4JdUWPC4BCZbPB97xQ0SOfnuystAe?= =?utf-8?q?inkET1nwEapNzicILHIQpQMlpOFT35wjEh0V0jqlTmcxmbyVtWMol+8mp+l0Fg019?= =?utf-8?q?sBYQpItdR0J3hOhyVISVyp4TF0GfRUcW8iKjfp9xkbpWZYmupb+BL2bcIRwtKDx6c?= =?utf-8?q?PMTtlzOPGewrfqUV5DkIOXwQ/udW6XDWjnK55V9E2BACdyfkOmvmTBDXEFeZO8Q6X?= =?utf-8?q?gJg+efv+nIChdId/gXsK4F7HxR4rqv1+LCZ7Xtn6/zvf87iIFkxAmyotOXvmBahc4?= =?utf-8?q?mgkRPNhTbpRH0QpnnXwmIVHaYkSOsnP6s/UWA/u1vBG7yzs/MvVV7KI2Tyz0Hmcb3?= =?utf-8?q?U6hDEifnq+5CMt9t6pYYZCElojEO9FZgR7rEqDK9m9XcLvGYjluKD5DmDc2cRJWsh?= =?utf-8?q?JIIPXkJlUgkXw7iMJ41QXEOnYN0HZBzFCfIdqfKF66KtkgTNIhDYAQtsRRKtXwXVc?= =?utf-8?q?Y89CMvoiHcIc4Iu3tlcAGiCeO8fTQjFuBi6LDwdjJP1HUje2iO0QQA9TyLqil1tYl?= =?utf-8?q?zsYMJTdiaJLN7YwnxpdGVXcoQ7ahYBEQt7pO6S8ScJihcoF97IHg1dLlmB4NVrN3H?= =?utf-8?q?EA7j09e6XE7+2a0lmlYjtlfmp/sfrsVePKbUnp08m01jzxMDu+6JuSjn2lcOw0C6Q?= =?utf-8?q?ghp0X5I8vSp4GqXkg0xgaRzmdyz/Gn64bdQsyGQJ8a6Eq/dS7FwZM7wt2yiNC+Hw2?= =?utf-8?q?G10xXPbFrLW/9yH6DOytWDp2JHk2gk07HNdunWe+EkeOpG30GGpFtwI8KDtDiP64v?= =?utf-8?q?qrutP1+zX5D4i7tEGBhSRTmgikOK4alNrrDjiDMNXADdyTt7lxBlbBuQ=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:zh-cn; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB4891.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?huzr2TMw+TgxbMkYit3Cz01ALob6?= =?utf-8?q?Ep0BFYOJ9ms20UmmrGRPGC3O38Seiup4r2hvnq/Q31ZX8yJYsvGY8iv3ctBRWJ36o?= =?utf-8?q?w0soWon84SOk/kA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Y4LeCsZXrud+uyBxqtj3bdCS8IqUhKihrS9YD17HCTUpW3IunmjaItj?= =?utf-8?q?9MxJ8PteNzDa+6386cxWtEtYNekIzpLiAVKZwrIWbrQVuAj1ypnm/4xk5s/fMzaSB?= =?utf-8?q?SYjniNDo0amt88uVXl0SdwYnElwOhRSFdgv9Slm8YZ/f7/RUS9v1w0Rs3q6lg7wnY?= =?utf-8?q?bsC/QJkt2g+WPjaPlrXNUE1m+HzW61K5pKo+hwYY/bSb6W6zyNvg9Pe2a+7JR2l+v?= =?utf-8?q?MjqJTRLjlVVYs/xIS2QMWIJp8YRrcSDYVFxEN8MKb8fFXFMaq4ftnOLHf0QnL4T3H?= =?utf-8?q?DKZVLBnTZOGzNSleGY/LCWTJs966YhbMq3wDldrkWMGKZhG71AHrBlsy5p/b8A6ak?= =?utf-8?q?BFQnkFxhhAPh7oX9jvWLAJkRDg9Dz4VfJBhA7CNx3dfp/T4jI7xLU84YMJK2RnnxU?= =?utf-8?q?z0st7pAwbU5/yTVIPxFaQjoQwrRzbe6fN3a6t0hqQILGtoMRt9ms7JrpNgOHmFtxj?= =?utf-8?q?poTGfFZakVqia4ViVKf2Q+RjXPbrSHf7h1vquUhfOXjBrg1pho24QAZ8BiQXqfRjY?= =?utf-8?q?LrTEcQ5le3lJ?= MIME-Version: 1.0 X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4891.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e019f559-f5c1-42fd-6da1-08dc89df34d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2024 06:24:53.6680 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xa0+Adn4Nt6pUKlJiWeriFWCfuzPaqnRpHEKKJF6vEel+ALKF3INpQzKvjakCdJpVgzEr/gBI58kqHgsgJ+7OcIUPx2TN6GDcTW/krnwjr4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6991 Received-SPF: pass client-ip=2a01:111:f403:2011::701; envelope-from=andrew.yuan@jaguarmicro.com; helo=APC01-TYZ-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org OK,I will send another patch for the missing logic for the DISABLE_MASK bit; 发件人: Edgar E. Iglesias 发送时间: 2024年6月6日 19:04 收件人: andrew Yuan 抄送: luc.michel@amd.com; alistair@alistair23.me; peter.maydell@linaro.org; jasowang@redhat.com; qemu-arm@nongnu.org; qemu-devel@nongnu.org 主题: Re: [PATCH] hw/net: cadence_gem: fix: type2_compare_x_word_0 error External Mail: This email originated from OUTSIDE of the organization! Do not click links, open attachments or provide ANY information unless you recognize the sender and know the content is safe. On Thu, Jun 6, 2024 at 12:00 PM Andrew.Yuan > wrote: In the Cadence IP for Gigabit Ethernet MAC Part Number: IP7014 IP Rev: R1p12 - Doc Rev: 1.3 User Guide, the specification for the type2_compare_x_word_0 register is as follows: The byte stored in bits [23:16] is compared against the byte in the received frame from the selected offset+0, and the byte stored in bits [31:24] is compared against the byte in the received frame from the selected offset+1. However, there is an implementation error in the cadence_gem model in qemu: the byte stored in bits [31:24] is compared against the byte in the received frame from the selected offset+0 Now, the error code is as follows: rx_cmp = rxbuf_ptr[offset] << 8 | rxbuf_ptr[offset]; and needs to be corrected to: rx_cmp = rxbuf_ptr[offset + 1] << 8 | rxbuf_ptr[offset]; Signed-off-by: Andrew.Yuan > LGTM: Reviewed-by: Edgar E. Iglesias > At some point it would be nice to add the missing logic for the DISABLE_MASK bit that extends the compare range from 16 to 32-bits. Cheers, Edgar --- hw/net/cadence_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.37.0.windows.1 diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index ec7bf562e5..9c73ded0d3 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -946,7 +946,7 @@ static int get_queue_from_screen(CadenceGEMState *s, uint8_t *rxbuf_ptr, break; } - rx_cmp = rxbuf_ptr[offset] << 8 | rxbuf_ptr[offset]; + rx_cmp = rxbuf_ptr[offset + 1] << 8 | rxbuf_ptr[offset]; mask = FIELD_EX32(cr0, TYPE2_COMPARE_0_WORD_0, MASK_VALUE); compare = FIELD_EX32(cr0, TYPE2_COMPARE_0_WORD_0, COMPARE_VALUE);