From patchwork Thu Jun 6 09:59:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrew.Yuan" X-Patchwork-Id: 13688672 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 A78ACC25B75 for ; Thu, 6 Jun 2024 15:29:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFF3D-0007zc-Sq; Thu, 06 Jun 2024 11:29:15 -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 1sF9v7-0005RL-SI; Thu, 06 Jun 2024 06:00:34 -0400 Received: from mail-southeastasiaazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c401::3] helo=SINPR02CU002.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 1sF9v4-0003eU-MY; Thu, 06 Jun 2024 06:00:33 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ICr8sTvCRKgALtrJMzqlq7wHH2FoCHbYx38JImlgIy7dLG/uuACtIzlRlZppfp+WaLlGffUmFhvFEj6D4voKdkWGeHUBEmVyNZiy2MgK0YpOxnRfNjn0VXCX+PoIg6tGjrZwKU2gE27hxhrhCCn/xRu75bJLKiugIxY5Ssb/gNabjnLCh5cG0hzS3h9aH/h6AlGnV9nU6gLpg8Rq8P5Bj/p9N0XM7eocl6xckPHLPcNTNY3w7DsSHSb3sN/3Jz5Hw5natn9/QnPivWrXB4/djmaUp4h02x6OTdi32+YbkGC8Mw7WScPe/iPCDxtVk30ymjEyOuwXT3TOVBVqvIEJaQ== 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=148R7X1ib0+yDIg1UtkggluQAb02ZWf4CIi13gPlxvs=; b=b9PpHG7kU10kBTScESW3x8WlPysAo/uKeNoxrX9jeWs1Rwv/c3OlvOuyrPxcB33jJHeBqYBveZ7GqOTDueeEEd2zplgMnd14lY8TNr5gh+q90lUyrqztcGV5DMvFJ6S75n3GTW684n0bD0QAztJrao1O/3H8/w5mRSfzHQxTUJAgIc9Vpjiv2evqOcBPDPk6hrAxG6oWywXhB9FYbmCa2yVIofqKtb21k1zwslfoKWv+6H+RFS1l9qjuKQeEi4HphOVVoTZuBH1F0yBwnjBR8PdSw4rHruG8yatJCwK6pMwwpOe9LqJ47pCv1rhIEVC6iBU7MxOzOPYcbZFtJx6HoQ== 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=148R7X1ib0+yDIg1UtkggluQAb02ZWf4CIi13gPlxvs=; b=p02ZqQzc0MlR0GfTvy55mNojsrJfM8/ZsAL/2KE2ctfahI/tl3G53pvLRFw2+jLB8ogTrsekFItWmwYdS7jmTqReDxmM5rG2wzsYy9HrcbQ8jgjKAC7YUcX+GBjrqBIYdeF70c8RcKr2R49x7OcaLEpvRu9uscetobHUbPe54gNqmvLjKr0I8eKz4diNryiyAwYnL1awVbv54r6v7exKObJjAy/pb5iVqfE7nPBbh6UM7neoqIhXRy1iEs2XehV9+lLmevZx40yAqBG4uPlnDNKR4c0e49etzVYc9avI2jvXFAFMit+X1koiq6wflooUjmu0N36UC0ay1Wrdlrddqw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from KL1PR0601MB4891.apcprd06.prod.outlook.com (2603:1096:820:ae::7) by PUZPR06MB5433.apcprd06.prod.outlook.com (2603:1096:301:e8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30; Thu, 6 Jun 2024 10:00:16 +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.033; Thu, 6 Jun 2024 10:00:15 +0000 From: "Andrew.Yuan" To: luc.michel@amd.com, edgar.iglesias@gmail.com, alistair@alistair23.me, peter.maydell@linaro.org, jasowang@redhat.com Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, "Andrew.Yuan" Subject: [PATCH] hw/net: cadence_gem: fix: type2_compare_x_word_0 error Date: Thu, 6 Jun 2024 17:59:52 +0800 Message-Id: <20240606095952.2133-1-andrew.yuan@jaguarmicro.com> X-Mailer: git-send-email 2.37.0.windows.1 X-ClientProxiedBy: SI2PR06CA0014.apcprd06.prod.outlook.com (2603:1096:4:186::11) To KL1PR0601MB4891.apcprd06.prod.outlook.com (2603:1096:820:ae::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB4891:EE_|PUZPR06MB5433:EE_ X-MS-Office365-Filtering-Correlation-Id: 79126536-ceff-43d0-280a-08dc860f7695 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|366007|376005|1800799015|52116005|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?16BpRtXCoTA2lGCEX+5b77KNp9tgRq0?= =?utf-8?q?obES3/eJQyUlGirWNhbz082cAEmAM3kGSy+RfYMNgXQEUanGlEAxJElJsQepeO60a?= =?utf-8?q?k0mrJzQ6nWlLO8nCneeZzBu2XtEcvynYUbntBy6UY0HGzAj/Kjm6AXcxGmiaHSMo2?= =?utf-8?q?WWz9w46Mp0TnK/ZJWv++aSz7aKH7plrGoxAiyMBeJrF03CDdW0vH3XMTH1CAJoY/v?= =?utf-8?q?q/h+96UmA8vsQuGXDiPyfLSa+tS22EfDgoZBqflYoxq8tRChH2GMa3vq2reduoHRR?= =?utf-8?q?cOdJyH2gcgktrD/L990w7vpDTf3DlKedh/rQ4Ykb1lEHPMyEIhsLioU4twkfllKpJ?= =?utf-8?q?x96fnpxNF3DyrW7LscwDC/onSulWabe65YFaM0orkLK5z5iDQSWDENcza23y6SpKv?= =?utf-8?q?xfEGcmE6W11ZYczguRex6j058o9GOZEjPUISfyElvs3reZ+xWQab2d4jCOBXfymre?= =?utf-8?q?PK588JurSMP6pcVXhWQ+QXUKprRmrIFk7I2KHL+pHMTSO0Ira5/tasV5zynBtq3EN?= =?utf-8?q?Sx8U0DrIVQ0c8yWcx2oDmZJNy4L3gK3EOxSBqx3NGYr4rQYUvU8QVdn56vcm0BQ3E?= =?utf-8?q?9kny2wEnNEVj7RqLUzEsceJHK33IfPrSHI7t2ffqTy9jj3/Kyu5AD5Oqwd5s8x3rQ?= =?utf-8?q?fpKsxZt8r5z5Csen8CkyOzOIT1ylZEcPNiPvOwH+QCWabUEzm+0sL1Hgn50Sv3AyD?= =?utf-8?q?Vh+6Y2xw9UmnEZtfwWiEylTOVtgSItv66iEmp/2Vqlix8+tMh+oNiJGO0PyxaHQhp?= =?utf-8?q?pxlPVVMJ9RASmX3QVKsVSpOygMsO9jqQa9zmHu8d2Lt/Sp52EAeC28VesBJZCrP0M?= =?utf-8?q?wIm6xsGaS/QaWS5CkSuyQomBdHLUoyH5U2P+ksD6SJ7QDB6YVKq70bhSbxs2SsArw?= =?utf-8?q?6nOX80ldi2M3KqW6xQaC14G/U0qD/4JVb5yNgdU59VmJwC1xrzKh+P/NtrzijnkC3?= =?utf-8?q?08JZee9IXLaHCGCJHEJ05y/cYdKT6JTk94AJKNBAB1A6SkjgaPGGosfU8HwTvASql?= =?utf-8?q?jwLPqT/ytHzJSdya0RLxxkgXaSes0rrweEYk6xpgAOO/FMyaDZDbJx9OO5WKj2KjG?= =?utf-8?q?ENa1ahBI6kMxbgzIYhlwK06LhzJvQB1bFQ/pBDdnwI2ecbW2JxnXRN6/MNoKH5CCb?= =?utf-8?q?sxwRFn6wy+XQaV8oHFFKWfL7JutyFXiVPF0hkmhVJyD+Ign6kru5zGjyyfattfs16?= =?utf-8?q?YwY/5t9amvFg+f0eRU9k5LWlXhGqfOfOSs9WGRpp9Pk9R6c3o1gtjWezyurXHoql1?= =?utf-8?q?8l7MZTlNxZueUtFn8fJNakciuirR10whZMFsCxmkqkZjoE4sk2R06HBU=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB4891.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015)(52116005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?BDATLopHAoPEQHPyXztTzZBf1FNC?= =?utf-8?q?S188rejGNIFS2KhDGjHODTH+pZ7yVTQuwYTi4jFi/l//K0tZiCRJ8pdJU2aACjaay?= =?utf-8?q?ZYr3FN22qhXPvU6L1Puj1wmtiflp8TGpi9naFIQSpx+Qo1r01aPxUYbm8HiuVEG5R?= =?utf-8?q?At8a9mD/d2Dm6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iXnpLCRnkXebVu0Ul6VPm+RPAYoYNOxd2Kh890?= =?utf-8?q?644A28ZQNAt+zYrOxk05mAdLycE4zdJ+0oeHWvYU9GLt+Ip+mR+yM04Jlr49BHSc2?= =?utf-8?q?ok0i7AWacFf7dQW1NZ7izMosbXOy/zzu9AGghv1bbqbTCUEUyOH42fYbqkPBheJND?= =?utf-8?q?WqWQDg9wlVKsRjkQZO9ED0+k5pnvYG67ClISB8cUqvRw1bHmqgFy9AKgq7dToCUva?= =?utf-8?q?ZPuoQZh8MwKRq87h/v8AbpM/VXFqbaRk1bbXbtDkkBp7/d7XCbwpOLS6RkNsRwqdT?= =?utf-8?q?eioDYaYjFBoAr35vYmvPUEXF0iqaIoLB7/K8UGv7tZEOJzNsvXWBvuVQBylAbSUgt?= =?utf-8?q?RZ/jmJQInlBNvUAuU2yTAwGYnmbAZUh6t4AaTvDSzPtJuf38dAubg2AqbKJYFp+P7?= =?utf-8?q?+z3JpPmlWBPKTbSkFTIl52VjHZv+AoDrgJh55CMiCS/2ILmiY9x5cfBB6OquvPwZe?= =?utf-8?q?VZonmMkjztJR6zQtfJLPPo9BKU2H20ec0w=3D=3D?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79126536-ceff-43d0-280a-08dc860f7695 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4891.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 10:00:15.5844 (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: jF3M+LWaBsONC82Ttl2K9VkdJgPBJ6CcvphAO/PBUbm7cIBy7iEsqn070r7NVjnU9pWFyQfQtVoLcDNDUmgWw6VU//xUDN8xTOJh5+X/w54= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5433 Received-SPF: pass client-ip=2a01:111:f403:c401::3; envelope-from=andrew.yuan@jaguarmicro.com; helo=SINPR02CU002.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, 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-Mailman-Approved-At: Thu, 06 Jun 2024 11:29:14 -0400 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 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 --- hw/net/cadence_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);