From patchwork Sat May 2 17:53:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524005 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 778BF92A for ; Sat, 2 May 2020 18:03:10 +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 3A1B820731 for ; Sat, 2 May 2020 18:03:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="IQA8xsx2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A1B820731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:39794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwTl-0002xZ-8x for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:03:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSW-0000nG-E1 for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS3-0000SY-VO for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:52 -0400 Received: from mail-eopbgr700053.outbound.protection.outlook.com ([40.107.70.53]:34199 helo=NAM04-SN1-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 1jUwS3-0000Pq-Ee; Sat, 02 May 2020 14:01:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UE/l7s3WsFnYFlKvHuP2tiP97iw6dBxgcE7vlupNmMgK+qreUTMiJmsqrbqKR5OOPnxnNn6Ws4mPgwgToL2zcak0Kh9enyOEtw+PhzRRRl/v3a+P/waPkcPLp0TzFzdWD1LbkBtZ0Flvsqe43RaMpBYLTLJXiqQvHNvyMfYr0DNUu5SSiHc6EB7+hWatPzd5CgiYC88DO/MQA7DfnBr8vjz4o6JdYTu6gqP4kk+REhxpeeTgSElDLtFgHK7kXSyURUbTrSacgpE0sfPH8diLe4nglMl4F4PAJEh4sQIwRam4U3koD6MMxEq29yw7BGbZml7CsobQEamXEjujjDEy/A== 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-SenderADCheck; bh=o8nNTedohwCYJlVXujzbJ9WNeICl3yYvPL0Qj4O5lWU=; b=A9QoRkcO0Ms/HZLogrqUlB739uf92JcA8vmbZQ53z8gPSVd/ykk2tG77FVXjcouFYAelL+obC2n75S2WVujWu3vwDxjQbckIHz/O/qS1PZsvVxm3FWVUqT1n8jqRXSwHmIXWmXqjAc0HKX4YKr3q5KWPwOsYt+mTTWGmH/SlpGoCCxkFVIuLw4hCVjnLj0G62HzwtwauDh1vgfrB3uiicZKZrqEp6GzPPbeBk+dxJv4KFd+OX+94T85LJMQrJeEgg7bV4FaA0Gxoi9ryuHeV/lwcl6c/2PKE6Ws0dl5DIt+/vL1X1BKHt6O9ODmednlKSaz9fbqO1NSTd8z8krUEDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o8nNTedohwCYJlVXujzbJ9WNeICl3yYvPL0Qj4O5lWU=; b=IQA8xsx2d/jqbWG65IS7ObnHZ7/ljj//T4uubNiXt/MAVwYtssXrMJVJq1v+Dw3VUduEwFE6dRVeY76veIpt3B4J3Dn3CTayOJ/8Y8Obaji9yUTZwCSNcQuWJEDIQTgjJyYtPF4+dBIT2MGKXHaxRGOV6yHi3b+1y27iX46HluA= Received: from DM3PR11CA0015.namprd11.prod.outlook.com (2603:10b6:0:54::25) by MWHPR02MB2814.namprd02.prod.outlook.com (2603:10b6:300:108::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Sat, 2 May 2020 18:01:18 +0000 Received: from CY1NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:0:54:cafe::68) by DM3PR11CA0015.outlook.office365.com (2603:10b6:0:54::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sat, 2 May 2020 18:01:18 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT021.mail.protection.outlook.com (10.152.75.187) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:17 +0000 Received: from [149.199.38.66] (port=60238 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRu-0004nQ-1U; Sat, 02 May 2020 11:01:14 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRx-0006w4-98; Sat, 02 May 2020 11:01:17 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1G3g010792; Sat, 2 May 2020 11:01:16 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRv-0006ut-RX; Sat, 02 May 2020 11:01:16 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id A127313C0041; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 01/10] net: cadence_gem: Fix debug statements Date: Sat, 2 May 2020 23:23:05 +0530 Message-Id: <1588441994-21447-2-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(376002)(136003)(346002)(396003)(39860400002)(46966005)(82310400002)(70586007)(2616005)(26005)(186003)(6666004)(6266002)(36756003)(70206006)(42186006)(316002)(336012)(110136005)(426003)(5660300002)(81166007)(4326008)(8676002)(356005)(478600001)(8936002)(2906002)(47076004)(82740400003); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f8ff5f9-0eb6-4557-09ca-08d7eec2cfef X-MS-TrafficTypeDiagnostic: MWHPR02MB2814: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:126; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8T7gNpiGv8qlpukN0eTZZDU0DX61WGCFfc7UokEnRQEiaBDAY+OOYBWek4puRqk0kub1hqKposduTts7cYhnaoVsbqGVG2ugr1whgDym8ZmSwVYf4KXfepXleXMj4Gk+J55DPNodUZdYj0xMbvHKx9YFHCXfikb3lPAeoJ4m9yTvMh/Rehv8yE85mg7KAcnh4F+yWcvRsa2RfdnTD7Tg9fROdKdGwbql8xewg+zNu4JcFbN9oxUaqlVPcM7gBVnEMf0h9XXm7f80K51o6yf4uhNvhQig2y149rzTuQ+aaB9boLZ8cuCZnDqpcKzoq6IdlfbzULwuwkn+HxN+nn31cvkc3kCLl0tTAy2OV+GLxJwD7qgGX+XK2ULbN+zs3mZ6+OGjpM+134FypV3EqlCYuSABxS0GZzYqrjtWx2RBugnHucpgPf0ndrWvmp8Mw6HlFPZxXkPD82p4VRj1BonL8pxTwSOU0QZGaJgiB/zYaoyMwlKCpd/wBrKJmhCNtoGADGla9P+fbKHnmTR5EHgOCA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:17.5690 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f8ff5f9-0eb6-4557-09ca-08d7eec2cfef X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2814 Received-SPF: pass client-ip=40.107.70.53; envelope-from=saipava@xilinx.com; helo=NAM04-SN1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:21 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.70.53 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Enabling debug breaks the build, Fix them and make debug statements always compilable. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 22a0b1b..92fcbe5 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -35,14 +35,13 @@ #include "sysemu/dma.h" #include "net/checksum.h" -#ifdef CADENCE_GEM_ERR_DEBUG -#define DB_PRINT(...) do { \ - fprintf(stderr, ": %s: ", __func__); \ - fprintf(stderr, ## __VA_ARGS__); \ - } while (0) -#else - #define DB_PRINT(...) -#endif +#define CADENCE_GEM_ERR_DEBUG 0 +#define DB_PRINT(...) do {\ + if (CADENCE_GEM_ERR_DEBUG) { \ + qemu_log(": %s: ", __func__); \ + qemu_log(__VA_ARGS__); \ + } \ +} while (0) #define GEM_NWCTRL (0x00000000/4) /* Network Control reg */ #define GEM_NWCFG (0x00000004/4) /* Network Config reg */ @@ -992,9 +991,9 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) return -1; } - DB_PRINT("copy %u bytes to 0x%" PRIx64 "\n", - MIN(bytes_to_copy, rxbufsize), - rx_desc_get_buffer(s, s->rx_desc[q])); + DB_PRINT("copy %" PRIu32 " bytes to 0x%" PRIx64 "\n", + MIN(bytes_to_copy, rxbufsize), + rx_desc_get_buffer(s, s->rx_desc[q] + rxbuf_offset)); /* Copy packet data to emulated DMA buffer */ address_space_write(&s->dma_as, rx_desc_get_buffer(s, s->rx_desc[q]) + @@ -1160,8 +1159,8 @@ static void gem_transmit(CadenceGEMState *s) */ if ((tx_desc_get_buffer(s, desc) == 0) || (tx_desc_get_length(desc) == 0)) { - DB_PRINT("Invalid TX descriptor @ 0x%x\n", - (unsigned)packet_desc_addr); + DB_PRINT("Invalid TX descriptor @ 0x%" HWADDR_PRIx "\n", + packet_desc_addr); break; } From patchwork Sat May 2 17:53:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524003 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2BB3992A for ; Sat, 2 May 2020 18:03:08 +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 A599420731 for ; Sat, 2 May 2020 18:03:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="FT7tBF4u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A599420731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:39504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwTi-0002oZ-G9 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:03:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSY-0000nn-Vj for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS3-0000SL-Py for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:54 -0400 Received: from mail-eopbgr760042.outbound.protection.outlook.com ([40.107.76.42]:35967 helo=NAM02-CY1-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 1jUwS3-0000OQ-7R; Sat, 02 May 2020 14:01:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HmBLVzAPHYGrx7flxRSAGUpBWbqgZvWbcurKQjU6BvrP8yqhZunK8bOE8qGiVPJGsfLrI9oiBsL5m+nKWBFIVp2u65BN7sDmJTq3NkIxkPaj+paxr3S9WVzCOp8S35l6nsacoA5yzeik3prvSihPsphHbNFHEDgTQbcUpdc/KoJvIUh49qPbNiI15jOTz0KTo4il9mnKK9Q/PeWsBMrsqz6SahOvQOnj5d4NRvJUuHMLtKHop+0S1bSLznD26qsZ4oMgQWFNOKCD2I63P4AfmitAiWQbxJrDTHaLVxOV0l3dcHia3zI5CoXHEawm1lgPKSLw4fhpCTrC1IEmXG/cVg== 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-SenderADCheck; bh=Ocw6bLZQ7aVvGQelf4qtGWXMh0VHHX4SMx9RuqgN7J0=; b=QWeNZpjaZGZUsx6ZXZaN/es8Rla1QnnqSPLy857PrjXcGfsTWKozzQAKCukbW+/9t2SAG7b8vpvGSbfSfqwyj8E4iL+GXn0kjoQ9l6NTuXgpDFzmEJyFs9qBJk65ZBRcBTZW2vuth5knQbCH3APieQz891p5RWgiWaLsNhruC2Zkkcy6KEYdjyPZr/b/SbrY16XSo0lH3udsWEdtjrqIZfcIfh1YpnRdnfZvzM59oiW6R2W3ZPTKUKfQ740180BDfnG4d/Yb3yFQ+bfkddi+B4Fc8SOoFy/iQdhkcM35FdlM5AeztMSK9boVV1VHk6GbV7PdD7IBIj946rC3zCoO/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ocw6bLZQ7aVvGQelf4qtGWXMh0VHHX4SMx9RuqgN7J0=; b=FT7tBF4u32a/XP4p1kLHEx5051ixmIWdJgDJHNCQWukCCisoy7vZEeah63pPLFJ9NQ0DXFxuQ6DcXkzXF4pcDK8Nr5R1tg8XGpspuYSmU6x0FDet0aJgGwxOY4g8uOaUNfv+WDS/YTmAGYGTVWTxjam+JiaVNKWgVsWvNcNiHJE= Received: from SN4PR0501CA0044.namprd05.prod.outlook.com (2603:10b6:803:41::21) by SN1PR02MB3728.namprd02.prod.outlook.com (2603:10b6:802:31::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Sat, 2 May 2020 18:01:17 +0000 Received: from SN1NAM02FT059.eop-nam02.prod.protection.outlook.com (2603:10b6:803:41:cafe::48) by SN4PR0501CA0044.outlook.office365.com (2603:10b6:803:41::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.18 via Frontend Transport; Sat, 2 May 2020 18:01:17 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT059.mail.protection.outlook.com (10.152.72.177) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:17 +0000 Received: from [149.199.38.66] (port=60209 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRt-0004nH-Pr; Sat, 02 May 2020 11:01:13 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRx-0006w6-1G; Sat, 02 May 2020 11:01:17 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1GBS010794; Sat, 2 May 2020 11:01:16 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRv-0006uw-S5; Sat, 02 May 2020 11:01:16 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id A625A13C0491; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 02/10] net: cadence_gem: Fix the queue address update during wrap around Date: Sat, 2 May 2020 23:23:06 +0530 Message-Id: <1588441994-21447-3-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(396003)(346002)(376002)(136003)(39860400002)(46966005)(6266002)(478600001)(82740400003)(186003)(2906002)(81166007)(356005)(26005)(5660300002)(4326008)(47076004)(70586007)(70206006)(36756003)(8936002)(8676002)(336012)(82310400002)(2616005)(6666004)(316002)(42186006)(110136005)(426003); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef57e1f1-8ad5-42bc-dd29-08d7eec2cfd0 X-MS-TrafficTypeDiagnostic: SN1PR02MB3728: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:483; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FffO6O4syjfNdepCY6qR6NdAZU1H4rslN1GMxZNyLBHgLFVgPbCN5sCJr3Gd/i/MQ9ByATnmIp2qPh8uM3oaXv+yMEqTHW/ufyHVEuhbL0NmvwB2cqDRD60qTMQT3gRNXMVBUf/yviECfp/m3DDKCPGLtG+jOedN9hLXa+9b63tOEBy2R9kYMfR2N/oIpNW01NMu7airrCOf9h4jWFs7NyqRmlBtZ57k35vb3SOPh1QiLAh5j8EyvOxMUjHLdG7RCWewk61zJxT49+zN1i56tUSoiMzL2YbDK5MqsCc+1LL/nMb+SHjdW0Ms+J7dbJyXDRbdebhZxvDNWBCREuWVHlyEATxXQXVvX3CUFAMrjkVgWzQ+szUa7R1o/ipmrnI8C5UA/00F3872uSOnPJ0CsN5N1BKuuEPeYbcJcixJc5LfxXDN0Vt2vGRzigPebWh/+qseVocs/Ga6V4XCDWcWhBW5eM2VfsW+xkll5ldiIqcKsxXLSFtyuXE07TfL4RxSs+KoakzLDtVvxcEsTW4wJQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:17.3702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef57e1f1-8ad5-42bc-dd29-08d7eec2cfd0 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB3728 Received-SPF: pass client-ip=40.107.76.42; envelope-from=saipava@xilinx.com; helo=NAM02-CY1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:19 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.76.42 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" During wrap around and reset, queues are pointing to initial base address of queue 0, irrespective of what queue we are dealing with. Fix it by assigning proper base address every time. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 92fcbe5..074aaa8 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -845,6 +845,25 @@ static int get_queue_from_screen(CadenceGEMState *s, uint8_t *rxbuf_ptr, return 0; } +static uint32_t gem_get_queue_base_addr(CadenceGEMState *s, bool tx, int q) +{ + uint32_t base_addr = 0; + + switch (q) { + case 0: + base_addr = s->regs[tx ? GEM_TXQBASE : GEM_RXQBASE]; + break; + case 1 ... (MAX_PRIORITY_QUEUES - 1): + base_addr = s->regs[(tx ? GEM_TRANSMIT_Q1_PTR : + GEM_RECEIVE_Q1_PTR) + q - 1]; + break; + default: + g_assert_not_reached(); + }; + + return base_addr; +} + static hwaddr gem_get_desc_addr(CadenceGEMState *s, bool tx, int q) { hwaddr desc_addr = 0; @@ -1043,7 +1062,7 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) /* Next descriptor */ if (rx_desc_get_wrap(s->rx_desc[q])) { DB_PRINT("wrapping RX descriptor list\n"); - s->rx_desc_addr[q] = s->regs[GEM_RXQBASE]; + s->rx_desc_addr[q] = gem_get_queue_base_addr(s, false, q); } else { DB_PRINT("incrementing RX descriptor list\n"); s->rx_desc_addr[q] += 4 * gem_get_desc_len(s, true); @@ -1199,7 +1218,8 @@ static void gem_transmit(CadenceGEMState *s) sizeof(desc_first)); /* Advance the hardware current descriptor past this packet */ if (tx_desc_get_wrap(desc)) { - s->tx_desc_addr[q] = s->regs[GEM_TXQBASE]; + s->tx_desc_addr[q] = gem_get_queue_base_addr(s, + true, q); } else { s->tx_desc_addr[q] = packet_desc_addr + 4 * gem_get_desc_len(s, false); @@ -1251,7 +1271,8 @@ static void gem_transmit(CadenceGEMState *s) } else { packet_desc_addr = 0; } - packet_desc_addr |= s->regs[GEM_TXQBASE]; + packet_desc_addr |= gem_get_queue_base_addr(s, + true, q); } else { packet_desc_addr += 4 * gem_get_desc_len(s, false); } @@ -1457,7 +1478,7 @@ static void gem_write(void *opaque, hwaddr offset, uint64_t val, if (!(val & GEM_NWCTRL_TXENA)) { /* Reset to start of Q when transmit disabled. */ for (i = 0; i < s->num_priority_queues; i++) { - s->tx_desc_addr[i] = s->regs[GEM_TXQBASE]; + s->tx_desc_addr[i] = gem_get_queue_base_addr(s, true, i); } } if (gem_can_receive(qemu_get_queue(s->nic))) { From patchwork Sat May 2 17:53:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524013 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB8D281 for ; Sat, 2 May 2020 18:05:09 +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 A06E5206CD for ; Sat, 2 May 2020 18:05:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Kw9o1t6W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A06E5206CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwVg-0007mi-Q7 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:05:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSW-0000nJ-Vu for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS4-0000T4-1e for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:52 -0400 Received: from mail-dm6nam10on2071.outbound.protection.outlook.com ([40.107.93.71]:6109 helo=NAM10-DM6-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 1jUwS3-0000Pt-KM; Sat, 02 May 2020 14:01:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d0qx/HuWng4XmKxsvIIvh+f8HH7kY42x9K/5sXgR/BG3zHmociN6nDxYuUp7hbS/T+qVsnWsl6aUR4sEmVx5p671wIYdNsIIilGFA+NfK1tjsBSaaov1bbopMOmnMgo4wickR16YdtDG2wfgx3gV1CP7Hs5bmeSrhayYVJ+lwzDGIoNSI8LjyU3ZHUrhcyTjps6bY1Yi6cdjSaimb2pYgmRk4OtaaCXzwbGvyTgzVnoOxalPRO/cNXiO5W922C9Sf33UtCXYOb1Cukrj2wurvFLW3mwKaF6HHlemzv+aKbUhqTysqTbUpua28FGUAX6lS1sEI8HBQAp7QNDRqvzocw== 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-SenderADCheck; bh=A6YWFOvZROHdGdOq2FmyJPOdUqi89zmGcZoGC/TJ/DE=; b=aSuu2P27MKu8GzUTV0B42Z2tM71PfMcNf3RngjlvoP9OHBD5Tmd+IDMNC2mFhFpy1sxln4nNnAsBA1C6q1b5FVU7/Sa6PoyNID522E5q26w1NbilD6g5pJafMgSeWtePsBFkdg4rgOkTDsvKHV/6oG7r7snn59RohZ4VSAE0dtAbuCvmnteVErnvYMEv0E/RRINXqmSTXRMdKc7NuahS/cDz4bq4ytn1fzmX+Bwb30tL8SFEpVzCPwKgj/xGgX7eDV/Pr6sk1hQkqpyBpvfzv8EhfJBnrX3PmBv3KsRzWbskE64kItKrE42hIZI1/3iMiBDaD+klGovRLJDh/TLlIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A6YWFOvZROHdGdOq2FmyJPOdUqi89zmGcZoGC/TJ/DE=; b=Kw9o1t6WlBZG4QWrrQ3AFprb659ipe/QfWR8LqwPXtKwEWb/GTgN9zl/btvfQK4VV3ZLNHk0UlC/xFgxlvzRC6p79UwlMuqwqiHM0lZQcvME7bjdDuHnw+IJldAhtMU1vdpRdMhDe9Li+Zr59dt6GE525tnWG8eAJ/ozwB3ZFWc= Received: from CY4PR22CA0036.namprd22.prod.outlook.com (2603:10b6:903:ed::22) by MN2PR02MB6432.namprd02.prod.outlook.com (2603:10b6:208:181::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:19 +0000 Received: from CY1NAM02FT041.eop-nam02.prod.protection.outlook.com (2603:10b6:903:ed:cafe::75) by CY4PR22CA0036.outlook.office365.com (2603:10b6:903:ed::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sat, 2 May 2020 18:01:18 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT041.mail.protection.outlook.com (10.152.74.156) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:18 +0000 Received: from [149.199.38.66] (port=60229 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRt-0004nK-T0; Sat, 02 May 2020 11:01:13 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRx-0006wA-4L; Sat, 02 May 2020 11:01:17 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1GFq011695; Sat, 2 May 2020 11:01:16 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRv-0006ux-T5; Sat, 02 May 2020 11:01:16 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id ADB4213C1B16; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 03/10] net: cadence_gem: Fix irq update w.r.t queue Date: Sat, 2 May 2020 23:23:07 +0530 Message-Id: <1588441994-21447-4-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(396003)(136003)(376002)(346002)(39860400002)(46966005)(356005)(5660300002)(336012)(82740400003)(47076004)(110136005)(316002)(42186006)(478600001)(8936002)(426003)(6666004)(8676002)(81166007)(2906002)(2616005)(36756003)(82310400002)(26005)(4326008)(70206006)(70586007)(186003)(6266002)(309714004); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9dd4564c-9c27-4248-d86c-08d7eec2d044 X-MS-TrafficTypeDiagnostic: MN2PR02MB6432: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:514; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dyuN7387vA62pxtk2KRux0zVmv/OWPwk16svZoGqhtirBWcJF8cm2MAdW+hKOi5Yzs+lgbjodof0NoOxW4XK/x0RUYPMUdTpBwxzfIAPTw4I/+3oFvSxMk3c+GPEDojZFn3+8QHDse7oDPDnMB5XuhS6EKHVLP81fh/uH2CPyJPMaDf+pZ4j+PCN6ma2HzrBn6KMRfQ6U3lDGEnEr0r0VK6o70BAyby6AFPvwwZIiLsJagARoDsmLd13xYjE539UltJOq7kNCxZ5gVu8fW3ZwFIBgJzCJqBL6S2hBZYjvQADjmUEqkpayX+qZ2KmIEyv7eZo3yGKI/yGopi/gDrNAetA0Jc+SHaraFDznmIQSntcwr01pYC0q5b9s/5LLX6dW4C1m5cIR70n+Xb4EeQ/d9A+buZzpZ3wZ9v0QeueOs+vU+Xu/MrKwS0332S6FsK3UaTm9sakJnCJ2B7K8PbvlbPWUf6hgfQU1t+3ft50ZDUMc0RB+G/Cb6qiS11jG1PIOVYvRgDferIUOYU3OZjQaYBDChxTjSdnbGiLOCQdaKI= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:18.1313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9dd4564c-9c27-4248-d86c-08d7eec2d044 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6432 Received-SPF: pass client-ip=40.107.93.71; envelope-from=saipava@xilinx.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:22 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.93.71 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Set irq's specific to a queue, present implementation is setting q1 irq based on q0 status. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 074aaa8..7782d6d 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -554,29 +554,10 @@ static void gem_update_int_status(CadenceGEMState *s) { int i; - if (!s->regs[GEM_ISR]) { - /* ISR isn't set, clear all the interrupts */ - for (i = 0; i < s->num_priority_queues; ++i) { - qemu_set_irq(s->irq[i], 0); - } - return; - } + qemu_set_irq(s->irq[0], !!s->regs[GEM_ISR]); - /* If we get here we know s->regs[GEM_ISR] is set, so we don't need to - * check it again. - */ - if (s->num_priority_queues == 1) { - /* No priority queues, just trigger the interrupt */ - DB_PRINT("asserting int.\n"); - qemu_set_irq(s->irq[0], 1); - return; - } - - for (i = 0; i < s->num_priority_queues; ++i) { - if (s->regs[GEM_INT_Q1_STATUS + i]) { - DB_PRINT("asserting int. (q=%d)\n", i); - qemu_set_irq(s->irq[i], 1); - } + for (i = 1; i < s->num_priority_queues; ++i) { + qemu_set_irq(s->irq[i], !!s->regs[GEM_INT_Q1_STATUS + i - 1]); } } From patchwork Sat May 2 17:53:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524011 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7650592A for ; Sat, 2 May 2020 18:05:00 +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 4BDF6206CD for ; Sat, 2 May 2020 18:05:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="LoQI0PRk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BDF6206CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwVX-0007OP-DR for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:04:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSX-0000na-AT for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS3-0000SE-Mp for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:53 -0400 Received: from mail-bn8nam12on2066.outbound.protection.outlook.com ([40.107.237.66]:11321 helo=NAM12-BN8-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 1jUwS3-0000Ol-41; Sat, 02 May 2020 14:01:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LkEmVFwsTaMs4NS5zJto/fXl4WrckPBZImYKkYoZ/mwItedCDG0D1B1baokZ7+cdRUsh3YRIDB+6KH5gJNV4Zc2rcC8UsBwXB0WSI47k5XppO0nWYUYvfbhIGmhNxvZ+wOObIb7FMbgyNiTwdQCcnLGXtzSVoNhO0ZXMmmJ6GBJEN452bHsoq0okaZHHJk6KjOK6v45HDQhAooRP04tYA3LxTHE+7V7bOePr94uxtxsAYuiCREIBlfX2xvFII87o+hiXm68I+Vvx2kH2+C586K+MOKoFojzfcqNDgPmlp7CFdiNsrCusn/K2Ghz2LmpPr7vzd7WAn3fq3Zem7ASgkg== 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-SenderADCheck; bh=jYhKWbdM3mS96mQr9QEiu4aJM0u5/RuFoCcj7G/mxxQ=; b=nsytAks1/t+5RW/RKD5//ojqbQNNqorckc9sASRJFsNugY/ZTJl1EBsvd3WKCfKOS/TheQagCbEI38FythXyhIlfwUr5Qstjg8pVxB8J8YKQIyB5zSDfpxsYIqAb9NP+0C9LMkaxumiDaRJFh3l98nZZl32l2gvcujLP0N/8s8bFBQFnm+Z5renZyVtTxrQVt3ZEVqXfOzFueVY3hvBHm8P8WuTb1V0TymjQqxGJIRF7hUuBH/85daLxF49mnOY5dP4LNniwP8Ommf3322RhH6fAvQprf47edKPJoVhfqHnuYx1RnbEBZ+hIC0Vovu2gSibyKrXd0HEAZCsSipQZdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jYhKWbdM3mS96mQr9QEiu4aJM0u5/RuFoCcj7G/mxxQ=; b=LoQI0PRkjcQJ7BtvLpa3vtuYOnNYjcbJuVfmy47D4EI/pOpz1fShfEnhHk57Zte8PqlEk49IKl2BkvAcB0bUqCzuPGpipWdrQRSErMx+1IjAoMRoB5n/6zY2nGdeB2cG5VBIu3wPmx5OAzCf5+go4Dn4bAK8gaX7eHnfXrsBxOE= Received: from DM6PR13CA0062.namprd13.prod.outlook.com (2603:10b6:5:134::39) by CH2PR02MB6664.namprd02.prod.outlook.com (2603:10b6:610:a6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:18 +0000 Received: from CY1NAM02FT061.eop-nam02.prod.protection.outlook.com (2603:10b6:5:134:cafe::2f) by DM6PR13CA0062.outlook.office365.com (2603:10b6:5:134::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.14 via Frontend Transport; Sat, 2 May 2020 18:01:18 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT061.mail.protection.outlook.com (10.152.75.30) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:17 +0000 Received: from [149.199.38.66] (port=60242 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRu-0004nT-3U; Sat, 02 May 2020 11:01:14 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRx-0006wB-BD; Sat, 02 May 2020 11:01:17 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1G0A011699; Sat, 2 May 2020 11:01:16 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRv-0006v0-UM; Sat, 02 May 2020 11:01:16 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id B59BD13C1B3C; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 04/10] net: cadence_gem: Define access permission for interrupt registers Date: Sat, 2 May 2020 23:23:08 +0530 Message-Id: <1588441994-21447-5-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(346002)(39850400004)(396003)(136003)(376002)(46966005)(2906002)(426003)(2616005)(81166007)(356005)(478600001)(8676002)(8936002)(70206006)(82310400002)(70586007)(6666004)(36756003)(5660300002)(316002)(110136005)(42186006)(186003)(336012)(26005)(82740400003)(4326008)(47076004)(6266002); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c209c3d9-5ad7-4bb2-a859-08d7eec2cff9 X-MS-TrafficTypeDiagnostic: CH2PR02MB6664: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:153; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TUjDgUZ7E22x0RyI+6z9KrcPpoY6JeGKNCRI1rrLLUscQ8Qvfha9c9l+SUzu4pD7mhLyaV9HxsUpN93xDAUMimJ7735G+qU7d41O98Cju03sXj+jmkyAYUFdMSz3+kjpNf+PDtHYSzdJvQPvBJu+HSY6BWX7JeHDpS1BWyfh8gJk9PfunaALmahH57mulYWOFT3Fnj42CfibkvsChpwykDI2ANbH+Lqa6eTy11rvSkIKFIUrtFHowz/9FEl3L/4qXW5zUoDDdcoH9ZyLyc1zXubwUySwhq3bn37e1Ml+/myYfaLbC6mB4IM8pS1OTowjZEBqGM8FuW88m9PIOgI8fGW11xF5+n/n3rlcf0ZWuZexv1yLCv5sP8doNoOEQByFdUEzq4SagZamneymctT0sNQiW3O2U0a04WSDfXAM7hIjhT2WQfZlqaVKg/ORAP1AIS5E8pTvUK7qPfH3ARzOIuhGigOmHfBfwsn3+dDmiRcPw/t2Ydh+RJioGNeWxw219m7aHcrAkbfv+58/Bg4PBg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:17.6266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c209c3d9-5ad7-4bb2-a859-08d7eec2cff9 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6664 Received-SPF: pass client-ip=40.107.237.66; envelope-from=saipava@xilinx.com; helo=NAM12-BN8-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:20 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.237.66 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Q1 to Q7 ISR's are clear-on-read, IER/IDR registers are write-only, mask reg are read-only. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 7782d6d..e745d60 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -458,6 +458,7 @@ static const uint8_t broadcast_addr[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; */ static void gem_init_register_masks(CadenceGEMState *s) { + unsigned int i; /* Mask of register bits which are read only */ memset(&s->regs_ro[0], 0, sizeof(s->regs_ro)); s->regs_ro[GEM_NWCTRL] = 0xFFF80000; @@ -470,10 +471,19 @@ static void gem_init_register_masks(CadenceGEMState *s) s->regs_ro[GEM_ISR] = 0xFFFFFFFF; s->regs_ro[GEM_IMR] = 0xFFFFFFFF; s->regs_ro[GEM_MODID] = 0xFFFFFFFF; + for (i = 0; i < s->num_priority_queues; i++) { + s->regs_ro[GEM_INT_Q1_STATUS + i] = 0xFFFFFFFF; + s->regs_ro[GEM_INT_Q1_ENABLE + i] = 0xFFFFE319; + s->regs_ro[GEM_INT_Q1_DISABLE + i] = 0xFFFFE319; + s->regs_ro[GEM_INT_Q1_MASK + i] = 0xFFFFFFFF; + } /* Mask of register bits which are clear on read */ memset(&s->regs_rtc[0], 0, sizeof(s->regs_rtc)); s->regs_rtc[GEM_ISR] = 0xFFFFFFFF; + for (i = 0; i < s->num_priority_queues; i++) { + s->regs_rtc[GEM_INT_Q1_STATUS + i] = 0x00000CE6; + } /* Mask of register bits which are write 1 to clear */ memset(&s->regs_w1c[0], 0, sizeof(s->regs_w1c)); @@ -485,6 +495,10 @@ static void gem_init_register_masks(CadenceGEMState *s) s->regs_wo[GEM_NWCTRL] = 0x00073E60; s->regs_wo[GEM_IER] = 0x07FFFFFF; s->regs_wo[GEM_IDR] = 0x07FFFFFF; + for (i = 0; i < s->num_priority_queues; i++) { + s->regs_wo[GEM_INT_Q1_ENABLE + i] = 0x00000CE6; + s->regs_wo[GEM_INT_Q1_DISABLE + i] = 0x00000CE6; + } } /* From patchwork Sat May 2 17:53:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524019 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 050DF92A for ; Sat, 2 May 2020 18:06:59 +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 CE5DF206CD for ; Sat, 2 May 2020 18:06:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="HwmdtZgn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE5DF206CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwXS-0002cj-0o for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:06:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSX-0000nc-Ta for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS4-0000Ut-Rd for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:53 -0400 Received: from mail-dm6nam11on2058.outbound.protection.outlook.com ([40.107.223.58]:23553 helo=NAM11-DM6-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 1jUwS4-0000R4-E4; Sat, 02 May 2020 14:01:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YbgCn2Z7xwfOZgdiYhw30yoMCMdPCzj3mH7/52ulAXAQAdwObHcwajPQD6KNwK+2asimb4wrUbBmPCmwZOMb/k8UX1mUYuNaGrvQH6bBCuoM+u/XRpwwtYT2XkgN/JvV+1C5A2qJIZ+N+iIjQdwv7+2PecZXdkD2+CuzxZU64PBzY6L84qamllTL7RBJ97989X53Owy6ATXSIXSUeOXcrX5rIKieQVYVfTS3Cu5i5tbtlG/8OEvkb8VaprPIty71y/6iD8R4bBuaGD9xObKYnP5pELAksHE8kDWHz9V6uAYjrdvx2IMXhDrhCyL/diKun10YiHN+u7Z87Osfp9+8VA== 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-SenderADCheck; bh=nZ1ywWiJVaXbw5dmdRo11tfhYr68Z0JK7kBrns8pnQg=; b=Gx5NMRPsKwBFLidL26EbF+WmA64pImE3UgqvwS7pzhw18wfP7VOk6PWUk5bNWjkjipINSGItCuGtVn0x1pQYvXijSeT+A9JX/MKBQ6CZlar4MU7A3xBbkfrEHmL9zK6jJEBs9QytRSTmkibyBAiTTYY9bQDL+X7wAa2m6iXTUe2O/24rElshsCdiOCQO1dkbD354yf9UAPSsnBmDlW3zkVBaXXNsUlvf+AFLAfHQS4UpiRvInHWwAne/OWhp78fSF6XXS577lWhLkT7B2P8u0IVZnBmNQXuCJ+6jBuksHrE+iOXgeka2yXzi666KJl9K07eQ4DgFAhdMVg1hY12S2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nZ1ywWiJVaXbw5dmdRo11tfhYr68Z0JK7kBrns8pnQg=; b=HwmdtZgnCcDDxIO5vvKw8It4Y41zrJTQ8zv7/sqiCRpVbCVBLCra4kURsRptK4kT0cfKm0i+iuIvh5pv2zVRY7Vqo5hJ+F31H31USGGj/JxdodaWKUeIzuW9TsgSZNROCmVllQXGdWGPVOsnTLv39FoVIBzKOgk+mLureP8zt30= Received: from CY4PR18CA0072.namprd18.prod.outlook.com (2603:10b6:903:13f::34) by MWHPR02MB2366.namprd02.prod.outlook.com (2603:10b6:300:5d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:21 +0000 Received: from CY1NAM02FT018.eop-nam02.prod.protection.outlook.com (2603:10b6:903:13f:cafe::65) by CY4PR18CA0072.outlook.office365.com (2603:10b6:903:13f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Sat, 2 May 2020 18:01:21 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT018.mail.protection.outlook.com (10.152.75.183) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:20 +0000 Received: from [149.199.38.66] (port=60348 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRw-0004ni-VW; Sat, 02 May 2020 11:01:16 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwS0-0006xJ-6n; Sat, 02 May 2020 11:01:20 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1HSL010808; Sat, 2 May 2020 11:01:17 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRw-0006vm-Tn; Sat, 02 May 2020 11:01:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id BA9CB13C1B02; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 05/10] net: cadence_gem: Set ISR according to queue in use Date: Sat, 2 May 2020 23:23:09 +0530 Message-Id: <1588441994-21447-6-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(346002)(39860400002)(136003)(376002)(396003)(46966005)(478600001)(5660300002)(4326008)(6666004)(70206006)(336012)(70586007)(6266002)(36756003)(2906002)(186003)(26005)(8676002)(8936002)(426003)(47076004)(82310400002)(110136005)(82740400003)(81166007)(2616005)(42186006)(316002)(356005); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b57ee668-10fb-402d-f232-08d7eec2d1ac X-MS-TrafficTypeDiagnostic: MWHPR02MB2366: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:220; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zTBiyTLJyRp1hgQeI8teU9Cc11uRIYcN5LX/tEXYekXtmiBKI20Dm54NkQF6jQVzuCgBmLQrSYsaImREfYXYRz+OKOIbeOSP7n41HS3KUu7F+v7PRg6MqnT+wZMSK0v1VDWQ7e60Q2tHRhb4eI1eDjmAMcs5eqd9uT/ER2FHvtd7r0KdB2lZ3eWLiLp+CaJtK3CiOmo/DL9Ni+MpZemu7pOMvajF+xgeirQb0h+Mw1WpPcr6BR+zpTZrb2qNa1YZxwBSFJcLntFJktVMNF8cJ8bMUDBPNulXNNfrOD401seuda1SgRcDN6C15jxyivHD/Rfz7iBmdLtg3qkjzE1gEPOc3GVzdJ1SJ9ZAc3N9JkQgHsR+gPPLEbH0Xs/99wn1/nZXYOr9Lg6qRPGklVJ0cdbyENNa35Q6P+OE76U5I3lsHAtCOPQVDdKvskbqEo7cwyHNZd+57GWmXrSwxZfnGIem2wnZ6PXZF5YoMWWQ6punODUqasvTZKKAs89xK9d06nfXnW36NZGJm1xfCNGzfg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:20.4918 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b57ee668-10fb-402d-f232-08d7eec2d1ac X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2366 Received-SPF: pass client-ip=40.107.223.58; envelope-from=saipava@xilinx.com; helo=NAM11-DM6-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:22 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.223.58 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Set ISR according to queue in use, added interrupt support for all queues. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index e745d60..cc9e735 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -896,7 +896,13 @@ static void gem_get_rx_desc(CadenceGEMState *s, int q) if (rx_desc_get_ownership(s->rx_desc[q]) == 1) { DB_PRINT("descriptor 0x%" HWADDR_PRIx " owned by sw.\n", desc_addr); s->regs[GEM_RXSTATUS] |= GEM_RXSTATUS_NOBUF; - s->regs[GEM_ISR] |= GEM_INT_RXUSED & ~(s->regs[GEM_IMR]); + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_RXUSED & ~(s->regs[GEM_IMR]); + } else { + s->regs[GEM_INT_Q1_STATUS + q - 1] |= GEM_INT_RXUSED & + ~(s->regs[GEM_INT_Q1_MASK + q - 1]); + } + /* Handle interrupt consequences */ gem_update_int_status(s); } @@ -1070,8 +1076,12 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) gem_receive_updatestats(s, buf, size); s->regs[GEM_RXSTATUS] |= GEM_RXSTATUS_FRMRCVD; - s->regs[GEM_ISR] |= GEM_INT_RXCMPL & ~(s->regs[GEM_IMR]); - + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_RXCMPL & ~(s->regs[GEM_IMR]); + } else { + s->regs[GEM_INT_Q1_STATUS + q - 1] |= GEM_INT_RXCMPL & + ~(s->regs[GEM_INT_Q1_MASK + q - 1]); + } /* Handle interrupt consequences */ gem_update_int_status(s); @@ -1222,12 +1232,12 @@ static void gem_transmit(CadenceGEMState *s) DB_PRINT("TX descriptor next: 0x%08x\n", s->tx_desc_addr[q]); s->regs[GEM_TXSTATUS] |= GEM_TXSTATUS_TXCMPL; - s->regs[GEM_ISR] |= GEM_INT_TXCMPL & ~(s->regs[GEM_IMR]); - + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_TXCMPL & ~(s->regs[GEM_IMR]); + } else { /* Update queue interrupt status */ - if (s->num_priority_queues > 1) { - s->regs[GEM_INT_Q1_STATUS + q] |= - GEM_INT_TXCMPL & ~(s->regs[GEM_INT_Q1_MASK + q]); + s->regs[GEM_INT_Q1_STATUS + q - 1] |= + GEM_INT_TXCMPL & ~s->regs[GEM_INT_Q1_MASK + q - 1]; } /* Handle interrupt consequences */ @@ -1279,7 +1289,10 @@ static void gem_transmit(CadenceGEMState *s) if (tx_desc_get_used(desc)) { s->regs[GEM_TXSTATUS] |= GEM_TXSTATUS_USED; - s->regs[GEM_ISR] |= GEM_INT_TXUSED & ~(s->regs[GEM_IMR]); + /* IRQ TXUSED is defined only for queue 0 */ + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_TXUSED & ~(s->regs[GEM_IMR]); + } gem_update_int_status(s); } } From patchwork Sat May 2 17:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524017 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A73DD81 for ; Sat, 2 May 2020 18:06:44 +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 7D4CC206CD for ; Sat, 2 May 2020 18:06:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="KrA3tpJp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D4CC206CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:55018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwXD-00028J-Md for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:06:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSX-0000nZ-5O for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS4-0000Tw-J5 for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:52 -0400 Received: from mail-dm6nam10on2077.outbound.protection.outlook.com ([40.107.93.77]:64001 helo=NAM10-DM6-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 1jUwS4-0000QS-6d; Sat, 02 May 2020 14:01:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gWQU6LCL/LJtKjvJSYuL+Dp9ZRZwsqsfZmThFNjC7IXnx94EkeEnQ199FoLqF5HpXdGxEuUpRlnsLrhwnUmRlPrrKa+yX4+kGzzSBVNRJyOeQ1Sri8fwck4aP/nCslkbohhQFnB265jQbOapW569TKNvvtehDU+1JyflWaD+psu9HZyi+BS8frYh0rkVemwblU9jrcigtvog+mXgWRSZd40JsAmlvQuvnslVdDRyiYEmJanlnkNDu1Bz14MFHN3K7aI9QFdnIyNdqUA3S5BqXaOz4f4qDvUERjEbkPmoxUmJPVR3VD3Bz/ExclUfD5FyfJ8xu3k5LJuj3lEdopDilg== 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-SenderADCheck; bh=U4iLAruzG3f4R7NQpfESjz+UT95QD4XrITpVG0QA9UA=; b=G2zTHG+Y7k3qJwCeKHEEXlRaArUNl0z2N8Ody8Yuau3G6PfkEup+qx129SoR/6+hP9Ed1Gs7X4RREpV18rFWJuzXgHyvdiFr9pFw81uNutu2P/kdnc+t0F39iGdzSYDO5SebdREOnBEeq4y2wEbXHL3rQxJTIlhyUq/mwheQBCIPqWyfJJkybdtIruIPg9kpAgsw9vbkXdUOHOVSBoiZoCIqsyArJchuFMNm3zHFICAasWUlG0hqQ5LUx8M2jAns0fx5cosfamhEVzutzopp22Enzxb8uEwyDGGmev+GFbzmZVzarokQ6Wrjf/BfIpSexhovaH/H5FHH7Dzgir11eA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U4iLAruzG3f4R7NQpfESjz+UT95QD4XrITpVG0QA9UA=; b=KrA3tpJpvy6PEU9iFzViFttjtA7C9z8BNaUJO+mTuXXK8nK10ikFTbG7ij6F66+zXLSYc1FiJ6U8I3fg9IJE2NfcZ1wZJX2jP3T9njHAiRELbboYxASS0Q+sxYB+kocAsoe/vyd4LQhnN9GU129i/EcHxUOUuDg9uWILUUbKUVc= Received: from SN4PR0401CA0023.namprd04.prod.outlook.com (2603:10b6:803:21::33) by MN2PR02MB6046.namprd02.prod.outlook.com (2603:10b6:208:1be::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:21 +0000 Received: from SN1NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:803:21:cafe::44) by SN4PR0401CA0023.outlook.office365.com (2603:10b6:803:21::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.21 via Frontend Transport; Sat, 2 May 2020 18:01:21 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT021.mail.protection.outlook.com (10.152.72.144) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:20 +0000 Received: from [149.199.38.66] (port=60350 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRw-0004nj-VZ; Sat, 02 May 2020 11:01:16 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwS0-0006xK-6u; Sat, 02 May 2020 11:01:20 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1HI1010810; Sat, 2 May 2020 11:01:17 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRw-0006vn-Tp; Sat, 02 May 2020 11:01:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id C473013C2192; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 06/10] net: cadence_gem: Add support for jumbo frames Date: Sat, 2 May 2020 23:23:10 +0530 Message-Id: <1588441994-21447-7-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(376002)(39850400004)(346002)(136003)(396003)(46966005)(47076004)(2616005)(110136005)(42186006)(4326008)(6266002)(336012)(82310400002)(316002)(8676002)(70206006)(8936002)(5660300002)(36756003)(82740400003)(6666004)(356005)(26005)(186003)(426003)(81166007)(2906002)(478600001)(70586007); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 280bb1c8-0b85-4200-2b8e-08d7eec2d1b6 X-MS-TrafficTypeDiagnostic: MN2PR02MB6046: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:68; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lGWE93w57x+x2jCAziaikKGi+9Nyl5nlluHyZXFIPSj4vND1PEkN0XOFaRwnQSRtGVD7BwusWFwGpcUE4EFfMC2fyNbZKV2J+f+GrYRdQKlc9t4cwFxtiCtqp0PFs4R/ORp7WwxXkL/mXoN9/qaZ2g371qHE5fFjjQ++f9NyjyvPY4oC0ZgQRxyOJNh6iHVSgH90sYPwjOw5GLn9gQ1KJ+SrOl6fEGTOKF99huSYc4tA32zz5A+YJhgxnE81Yxf7wgXN2IgPNUQz/Dzx9aSPs1gfhPH5JnT6UDzbd1YK2FSNYJ3PBxosmBhFl6ZUenlBhbXDUPzKjoPaFJJtlWm3r5weZNF+TOV5zowZHwqZR87dy2kvw72qzeh13tFje1Ao0ajRIAyM81oiNp1cGwz3SYpBDavP+ir4K3Ys6IdOKkScRVhWI0aQ6Rop9f2j6dCXOWNw07zcm16bty1PiNPcDqURp7boXPVp7/USUfnuintA4hAu5utM65kgrZL+0uHACfgodoA93OQWsvcP1nYe+Q== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:20.5527 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 280bb1c8-0b85-4200-2b8e-08d7eec2d1b6 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6046 Received-SPF: pass client-ip=40.107.93.77; envelope-from=saipava@xilinx.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:22 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.93.77 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Jumbo frames of size 10240 bytes is added. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index cc9e735..75fdb00 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -313,6 +313,7 @@ #define DESC_1_RX_EOF 0x00008000 #define GEM_MODID_VALUE 0x00020118 +#define MAX_TX_FRAME_SIZE 10240 static inline uint64_t tx_desc_get_buffer(CadenceGEMState *s, uint32_t *desc) { @@ -1142,7 +1143,7 @@ static void gem_transmit(CadenceGEMState *s) { uint32_t desc[DESC_MAX_NUM_WORDS]; hwaddr packet_desc_addr; - uint8_t tx_packet[2048]; + uint8_t tx_packet[MAX_TX_FRAME_SIZE]; uint8_t *p; unsigned total_bytes; int q = 0; @@ -1343,7 +1344,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_RXPARTIALSF] = 0x000003ff; s->regs[GEM_MODID] = s->revision; s->regs[GEM_DESCONF] = 0x02500111; - s->regs[GEM_DESCONF2] = 0x2ab13fff; + s->regs[GEM_DESCONF2] = 0x2ab12800; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; From patchwork Sat May 2 17:53:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524009 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C72B081 for ; Sat, 2 May 2020 18:04:41 +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 9C5AD206CD for ; Sat, 2 May 2020 18:04:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="G0H+X6i5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C5AD206CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:46670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwVE-0006bN-P1 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:04:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSW-0000nF-Dq for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS3-0000S8-OF for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:51 -0400 Received: from mail-bn8nam12on2064.outbound.protection.outlook.com ([40.107.237.64]:6136 helo=NAM12-BN8-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 1jUwS3-0000P1-4U; Sat, 02 May 2020 14:01:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ajf4bjZOTjZ9/BGALMCjVWGsvlvAuK2XlYiwII/WKcpi8/jGd69c1x3Sk/QIecLkLEqsOCn7afCgWpIRy/1WXJhCbZZM9COjlWsdoeRhMr3k97x2y/9C8pcKFlsLosayxORk9Kwwjq4V5ydu1ceyx7+boVPEfTlOhfXK4Ce5lHriwErxVbxY2CDfLJNUReBufueaboJj5xQ+ho6kCjoIFFzrGhwwE975H/p+pqv7bTu5QLoF46nQL8SP85s3eNIFSEvP4HHjo82/aaOx0rT7e/IFnZv923N73n23tGsJiFjiYUpCATzgcBJifewwnepngxwQxuK2AxBWmpjFw0cZJg== 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-SenderADCheck; bh=t0pEcXdHCHqmCfb5mHs9p26OpxNuXwfeO+4VfheGMX8=; b=JOeDfdU34pm8JcD0hTdODZ26UCeC0M483M/ZAgx7m10ww860TlcZZEGfMt5j70vZMe0uITkcXO2L3SItpKUTqZWbprVEaDZokEcUHCdd2ZojUtkwltACUVL6uxDQnMBZfcpzMhNUY+0SpBjAOUDDs+S9cAM6l78lFY3Yn9MZWNLvWED+vLGp92FbmIO+ZNiNFZ7AyHDoAd1uKvuBg8vvGOnKKxFWO/9RX0bgzCFWvlyHs3E4ONZklkwJ2GRXAwqfQAdLsl8bfoOj+zpndcmGef3xxS0wXH1uTSd8TdYEVJ+873l36XE6krXIpd5sJjjKF39xWjBFpc4LTE2cxcABeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t0pEcXdHCHqmCfb5mHs9p26OpxNuXwfeO+4VfheGMX8=; b=G0H+X6i5AgWeuNqpT30qo4Ybp5ELRCBTMYbVAPrGL++NB9k7SU4CHyPP0V0HzPco+YfJ0WArSvqcY4VT7Qdof8Rg+WEVWiJfipgaKuDph3rl+wBLhu2NZ0IIA8Zcjc4GUYAUuq6znhs11VLiXiNURhxBrtlbzVP0YffhzoFDCsk= Received: from CY4PR22CA0090.namprd22.prod.outlook.com (2603:10b6:903:ad::28) by CH2PR02MB6599.namprd02.prod.outlook.com (2603:10b6:610:7b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:19 +0000 Received: from CY1NAM02FT019.eop-nam02.prod.protection.outlook.com (2603:10b6:903:ad:cafe::be) by CY4PR22CA0090.outlook.office365.com (2603:10b6:903:ad::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sat, 2 May 2020 18:01:19 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT019.mail.protection.outlook.com (10.152.75.177) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:18 +0000 Received: from [149.199.38.66] (port=60285 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRv-0004na-3t; Sat, 02 May 2020 11:01:15 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRy-0006wq-BU; Sat, 02 May 2020 11:01:18 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1HsO011720; Sat, 2 May 2020 11:01:17 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRw-0006vo-Tp; Sat, 02 May 2020 11:01:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id C977A13C1F1D; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 07/10] net: cadnece_gem: Update irq_read_clear field of designcfg_debug1 reg Date: Sat, 2 May 2020 23:23:11 +0530 Message-Id: <1588441994-21447-8-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(396003)(376002)(136003)(346002)(39860400002)(46966005)(36756003)(478600001)(81166007)(6666004)(8676002)(2616005)(426003)(2906002)(8936002)(5660300002)(336012)(356005)(42186006)(70206006)(70586007)(110136005)(26005)(186003)(4744005)(82310400002)(47076004)(82740400003)(316002)(6266002)(4326008); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f70c0bf-d39f-42c2-4567-08d7eec2d093 X-MS-TrafficTypeDiagnostic: CH2PR02MB6599: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:185; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SAKyGLbWCs9lY4LFlKN1CQ7SNCeGxlRGgXIE8ObTUp8lUcxuUHSEJvyz0HqvmvtJHUYKAit4Eb+Ht+tuSGjpsy7Pz1oHAupC0uWMf+iGn2rDXowo7R7OA1pa7UQ8PpwPoc1YfYJZ3Deetvj+v46p1vm27jX84MhjHJYL1WPCWOxehtmenbRi3TLlYu7dUFVuI4zijgvSqbWdTHBLwlnciNBYZyVuvHxuVpDXTxa7hQ2r5Pin098AwCqD2KWh1w5996iQl3z43JZWc79fCOagktI440/qdWPF1yN5Pviwe6LQ9A6nRO53pn+DF25wlZHge63qJqOS3OPHHnVMLVOVvMXKGpMa5Ct49Zk0Kt/oSBgCFBV2hN4z38pNgY5CM3s03t2i74z8sbAylMyBh5JlTfoL9cR8Ko+zyK8ag/NH59eBZidaivyrFYIt6zD5hXmP+PNGBKdQb/ORy3pC+s2/NuPzsko51b/SraMBXTg+zMas1NWZRNnG8Q7WdFSWIA7K2SaATdBauSM5nVOeHxmEqA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:18.6453 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f70c0bf-d39f-42c2-4567-08d7eec2d093 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6599 Received-SPF: pass client-ip=40.107.237.64; envelope-from=saipava@xilinx.com; helo=NAM12-BN8-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:20 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.237.64 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Advertise support of clear-on-read for ISR registers. Signed-off-by: Sai Pavan Boddu --- 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 75fdb00..e6a3d6c 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1343,7 +1343,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_TXPARTIALSF] = 0x000003ff; s->regs[GEM_RXPARTIALSF] = 0x000003ff; s->regs[GEM_MODID] = s->revision; - s->regs[GEM_DESCONF] = 0x02500111; + s->regs[GEM_DESCONF] = 0x02D00111; s->regs[GEM_DESCONF2] = 0x2ab12800; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; From patchwork Sat May 2 17:53:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524015 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3D5CF92A for ; Sat, 2 May 2020 18:05:19 +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 124BD206CD for ; Sat, 2 May 2020 18:05:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="gJ3NrsSp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 124BD206CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwVq-0008Fk-5c for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:05:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSY-0000nk-Nm for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS5-0000Vk-Mu for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:54 -0400 Received: from mail-bn8nam11on2074.outbound.protection.outlook.com ([40.107.236.74]:6055 helo=NAM11-BN8-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 1jUwS5-0000Su-AA; Sat, 02 May 2020 14:01:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CFVJeQXgi5TxtjhUKmW/fcagvgthKZ3GIV1lQHl3H83vyI5YoTOqqR8jlmrW20rvDBejF6R4yREO3ooLnZGVUULkRAeenHWJOtpU9/MQ897ZagTYrTihu2cojFaTdqqejpwKNBDFrJWPSB9Y+LscSjL6aV8Z9vXR4J3hUma6J9zQCsK+dPv/7zTgVrpKBAfHnIJN9ZpSM/aTWIhg6Uzhxa6jKyr/AegYTGsWIjIfpqjkcK1l7B3ALgLbmZp3vRTpMBH98INJ13iK6p9w1MoGM4IX0ypV2ea1fvb1FbIUwF0s5JIiAQ9G3pGTGWEBd/vKH6XIyuftPAHKrV6YfFnlpw== 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-SenderADCheck; bh=2OzxnUCFZOanLWHbiKGtRBa0bgjjiM7xSsLvRWnbZuE=; b=YJzANwT5y1e6Zef+5yFKtTv1/NFdTV0P8ZvaGD75CtBy+gWTT8I/U4kIiV6TMSHBduK30ZRPbgbkX5fzmu/K6Z6r5pZxzpP1CVLx5cB42N5E7arPCnEye0WGq9wfaDuKTwM8fXUg5v9+pmWRGOH8scnGQe11+1/yYUkii0YmuMwTf9JtX6NwNg1irROmM6W7rxAGUtnQdgjzBoFAkplnfgsakBNplXr+pZpTvYbuZAdUmtgeVvFhb6nNKXgklEsdlEbHgLkVvaoVBco4u38VbAd00AZLEskGEUzFsr4stau2duLd1FhCcKfFZS25FV8MECzjqB5uhsXMafXHyvdIYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2OzxnUCFZOanLWHbiKGtRBa0bgjjiM7xSsLvRWnbZuE=; b=gJ3NrsSpzBRro4zxZ0a8kL1aclyOhxZ8yYfyS96W/3L/wQRAfkT1fWTESCTVhFs4fjeMlLb8HmLiW5E8INs99IUDgBaffLlqRv7jEQjBkD6C8etaPrU3w4Or1Qs8HKSDg0lE089h8tLPijLT0RhWuyi/576hqj2lO9i4X99g9Bo= Received: from DM5PR04CA0062.namprd04.prod.outlook.com (2603:10b6:3:ef::24) by BYAPR02MB3909.namprd02.prod.outlook.com (2603:10b6:a02:fa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:21 +0000 Received: from CY1NAM02FT053.eop-nam02.prod.protection.outlook.com (2603:10b6:3:ef:cafe::b0) by DM5PR04CA0062.outlook.office365.com (2603:10b6:3:ef::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sat, 2 May 2020 18:01:21 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT053.mail.protection.outlook.com (10.152.74.165) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:20 +0000 Received: from [149.199.38.66] (port=60352 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRw-0004nk-Vn; Sat, 02 May 2020 11:01:16 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwS0-0006xL-6t; Sat, 02 May 2020 11:01:20 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1Hek010813; Sat, 2 May 2020 11:01:17 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRw-0006vp-U5; Sat, 02 May 2020 11:01:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id D32F113C2544; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 08/10] net: cadence_gem: Update the reset value for interrupt mask register Date: Sat, 2 May 2020 23:23:12 +0530 Message-Id: <1588441994-21447-9-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(396003)(376002)(136003)(346002)(39860400002)(46966005)(70586007)(81166007)(478600001)(2616005)(6666004)(8936002)(336012)(426003)(356005)(5660300002)(2906002)(8676002)(70206006)(4744005)(26005)(82310400002)(36756003)(110136005)(186003)(47076004)(316002)(6266002)(42186006)(82740400003)(4326008); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca5f8df1-eab0-4504-a0ed-08d7eec2d1d8 X-MS-TrafficTypeDiagnostic: BYAPR02MB3909: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:83; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xnt8bjGrLDJe1zOJ04EPSun4WQKKCgQbyu8plClDVMoyXWoVqlCjV2rcDxuX2tUL9bBfcNIy10nibbIOCBXB2Azad/wMOXJxq9m+5XUdW7rcz70qJltW7Vi+VTwlN5J2YUrJEfqQ2DcNyFl0TrwBGL4R8t1ipnZg5ADTMKF3oUDoWAcuysPywkEvSyjL8j6Zvwvf3cvnOFh69wowx+m0AnJDQ2yCbg/adGxXeTftZvNze1OWj5lCIxdAg2th6jRosjQbxKT+AF8XqgMOJoOY1Sgc20lqJRc62P0Hx3PLsCKsHhh0rbkuqqOxDnLDFYSwnFoSDl1w/OaFsrZp9vwN3X1AjKnOcGlsKhsrpVZUfVL6CwcbLNNUHZCaSadgRX2koMhMLPL9X6C0Ly98zoEqw4MfVTtOaYeFK8dIRY5sf0LWw5vD9SeRYJgdGzB+ocxLACBxo0RIttP2EUrLpibfAJJME67cudIXAXG68exMhz6ryJ+j0BHCFWM7Oq1gdzwFcDEEU52wvx0xDbeWvfA00A== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:20.7771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca5f8df1-eab0-4504-a0ed-08d7eec2d1d8 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB3909 Received-SPF: pass client-ip=40.107.236.74; envelope-from=saipava@xilinx.com; helo=NAM11-BN8-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:23 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.236.74 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Mask all interrupt on reset. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index e6a3d6c..68df92d 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1347,6 +1347,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_DESCONF2] = 0x2ab12800; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; + s->regs[GEM_INT_Q1_MASK] = 0x00000CE6; if (s->num_priority_queues > 1) { queues_mask = MAKE_64BIT_MASK(1, s->num_priority_queues - 1); From patchwork Sat May 2 17:53:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524007 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 770CD81 for ; Sat, 2 May 2020 18:03:15 +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 4B30620731 for ; Sat, 2 May 2020 18:03:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="CLYzrrzj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B30620731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwTq-0003Gk-Ar for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwSW-0000nI-KW for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwS3-0000Se-Uo for qemu-devel@nongnu.org; Sat, 02 May 2020 14:01:52 -0400 Received: from mail-dm6nam10on2085.outbound.protection.outlook.com ([40.107.93.85]:50834 helo=NAM10-DM6-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 1jUwS3-0000Pl-DW; Sat, 02 May 2020 14:01:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B4Dd3z/2lGNBPpCM3cq+iBuJi5+Ldpb4W2xdjJ/ju+RW4jQ0LPfz2EUXGUYSVCz3fictKjJ26jvn9vyhpbQp1IBlfvDQQSO3DoC9odxvE/hgpbcwdyMWjMgtPTjoSx+btvd8SvlgR6aY+UB7P2PWEkJVJF6jvVOQnVvplBdq5ECKgfuaKlRzkZ+a9uSKOi68osOWSyRb4DMWpHwraCkrJna6fJy35LEnyH9QpcElvD7L9Y6aXwtXF6CVtRdOKZuCUys6B/EgmDMi/C/9g5R6+MdYm4U3cqAubShlcQYeKIF1zAjacvQRxx018jBw68wtjbNYqF1FBbshJRbRx0SOlw== 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-SenderADCheck; bh=UTx9UF+InGXehI9Qo7XS0x8fwvu+YCyKIhaHtJH0hKo=; b=dUNuXd5QxdF7xPep8IcaBdDSEfkBXQ23k018LaLn02MN6P6JS7cTrp4Yxcy3QXc6WPpHl6KErldz2fbdPB7g6ju1w4cM8UG8ppS0vRb5IRIl9RKek/Vo9Oarh9QRtFdtTnOC9c1Ja2v5C/mfdTybI2VrYH+ZfXUum1+B8AH01Kj8Uw5dN5asUXkMCI8ilXC7Ng+/GBKf5Oa7HLH1FLLqxWTIoOAZTrnNd/zdgHahbd+RLsNVSlzRtbYnvUIKFYu309/Ks9fL3LOntgRpiR4XtfB8jbvgqIiC7oQJ83AyLhXhPxOQX+Poc9w12/XF4VqhXF66ADuIE2wh8DpmtuiGkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UTx9UF+InGXehI9Qo7XS0x8fwvu+YCyKIhaHtJH0hKo=; b=CLYzrrzj4aXVfmypk1QZHPIh1OQviRiDI0Yr+BtnebrnR4Kkf5WsQAyHi/iBiuE3RcCWSb5FPPmhSxvLc2n7XWYnZQ929SEl/Qiz/HY2mQp9DoYQ4Ca5ybhgAvifb4wgr/I8JnbwKhVQ0LIFaYJVgArHPlv/RbIuDlzNjfoh2VE= Received: from DM6PR08CA0005.namprd08.prod.outlook.com (2603:10b6:5:80::18) by MW2PR02MB3819.namprd02.prod.outlook.com (2603:10b6:907:3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:20 +0000 Received: from CY1NAM02FT028.eop-nam02.prod.protection.outlook.com (2603:10b6:5:80:cafe::e2) by DM6PR08CA0005.outlook.office365.com (2603:10b6:5:80::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sat, 2 May 2020 18:01:20 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT028.mail.protection.outlook.com (10.152.75.132) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:19 +0000 Received: from [149.199.38.66] (port=60296 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRw-0004ne-Bb; Sat, 02 May 2020 11:01:16 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRz-0006ws-JJ; Sat, 02 May 2020 11:01:19 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1HMO011723; Sat, 2 May 2020 11:01:17 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRw-0006vq-UA; Sat, 02 May 2020 11:01:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id DABC413C25A5; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 09/10] net: cadence_gem: TX_LAST bit should be set by guest Date: Sat, 2 May 2020 23:23:13 +0530 Message-Id: <1588441994-21447-10-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(136003)(346002)(376002)(39850400004)(396003)(46966005)(8676002)(186003)(81166007)(6266002)(26005)(8936002)(5660300002)(82310400002)(82740400003)(4744005)(356005)(2616005)(6666004)(47076004)(336012)(478600001)(42186006)(2906002)(110136005)(316002)(426003)(70206006)(70586007)(4326008)(36756003); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd4c9534-4a2a-4bbe-966e-08d7eec2d151 X-MS-TrafficTypeDiagnostic: MW2PR02MB3819: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:255; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4O+ItRYULHEhRZVF+WTz+1OuziHByT6OYjY3kzFKHAdFU+NEBRYxzz4zZUn8mvehMycpevo7MnaJC3qEVlJD2OTTVj01J1HSNFwhoyCjlJNHFNmRXC00sMBWBE2x4JPak0Hg4vSA/ST0pLRipE3kbFsZUOZi464W8QcyClGrcf5OxoYmUVhdjFdfV8fBys1ujJWJfgjGW8bdvlF0q7yn7OJHYxfkm6S+ztc18cCb+pM6pSiug1SgUcMqM1koPYTGCpWLErCyfx7flmoXDgYuoxcTEtwRDkO4nLKslut0vro8i1YNBybxivgW6cgWD1mL5boITy0ipbx5tEYCfHBKoRP+lgL3svKzmVdvSt3wIe3zNHtV4eWhD/Z/wKS7yjpIiYHTFvKIS6h5ufG+xAswCjPP8fQaJfIwslULwrfd7bjHR0imJ7L1A9fLDg3vxJhk7wTCgJ5PYRvsjwf+1+ktLK/H3b9wDAU8sNB+0jGI1E8Wf6KvH0erPcAgNRaGVQBCpMRvZ07tqVNC1+ulqZPDWA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:19.8935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd4c9534-4a2a-4bbe-966e-08d7eec2d151 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR02MB3819 Received-SPF: pass client-ip=40.107.93.85; envelope-from=saipava@xilinx.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:01:21 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.93.85 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" TX_LAST bit should not be set by hardware, its set by guest to inform the last bd of the frame. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/net/cadence_gem.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 68df92d..06128c2 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -345,11 +345,6 @@ static inline unsigned tx_desc_get_last(uint32_t *desc) return (desc[1] & DESC_1_TX_LAST) ? 1 : 0; } -static inline void tx_desc_set_last(uint32_t *desc) -{ - desc[1] |= DESC_1_TX_LAST; -} - static inline unsigned tx_desc_get_length(uint32_t *desc) { return desc[1] & DESC_1_LENGTH; @@ -1269,7 +1264,6 @@ static void gem_transmit(CadenceGEMState *s) /* read next descriptor */ if (tx_desc_get_wrap(desc)) { - tx_desc_set_last(desc); if (s->regs[GEM_DMACFG] & GEM_DMACFG_ADDR_64B) { packet_desc_addr = s->regs[GEM_TBQPH]; From patchwork Sat May 2 17:53:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11524023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 397BE13B2 for ; Sat, 2 May 2020 18:17:26 +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 0439B206F0 for ; Sat, 2 May 2020 18:17:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="eWioHTez" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0439B206F0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:41286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUwhZ-0004PU-0e for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 May 2020 14:17:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUwge-0003kS-0I for qemu-devel@nongnu.org; Sat, 02 May 2020 14:16:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUwgc-0007AZ-8y for qemu-devel@nongnu.org; Sat, 02 May 2020 14:16:27 -0400 Received: from mail-mw2nam10on2055.outbound.protection.outlook.com ([40.107.94.55]:6018 helo=NAM10-MW2-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 1jUwgb-0007AH-PR; Sat, 02 May 2020 14:16:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CSnlIOpxbTa7IDrv3EJN+IXK2NbeRc2U9XSEMLWlHuPG79y4MQDCr30Z2RO3dLsbG1OvvQG2XOAgzwNRUhuJ0uwXLa1WHfBSU4B8IZ0iccLSsQejGpCiAKrUpozIk2yMFAc4ClPnaq5PADmN4sUXvNUKmUql4qS5ujC4vBZi1pK8IN6LF6gtJomoevk3CUgjmQ6suttgaypLzM7t7Eagy04zcy6UNLxnzGbowySrgcWp0SX/emfDafCwZDFRoRJ9ycTbVk79bxFXb/sZSSwCM12x4GdgonB0vB4wqkuMn7I3IjJP9PY7sXbUy4xNXm4eYJUCx8kmoA/YjmSeQ+LX8A== 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-SenderADCheck; bh=dY+x62VhB6+USmW9Enw2l4C2Oz6Uy9FKo8uDilKpuOQ=; b=lXzcwsKMQ/zzf9GD9zmTF+4T7LU4xOELXpGHcXe0dHAt1sgjTOmNsSHsQwNbBZ57mYYuSbP8OSQ+7mzYISp82C11S19f/G/MBSvPuMtbv6nii2PzHEEtaR5oonkszkWR+x5yG+dXo26GUN1//mfppLB8iSNgF8RzfJ6DHr7xD7ZHT1rp6hJHVCZQUKnCRkHk2RPmqp7Sdq1m7AkYeQ/nxmogxjgjJk0VBtkas87Du9D1ApXqbkHGf+/V53Cer1CPozgeY3KD1wrI7G+LII//VsysAS0cj4PUKI2wblvn1FhJJteWH5hSc57KFlZdaiMLjaoE4nEtbCY355EikY1MHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=wdc.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dY+x62VhB6+USmW9Enw2l4C2Oz6Uy9FKo8uDilKpuOQ=; b=eWioHTezyTjFBpi0o9r2XY6jcv8mMbrwLtmdvT3UjvZSbMRw3c23OLxpqA34IAm2tJ8mWHFxL5YF7Ku8cwsaj5eT/Y9NAyU7uMSn2oiQ0oH8wFbMhUqbw9sX/zQbSxIuC7s2gDRLm458GUuWuff5f+LCXiZIjduWOp3TuwPf2vU= Received: from SN4PR0501CA0042.namprd05.prod.outlook.com (2603:10b6:803:41::19) by SN1PR02MB3712.namprd02.prod.outlook.com (2603:10b6:802:2d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Sat, 2 May 2020 18:01:18 +0000 Received: from SN1NAM02FT059.eop-nam02.prod.protection.outlook.com (2603:10b6:803:41:cafe::b3) by SN4PR0501CA0042.outlook.office365.com (2603:10b6:803:41::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.11 via Frontend Transport; Sat, 2 May 2020 18:01:18 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT059.mail.protection.outlook.com (10.152.72.177) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Sat, 2 May 2020 18:01:18 +0000 Received: from [149.199.38.66] (port=60277 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jUwRu-0004nX-Tb; Sat, 02 May 2020 11:01:14 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRy-0006wr-4v; Sat, 02 May 2020 11:01:18 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 042I1HE7011722; Sat, 2 May 2020 11:01:17 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jUwRw-0006vs-US; Sat, 02 May 2020 11:01:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id E242113C260D; Sat, 2 May 2020 23:23:39 +0530 (IST) From: Sai Pavan Boddu To: "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Tong Ho , Ramon Fried Subject: [PATCH 10/10] net: cadence_gem: Fix RX address filtering Date: Sat, 2 May 2020 23:23:14 +0530 Message-Id: <1588441994-21447-11-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588441994-21447-1-git-send-email-sai.pavan.boddu@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapsmtpgw01; PTR:unknown-60-83.xilinx.com; CAT:NONE; SFTY:; SFS:(396003)(39860400002)(346002)(136003)(376002)(46966005)(42186006)(316002)(70206006)(70586007)(4326008)(6266002)(6666004)(36756003)(2906002)(426003)(336012)(8676002)(8936002)(110136005)(82310400002)(186003)(26005)(2616005)(356005)(47076004)(478600001)(81166007)(82740400003)(5660300002); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a502ac9c-b72d-4a4d-3918-08d7eec2d07b X-MS-TrafficTypeDiagnostic: SN1PR02MB3712: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:236; X-Forefront-PRVS: 039178EF4A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +gSFQ+VQ4UOFRhdsuluAv9ZvHrhhmbT9rQYvkHI7/8DOA9Bd0emlhcaXL0otaaLABg8k/QzOngUyJh5G5dtCZ/XWtUshKgaUiqE1MB9hs8R0W3CXG8orTeZmREAeQK/ZZIn+q13eJHMItNZcjUyYyU2yy9aQEbA3wN1okFPd5fqrgX3BcHO8Pw+p2TUHfqjeEVpkxJtqb8VMK0Qqd8B5n6BmQefROeyHh3HHtsuJkdW4exTZw0+8j26Gwywlp8R/0CdX9k5KV76XhwVutNmEOk2sNYtiJ90En0bndreuaRbt1C4t2lscz2nEL2tmjqbnmSJDlaqEdMj0hyGnRoJ8MzucPNfAbQ2zTnp5DKJopcowNAtzeTzTtIvpWCIyFzFgSXQ/4IyHqY6GyJGhvyARiizK6a82F6JWQ1+eukcqjGEneME0W3JWasit6U7d6xviJCFlCTV4c5GaBkxu+5G+sKAs6iJy1uZbygr6TV9W510xfHDWDb9h1QE4C1cXHpLeH+kgaHVjkmlyim6jc3lASw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2020 18:01:18.4877 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a502ac9c-b72d-4a4d-3918-08d7eec2d07b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB3712 Received-SPF: pass client-ip=40.107.94.55; envelope-from=saipava@xilinx.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 14:16:23 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.94.55 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: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Tong Ho Two defects are fixed: 1/ Detection of multicast frames 2/ Treating drop of mis-addressed frames as non-error Signed-off-by: Tong Ho Signed-off-by: Edgar E. Iglesias Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 06128c2..10a7cb2 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -34,6 +34,7 @@ #include "qemu/module.h" #include "sysemu/dma.h" #include "net/checksum.h" +#include "net/eth.h" #define CADENCE_GEM_ERR_DEBUG 0 #define DB_PRINT(...) do {\ @@ -669,7 +670,7 @@ static unsigned calc_mac_hash(const uint8_t *mac) static int gem_mac_address_filter(CadenceGEMState *s, const uint8_t *packet) { uint8_t *gem_spaddr; - int i; + int i, is_mc; /* Promiscuous mode? */ if (s->regs[GEM_NWCFG] & GEM_NWCFG_PROMISC) { @@ -685,22 +686,17 @@ static int gem_mac_address_filter(CadenceGEMState *s, const uint8_t *packet) } /* Accept packets -w- hash match? */ - if ((packet[0] == 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) || - (packet[0] != 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH))) { + is_mc = is_multicast_ether_addr(packet); + if ((is_mc && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) || + (!is_mc && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH))) { + uint64_t buckets; unsigned hash_index; hash_index = calc_mac_hash(packet); - if (hash_index < 32) { - if (s->regs[GEM_HASHLO] & (1<regs[GEM_HASHHI] & (1<regs[GEM_HASHHI] << 32) | s->regs[GEM_HASHLO]; + if ((buckets >> hash_index) & 1) { + return is_mc ? GEM_RX_MULTICAST_HASH_ACCEPT + : GEM_RX_UNICAST_HASH_ACCEPT; } } @@ -924,7 +920,7 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) /* Is this destination MAC address "for us" ? */ maf = gem_mac_address_filter(s, buf); if (maf == GEM_RX_REJECT) { - return -1; + return size; /* no, drop siliently b/c it's not an error */ } /* Discard packets with receive length error enabled ? */