From patchwork Tue May 12 13:09:56 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: 11543157 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 01FDB139F for ; Tue, 12 May 2020 13:20:05 +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 CC102206DD for ; Tue, 12 May 2020 13:20:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ek5Pv6QA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC102206DD 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]:49520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUpH-0000qg-Tc for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:20:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUns-0007TC-4m; Tue, 12 May 2020 09:18:36 -0400 Received: from mail-mw2nam10on2066.outbound.protection.outlook.com ([40.107.94.66]:6112 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 1jYUnq-0001zE-0l; Tue, 12 May 2020 09:18:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A9eOpZ82suR6PSFXe+pxl4JGXgk4uz1h7O5lJ491qTgs7gmge8bUb7ahDsW2BC1ZaC2U20qGbvJgiGqiEVSuGjouWCUxUDYQmgWpYnPO8J/3h9PFlZ7g+OysSd7MLEk6l7H1Rpo8omrNZOlwxPJNiEEXgHNLUThpJZRvCi5cFft5Fh+D5Uoeqzb3MSpPxTMzJSDSSnvyRscTHlGU6T2Ilp5gmEVp40lSFIw4D+THc/3fgrSt26eyOFixW4l+4Hwo+b8dXTk2L3jc1gdl11jrghEWbXv6mOaKqP3a8xS0rxlaA/m7LFj8f9A0rRKJ9hZB3LlFxtIkWK117OfbpY3/Iw== 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=kHbwx8DDwAgkmuW5mQVte3k0zRqUyTVvLZAW8sLRfG0=; b=NLNn4+A9C+f5upke0CAwTHlbemAqyrlchVMip5IEPPXtPR29Ye1C+NrUB5UY7eT45yPtOtHOKcxNL0DRp8G1QbnZXBHOkeGkLyMWLjM3rzoz7lv7m62xN2QaviOcx8EO9dEt2qnbnAypxKFm/8TQpsoi4oGk2SpwWzuy6e05uivdJWCq16bVM9raRfLFQMMXfteu2l0Mszrfh8yInkkmo4rfBYCQuI7rgdxc1Iq3WzkmZ5ZbdGD+yPh6LUF7yWwSxFH8RyH+j186eRdOIHBk7iGFZSh0pfu6tbJUTr5OYEcYz8jJQtcY/zgDITWyvgOmdZapLQH8PkSUvp0nKjd+LQ== 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=kHbwx8DDwAgkmuW5mQVte3k0zRqUyTVvLZAW8sLRfG0=; b=ek5Pv6QAOMqQ5lAUPOub954jQxlTWePmJnY4wMJrLYIhdgB4zXZoHc7AXvc++QeZqgjw+3twjjvIT765dY/mi94MnSLQziu0nxTe9myt8KNhupMczfdZAFhXqz6GXH4BbzzVJHuE4mBJL12HQtF1UlIjk7eB8tkDi4vRX28r75k= Received: from SN6PR01CA0028.prod.exchangelabs.com (2603:10b6:805:b6::41) by DM6PR02MB4908.namprd02.prod.outlook.com (2603:10b6:5:13::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.35; Tue, 12 May 2020 13:18:29 +0000 Received: from SN1NAM02FT037.eop-nam02.prod.protection.outlook.com (2603:10b6:805:b6:cafe::d2) by SN6PR01CA0028.outlook.office365.com (2603:10b6:805:b6::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:29 +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 SN1NAM02FT037.mail.protection.outlook.com (10.152.72.89) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:29 +0000 Received: from [149.199.38.66] (port=47612 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnU-0002QG-NJ; Tue, 12 May 2020 06:18:12 -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 1jYUnk-0005Yf-Uu; Tue, 12 May 2020 06:18:29 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 04CDISZb028644; Tue, 12 May 2020 06:18:28 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnj-0005YS-PT; Tue, 12 May 2020 06:18:27 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 698EA13C0170; Tue, 12 May 2020 18:40:24 +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 v4 01/12] net: cadence_gem: Fix debug statements Date: Tue, 12 May 2020 18:39:56 +0530 Message-Id: <1589289007-23629-2-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(376002)(396003)(46966005)(33430700001)(82740400003)(2616005)(186003)(4326008)(33440700001)(70206006)(70586007)(5660300002)(8676002)(2906002)(316002)(81166007)(42186006)(6266002)(426003)(82310400002)(8936002)(26005)(6666004)(47076004)(336012)(36756003)(478600001)(110136005)(356005); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ccc5434-d55e-4862-c0f9-08d7f676f640 X-MS-TrafficTypeDiagnostic: DM6PR02MB4908: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:127; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5uKY9oweROvC2AZDr0vdF/q3Up0SpJnOZu/prKtHyawrg832c/kOQ9XzEU3LmJYhZUxBaRLs1rRa0n8x1vlaaJOAT2plaOdPn6b9Ms0t8LRrd18g9Bo9gBZlPWR5raCUc+XafJXclJjQz3CXSGPEidt0fdK82at/vAOWkX2caPfTJS0dBxsYGjwwy4qbMYjo2dk7Q/ulWrZz5V4aUu6lBRazji1DXgQRP7R3e840goi2+l+9GqK5OxyOAWD0mFhbW+uRyaDxeBap/+e2RQDiB6aIN6Ej1FgEuYxbA4+cELdol+b+4+W8fAqQueldnxISv5XzZTt7SbFI6kWI1PRnN2+TwF8bua2pxQxtjZZoL2cF6iMRL6KTFOn3btWNNibOKDs/3PQoSoq3iOSM38gvRC0F9i/zyyM7KM7MJFus0FlAt98VPGUhIvdEBgZaNSSJ6nBJCOEs/zfBYwwed2LT8LU3Da0daODfjNRsvzQ1WicAzRyyOSUORs1n8C0bmXA8wjYdzGd5Dh0mgqmadpqImixlyHs0k2W0JxmgZ5f1RJBP/ZaVAvqQur1aLjqJjwjttxRQt1aHj3h6yyCqlE5hEQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:29.4087 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ccc5434-d55e-4862-c0f9-08d7f676f640 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: DM6PR02MB4908 Received-SPF: pass client-ip=40.107.94.66; 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/12 09:18:31 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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. Fix few statements to use sized integer casting. Signed-off-by: Sai Pavan Boddu Reviewed-by: Edgar E. Iglesias --- hw/net/cadence_gem.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 22a0b1b..5476c62 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 */ @@ -979,7 +978,7 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) size += 4; } - DB_PRINT("config bufsize: %d packet size: %ld\n", rxbufsize, size); + DB_PRINT("config bufsize: %u packet size: %zd\n", rxbufsize, size); /* Find which queue we are targeting */ q = get_queue_from_screen(s, rxbuf_ptr, rxbufsize); @@ -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])); /* 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 Tue May 12 13:09:57 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: 11543159 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 D515E139F for ; Tue, 12 May 2020 13:20:37 +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 AA54D206DD for ; Tue, 12 May 2020 13:20:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="p86SCndl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA54D206DD 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]:50786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUpo-0001P1-Q4 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:20:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnx-0007bA-D6; Tue, 12 May 2020 09:18:41 -0400 Received: from mail-eopbgr690079.outbound.protection.outlook.com ([40.107.69.79]:37710 helo=NAM04-CO1-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 1jYUnq-0001zI-4u; Tue, 12 May 2020 09:18:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bDEBD1Ukneo2HNwXfE+JIrqBBtIawxIaxwiwOkh5l8GWEbRZpwa25ndvKp6hEehoHvfaWB6ogOcm1or995foNVFuBxCX4Gfct/o8eBiCtSbIFIgMeLBw0/LBHOgsIT14oIob60O7/WYcY5P5OeVN4BvNAXwEvsQQn+QFsWJ54y07/2PRS9ELBGhJBQJ3ntqMvcFQu5v6/SpBD21hSBbAyu3I+IPLJEBXiIK5jElf0adHuO2MFpYDzH2fyea7HF3Fe1WR+VMJ+ZSiBkad6dPRckjbVtoxIUDqbKleZTDQcOoo2hXrDgiEy92EzY/pRj+e3qbr7MI3XrIqnHqVqtKbew== 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=2Qcy7AiWaJQ7exUrLABRFOuplr1PsD3dmHV85EhUpWo=; b=NtxtmDP1XxGW4Fik1uZ43SnCcCylqTIgRjdJQLlH4OQ0bmRAjaq9aL9UV2WxOLd9hQ/qcbEpKfY9UBPFeIHczzTOrcLiQ3Iz4L4p9jI8YYATZVICccL8ll7wV0OEIndhLBF/hgtD3PkaAuPgSwSkgIjMbywflFuvHSjH2eibYUFkCVtX3Olh8C9jt6QZ8pUB2SfSktTmNmRgaCpcwWH0b07OUFlQ/PFnaCcVbexKyMdZLCB47hoJ8V3WTbxsj+mq0NT5nUOKeSQ8moHC2tdkGD7yHtqZrsqZZxW5eQfcypDvYjecydl6htTxMYxoO+chLfVUVowIQxFyHqT7Oc0JzQ== 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=2Qcy7AiWaJQ7exUrLABRFOuplr1PsD3dmHV85EhUpWo=; b=p86SCndl9II+/qo/jyBjnYRPsoKDzSg9NygQTGvFf5rQHcViPOr+sZlfBl3V1qgFvYyk0GcmpmtKwnCjIyVrKei6vspNcNZ05O4bmzhjDFudOpdzWbE8hcAN8sKSMw/a9P+jrTyag3R0MV9ohENKn3ZBjLD1D/xn6WP4puEOLxM= Received: from CY4PR06CA0039.namprd06.prod.outlook.com (2603:10b6:903:77::25) by DM6PR02MB6092.namprd02.prod.outlook.com (2603:10b6:5:1fb::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Tue, 12 May 2020 13:18:30 +0000 Received: from CY1NAM02FT028.eop-nam02.prod.protection.outlook.com (2603:10b6:903:77:cafe::8d) by CY4PR06CA0039.outlook.office365.com (2603:10b6:903:77::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Tue, 12 May 2020 13:18:30 +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.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:30 +0000 Received: from [149.199.38.66] (port=47624 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnV-0002QK-G2; Tue, 12 May 2020 06:18: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 1jYUnl-0005Yo-NO; Tue, 12 May 2020 06:18:29 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 04CDIStW016834; Tue, 12 May 2020 06:18:28 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnk-0005Yb-GS; Tue, 12 May 2020 06:18:28 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 24FFB13C0168; Tue, 12 May 2020 18:40:25 +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 v4 02/12] net: cadence_gem: Fix the queue address update during wrap around Date: Tue, 12 May 2020 18:39:57 +0530 Message-Id: <1589289007-23629-3-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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:(39860400002)(346002)(396003)(136003)(376002)(46966005)(33430700001)(33440700001)(2906002)(6266002)(6666004)(426003)(47076004)(42186006)(110136005)(82740400003)(70206006)(70586007)(316002)(478600001)(336012)(2616005)(4326008)(5660300002)(8936002)(8676002)(186003)(356005)(82310400002)(36756003)(81166007)(26005); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f40e06ff-5eee-4451-2502-08d7f676f69d X-MS-TrafficTypeDiagnostic: DM6PR02MB6092: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:483; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b6+b1TDYFAk+7Nqa/W7fjU5CKKOR5Yh6AqevhoEpPrdKnF/uzpazMrn8s/T29/D2NSRqCDKbUIyEuNMdpQZ49ZosRE+UnoVrmbs9p9DJthE+pivGMVkaLnTOUzLH4K6qB3XWlMJewF7ZTuXDQCblIXjMrh0JIaKzpQ81qgNGSV6N0WJJhSnT3PSxE1yW0J7xdkqTG6hT37vqUJSw9KXCVCKn6PcGV390qtAb8+Um++0A5myQ+XPOHlJzG8xymREeDsWgzO/RQCvqyNleOwOGmUgbpE3eWX3LHVRaRFtGqKo2csNxhD5SM7iXBLQ+kvaVH4cQwhT/fYZucUPPGRfByUNIn5xAIHLX1WjIJ7qV6zfus1iJzwqraXuOsTU98PSKxx6umxQX/1ENUcvs0AZdcvFiyD99ogQHbo4SXa0U23yVs4iHtzUS1hKDdUPBMuoyx+XZ19ufFyveGnOYDz5HELv4GvfcJZ7pTuNuc5+yYf8e0YN0iRTZJFmVITj2nBKXYwkGmDUuyISxD9Ms4Dr1MfJhJjBItfu4lusxpzdEM0c/kaX4OmNWZIV7eAxcldTPKhevctOOBtRARJmsK+nqvQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:30.0132 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f40e06ff-5eee-4451-2502-08d7f676f69d 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: DM6PR02MB6092 Received-SPF: pass client-ip=40.107.69.79; envelope-from=saipava@xilinx.com; helo=NAM04-CO1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 09:18:32 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-by: Edgar E. Iglesias --- hw/net/cadence_gem.c | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 5476c62..c3536ce 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -845,6 +845,35 @@ 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 inline uint32_t gem_get_tx_queue_base_addr(CadenceGEMState *s, int q) +{ + return gem_get_queue_base_addr(s, true, q); +} + +static inline uint32_t gem_get_rx_queue_base_addr(CadenceGEMState *s, int q) +{ + return gem_get_queue_base_addr(s, false, q); +} + static hwaddr gem_get_desc_addr(CadenceGEMState *s, bool tx, int q) { hwaddr desc_addr = 0; @@ -1043,7 +1072,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_rx_queue_base_addr(s, q); } else { DB_PRINT("incrementing RX descriptor list\n"); s->rx_desc_addr[q] += 4 * gem_get_desc_len(s, true); @@ -1199,7 +1228,7 @@ 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_tx_queue_base_addr(s, q); } else { s->tx_desc_addr[q] = packet_desc_addr + 4 * gem_get_desc_len(s, false); @@ -1251,7 +1280,7 @@ static void gem_transmit(CadenceGEMState *s) } else { packet_desc_addr = 0; } - packet_desc_addr |= s->regs[GEM_TXQBASE]; + packet_desc_addr |= gem_get_tx_queue_base_addr(s, q); } else { packet_desc_addr += 4 * gem_get_desc_len(s, false); } @@ -1457,7 +1486,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_tx_queue_base_addr(s, i); } } if (gem_can_receive(qemu_get_queue(s->nic))) { From patchwork Tue May 12 13:09:58 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: 11543171 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 B4419139F for ; Tue, 12 May 2020 13:24: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 8A3C1206DD for ; Tue, 12 May 2020 13:24: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="MVjkUl5a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A3C1206DD 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]:36648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUtk-0007pG-Np for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:24:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnu-0007Uh-9i; Tue, 12 May 2020 09:18:38 -0400 Received: from mail-dm6nam12on2065.outbound.protection.outlook.com ([40.107.243.65]:30640 helo=NAM12-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 1jYUnr-0001zb-7k; Tue, 12 May 2020 09:18:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EX2kuwBOhX/iS611bZO+vudi6WFa+zXiSOjf+uJkt/aU4d9GytLFXmew55IvT0RyuB5FTQ/8fDCdSn34JkAnGv9AbuMfGzdW2x+5ZNCj7L3PxC0XFZRyZCF5TJmM2iDFTk4VrJQQJN5mvnxK5KZdUyXWNl2V2i9qa/TJGN2Efhjp8XnSnONFBTYSyddJa9ohE4JZ5/hfefKue+LKVCYRn6WwSVUN4Se3fsHZ69SrEC/ZSbRffM90vUzcvQXF5KIFgdYAYQUEOq8yUIZ/daXZtu2m1a0hXv+9JfHZXFrbSoFMv5RqwVsQ/YYxUijKtiIxIlnOb02BGawgdbAwdbJKIA== 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=wDF6FAGY0G2E/tpqHe8I5TM+3q+ViAKHgK29iNyi8I0=; b=e3kL1Zsi33IHKzhKfNw7mO7nsoz1rWuktRv3Jvgre66Wdcb6z+rgu4D6dxk11cvjqg2aVsxg8b5+CVpWxywdyK5Vw5fzJPSFjaTHrcEeePWD8NiHcoZS4MfGZmAqzzh+R08Do7QgDfUw2d8t9ZuSAWJkdB2TrnBkKpFFijEYqktAQsejxqfG9eY3IMHAheCKDgVkgKj7ypLw98yN9oE5eThWBGzCgUEPYGxG0rGgLNpRzjpSg8Au4MPPvNY9BGx/FTpMhSoSYx/026hnbfT/0berdoa3FmWzjG04YRtbXP+jff19ckSdo3dVKa9P4NgyBt7KwbazHnqW7jgaqSzU+w== 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=wDF6FAGY0G2E/tpqHe8I5TM+3q+ViAKHgK29iNyi8I0=; b=MVjkUl5arpKVPvc9+P1HNilEdxwqd1XmmTUyj6loNAozINX/OrvL747zJCKW5gykpDwuK1oYFqkab7mpWnH0rgJY/3TtWs7Wl4cH3rHkEQjjm0DuOolYdZJIUm7vlwsdZkaYtKT3l2hqh1zeTmyENPlLL3Ox8xyAcnimdMHXh2Y= Received: from SN2PR01CA0073.prod.exchangelabs.com (2603:10b6:800::41) by BYAPR02MB5911.namprd02.prod.outlook.com (2603:10b6:a03:124::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 13:18:31 +0000 Received: from SN1NAM02FT017.eop-nam02.prod.protection.outlook.com (2603:10b6:800:0:cafe::4d) by SN2PR01CA0073.outlook.office365.com (2603:10b6:800::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:31 +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 SN1NAM02FT017.mail.protection.outlook.com (10.152.72.115) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:30 +0000 Received: from [149.199.38.66] (port=47643 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnW-0002QN-8D; Tue, 12 May 2020 06:18: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 1jYUnm-0005Yx-FV; Tue, 12 May 2020 06:18:30 -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 04CDIT74016836; Tue, 12 May 2020 06:18:29 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnl-0005Yh-4Y; Tue, 12 May 2020 06:18:29 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id BFBB513C0170; Tue, 12 May 2020 18:40:25 +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 v4 03/12] net: cadence_gem: Fix irq update w.r.t queue Date: Tue, 12 May 2020 18:39:58 +0530 Message-Id: <1589289007-23629-4-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(136003)(346002)(376002)(46966005)(33430700001)(316002)(70206006)(5660300002)(8676002)(8936002)(33440700001)(36756003)(70586007)(81166007)(82740400003)(426003)(4326008)(47076004)(336012)(186003)(42186006)(110136005)(82310400002)(6666004)(26005)(2906002)(478600001)(2616005)(6266002)(356005)(309714004); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f912b1e3-b4ab-4150-94b4-08d7f676f720 X-MS-TrafficTypeDiagnostic: BYAPR02MB5911: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:514; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nn5oD7tsZ5pSC74I6C9LUI5i3/z2hBmKS7SsfZf2PLiNJMPwVpSnSpHQYPv/X/k8Ni5iDI4ohOGTyfDIVqSkcT7M3HnnJT4bBn0ry9UP2n+16rupO+acAQ4IkvE0krMuE7mfdzLoBrfyX88y0hFAeUJDNXCiEVmEEIj2TRmZYlz4ZhQZnAikb0BgnNeJUfKufxmK5+u4MLks+tww2I4DdG9gJNZv0Pcby10czZ/uiTOJSkEhntlCoke3Nc7hHC0BWNKeVRnLFVQ944QZ8a7AufLYnkXXlDHeGMk1kFvE0p66uHi1rshrkO2ILS2+Ndf3+sGd5pXp8UhGEfLQidlTybV9CMxoGIxN8fotEfXdwxKKOGccazDDpZe4962QklHE2AhddA0ue9l863zf+rpvfYUxafr4+VKAFZLULg2T8CYPncPgH+gpkcb9wXxTo98N9v+iFeaQ8zmS4PR0lFkNLsnuhWPVJx7WaNz4F0Xd1ATTv9xxMpc8SkGXT/iok9/x9iwYIbA8Z0f6AeaLDp3Ir56tNG1G5Ae2fD05FoSbJAEBJxinjqYvzNwdxpOpPzRb1qMcQua8PNc+5Chvz93OhTyr6V3KA1u2mIqfqbbpTjM= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:30.8755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f912b1e3-b4ab-4150-94b4-08d7f676f720 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: BYAPR02MB5911 Received-SPF: pass client-ip=40.107.243.65; envelope-from=saipava@xilinx.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 09:18:33 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-by: Edgar E. Iglesias --- 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 c3536ce..76c11a1 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 Tue May 12 13:09:59 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: 11543163 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 CAD321668 for ; Tue, 12 May 2020 13:22:53 +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 A0AF8206DD for ; Tue, 12 May 2020 13:22:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="rdZzjEvs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0AF8206DD 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]:57582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUs0-0004rr-NQ for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:22:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUns-0007TF-Bb; Tue, 12 May 2020 09:18:36 -0400 Received: from mail-eopbgr770050.outbound.protection.outlook.com ([40.107.77.50]:7574 helo=NAM02-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 1jYUnq-0001zL-5o; Tue, 12 May 2020 09:18:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EGrrTxr8bPEUTTJemwonCSbowKLmk6KhIRpsMfW6Y3vf3XG+r4Pq68dAmOT2Ngp/pQv/FvASdF0EMUBwgNfQEcgLj1r1r/IU1MUE43tyZ5OALPv3YfxJsNT9L/HMELAKoSIq2vBUewxoIhW1UjruiZYksl9qWnpttscw2ULb2T3rKD98E3qbrgb5/50ugL9QKp0YuKSkBSKmYUMAhUC65QVyH49o/nSOBzBuhkYyzeqmCAavI+jMAA3DNAVUxTRkr+uGXGKGZ3YB4dJP0OOwXOGZt9uER9Ufh/CEv6Y3nMHOMtdX86f1riaqKC7m4hx7m6HPk9KPAXafCrOckVg9lQ== 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=CU0O8Ak969WK02hryUKYGxuUpZqp0gUowhHwVt4h8w0=; b=A+OSr9++zIxLpY4LZ3FGcXIDKRdLGM3lOh25yrRz5nKVQ5h5CH9yh3avRXS8Z2HlVjSppMbLUjJ32Vq4MX02q/5fyIivonfLprskmJ6gVHLRvEVJ75J29Fz76fKXzwfoumy5iOyeHtlrJUjoUsdO3zgS/BSBgVM4favGGJ+7kI1PuJHsKmQivo4ZwhwCfWxudMz/NnNLNf8AxZy0MvQBpd5Bul36dYaRZMnex9KfjCMYFYFKe3jXAlfg9pC0+QCON4ZNUTZG/1WMp5o71hXJodz9TfivxCzCbz2hYEgXvoYLy5dJbHOniwsbikbpxy2g4C4Bv4BisUDKJxPti5zBwA== 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=CU0O8Ak969WK02hryUKYGxuUpZqp0gUowhHwVt4h8w0=; b=rdZzjEvsucoS0gR7JGWNr0kSUNXk7XAm/6FhogkzBrf5M5zjeFXwvHl8UHYiW7d60d0XuY3p2RlISv4jP+JzHDOPYlFIDAknoRFO85sC99atw9rPrUr2adItHkK4qsHAK/RmoEwmcafFJqcAzhUJikn/hP8qcwqI+m4BZKqR4Pk= Received: from SN6PR2101CA0027.namprd21.prod.outlook.com (2603:10b6:805:106::37) by DM6PR02MB5132.namprd02.prod.outlook.com (2603:10b6:5:51::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 13:18:31 +0000 Received: from SN1NAM02FT043.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106::4) by SN6PR2101CA0027.outlook.office365.com (2603:10b6:805:106::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Tue, 12 May 2020 13:18:31 +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 SN1NAM02FT043.mail.protection.outlook.com (10.152.72.184) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:30 +0000 Received: from [149.199.38.66] (port=47647 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnW-0002QQ-AA; Tue, 12 May 2020 06:18: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 1jYUnm-0005Z1-Hu; Tue, 12 May 2020 06:18:30 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 04CDITY0016840; Tue, 12 May 2020 06:18:29 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnl-0005Yb-D2; Tue, 12 May 2020 06:18:29 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 6FB7F13C0168; Tue, 12 May 2020 18:40:26 +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 v4 04/12] net: cadence_gem: Define access permission for interrupt registers Date: Tue, 12 May 2020 18:39:59 +0530 Message-Id: <1589289007-23629-5-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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:(39860400002)(136003)(396003)(376002)(346002)(46966005)(33430700001)(33440700001)(110136005)(42186006)(6666004)(8676002)(2616005)(186003)(26005)(426003)(5660300002)(4326008)(6266002)(8936002)(70206006)(70586007)(478600001)(82310400002)(336012)(36756003)(2906002)(47076004)(356005)(82740400003)(316002)(81166007); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac85cb10-2a88-45ec-21a2-08d7f676f71f X-MS-TrafficTypeDiagnostic: DM6PR02MB5132: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:153; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AtMNGDqgobJBQWfELgfUGG0nQuVfDrTj2KYXIde8xeANIOylUophK5FoYWCyh1aIZ0RDGx6zP96K3+Vy6D5EXVK4FGNTZrRWs7VcNKTgZ4UcHwanqPN9uOaPfHlaU9aXj/Q/r+exWJoUG9dSgvy0/M8ekAM8NDg39DJxT/WORBiUhDwpWKoV4EPi0ZiWgz/9nY75Kce1BBCM0z3qMkbJnvEbzC4jvR93uDSE5Fn/FR0Cx35dLBr+NtUa27graSherR7MsFzdO2+sA6wdCKxW1flrHeMspqOFOejV78fx1TSEQ3sFBx3dQBgP943tMjHkgirLWFVNW5VPwjBRxx6N0UbF2IHPMSfbMkhshy4np/OB77PuV0cPFVj3kHW/MXWKqpcgBamz+y1NBLQmU7Cgp4qNySBAMvZ1VCcpdKLnJfQrnuyz+GS+l1aVzH6w9LF94yg/rVdkjD+4hQio9EeuMPS4/xOpho/PGK+v/G85htdgb6EaFlIgMVXh+GakIRqSMnw6JiVzuDl7D41h+2V5AsF793Wi91LFAcPmGE0wB6qdeCyNTLVWTbvYIBrw7oE6S0dVQfIvlXLbLRHWImL3sw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:30.8660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac85cb10-2a88-45ec-21a2-08d7f676f71f 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: DM6PR02MB5132 Received-SPF: pass client-ip=40.107.77.50; envelope-from=saipava@xilinx.com; helo=NAM02-SN1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 09:18:32 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-by: Edgar E. Iglesias --- 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 76c11a1..40bfa5b 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] = 0xFFFFF319; + s->regs_ro[GEM_INT_Q1_DISABLE + i] = 0xFFFFF319; + 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 Tue May 12 13:10:00 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: 11543165 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 9B425139F for ; Tue, 12 May 2020 13:23:11 +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 71737206DD for ; Tue, 12 May 2020 13:23:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="gJqmh8zI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71737206DD 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]:58942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUsI-0005QF-KI for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:23:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnt-0007TX-2W; Tue, 12 May 2020 09:18:37 -0400 Received: from mail-eopbgr760052.outbound.protection.outlook.com ([40.107.76.52]:49603 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 1jYUnr-0001zP-Ht; Tue, 12 May 2020 09:18:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aaj7qqvTK9u4piXC7q6SLmosLDlmp6cH8Tg43QRZ2nXMNrhGp0JqXl0z0vg6A18Ri51LWNbVaW/kDGMeXEYIPdUWAJOLP1mFIP4VNyosgmaz3F/hzH16vPu+sXtODhJAQcXmlNBGecHf2/9dHKbmDns6028IoXWVVroxNjwmGlq1xrD8EuWdpbdPZUJG7QSmantOWhj4RbWPtGanL2LMQ90E0cpE6M/g04A14ZfBMatFSedwkPisGCyucKmi+yuEG3GgejIQ+0Xq6wz+sKQIYe0MGrycwUwtp+3T8X9zU+o65zcadFRESTNBT609zXTEUUQrG901m35r1BAZZ+93qg== 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=3gmBS/gl8DIe0Nae4lgoBJbrAZ6fMSyNH5h3lK7sZ90=; b=RygAKkrtyuf6anrvBrIPveAOHEpPFDQmUyn0GDy0yc26x72HttvQ0t8j3SiutTykf2VX7iSYj8mjXPz6oPMqOR+VgiOeFgbtNrNxVqzBg23QJ3YJD8t00ll9EELXtaZlTBmrRJ3bQjWnUcs1aC6nSPbx6SfxWc0/+1Qigubp/LB02TxQq/sAabyZTDbm4j6kVkj8ecHI5+aQKQz51gO0VCAVZOsj+GfZoK/xQpD2E/prnM4+R/Kiyb83ZKelXDPtaLP86wVsLrpiKogg4WoH4jmEfIwBZpUat+bHFkXrER85yZHtzspbNI4QLCqnuo3h8O865AONwH5gSG5BAih+yw== 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=3gmBS/gl8DIe0Nae4lgoBJbrAZ6fMSyNH5h3lK7sZ90=; b=gJqmh8zIZbzto7BlJxJzUcW4fNqKWUbGr79vYFMJkMPLMPzBn6JWOr6scssyvG/x7nkx7fHwUEdCWhC5OmcBg7BbzCvwaKUnVYJTgLozI8CjpPcxE0TdagfuJfVJHhRustZDZ94NjaIxErP3aBT1wm+iKHXgiU+p+Ek6jdrWHps= Received: from CY4PR21CA0039.namprd21.prod.outlook.com (2603:10b6:903:12b::25) by DM6PR02MB4026.namprd02.prod.outlook.com (2603:10b6:5:99::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 13:18:32 +0000 Received: from CY1NAM02FT047.eop-nam02.prod.protection.outlook.com (2603:10b6:903:12b:cafe::9a) by CY4PR21CA0039.outlook.office365.com (2603:10b6:903:12b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Tue, 12 May 2020 13:18:32 +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 CY1NAM02FT047.mail.protection.outlook.com (10.152.74.177) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:31 +0000 Received: from [149.199.38.66] (port=47661 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnX-0002QU-0K; Tue, 12 May 2020 06:18:15 -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 1jYUnn-0005ZB-7r; Tue, 12 May 2020 06:18:31 -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 04CDIUdo016844; Tue, 12 May 2020 06:18:30 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnm-0005Yh-0u; Tue, 12 May 2020 06:18:30 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 1379313C0170; Tue, 12 May 2020 18:40:27 +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 v4 05/12] net: cadence_gem: Set ISR according to queue in use Date: Tue, 12 May 2020 18:40:00 +0530 Message-Id: <1589289007-23629-6-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(396003)(376002)(46966005)(33430700001)(2616005)(33440700001)(6666004)(336012)(8676002)(70206006)(70586007)(81166007)(5660300002)(36756003)(8936002)(82310400002)(26005)(47076004)(2906002)(42186006)(82740400003)(4326008)(110136005)(478600001)(186003)(6266002)(316002)(426003)(356005); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89418467-c9db-4402-84ac-08d7f676f784 X-MS-TrafficTypeDiagnostic: DM6PR02MB4026: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:260; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yyEPC1a8W8FihLi4Wt42xxnuD/xOjtVTzAjJipUGcwNBtRSrMHLSchF0AuT9VUBm5O1s33IEEc1hQILVVs7c8lIToYR9jErt0gBN/bXkFTrl1r3IpgE5cLsDy81D2MIxq/i3A6mPRYk4VKP7/lOR3jN1wg+cAjxdr73YcY2PKxjhdAK/ln50D4tr+EiY8WTHgz5u3MFm8iUBL+l2AycbjlQMVzaoEPcEo3TYGEALcYVkllmgoBzV42ecHl6lYqhtiVjR/1qNxNIoyuzjrGfGvTMBH6xzdIi3xoq2dUTkoJ+Sov2rE8JMj4dOY/pCg0EEoOMhnD9EIaLLIM9VTQ+29meD70gc/w/L2+JOkxwV6JbrYHqMPA8969gHFpfu1XT/45zz0l3LEimWP3u6Kb0PULV2E8SLzmr9wMlBylmsvFdSKxr2Bhl1hVYyJIXKxp9ptUI5q3wc5ssIY2gsliuPbXgRTxRixrak/Nh9NMH3rMn9sX8zKNciGi7sYh/ICy/nz0dys0PmPBAD43fFVpvUphzpOIR0rfD0Shl6RS0SBEL4twVvcTIW5KjypEUUae36KVKtFU9ZNrHNK7vVHNaL6w== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:31.5295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89418467-c9db-4402-84ac-08d7f676f784 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: DM6PR02MB4026 Received-SPF: pass client-ip=40.107.76.52; 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/12 09:18:33 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-by: Edgar E. Iglesias --- hw/net/cadence_gem.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 40bfa5b..d3f7166 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -451,6 +451,16 @@ static inline void rx_desc_set_sar(uint32_t *desc, int sar_idx) /* The broadcast MAC address: 0xFFFFFFFFFFFF */ static const uint8_t broadcast_addr[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; +static void gem_set_isr(CadenceGEMState *s, int q, uint32_t flag) +{ + if (q == 0) { + s->regs[GEM_ISR] |= flag & ~(s->regs[GEM_IMR]); + } else { + s->regs[GEM_INT_Q1_STATUS + q - 1] |= flag & + ~(s->regs[GEM_INT_Q1_MASK + q - 1]); + } +} + /* * gem_init_register_masks: * One time initialization. @@ -906,7 +916,7 @@ 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]); + gem_set_isr(s, q, GEM_INT_RXUSED); /* Handle interrupt consequences */ gem_update_int_status(s); } @@ -1080,7 +1090,7 @@ 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]); + gem_set_isr(s, q, GEM_INT_RXCMPL); /* Handle interrupt consequences */ gem_update_int_status(s); @@ -1231,13 +1241,7 @@ 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]); - - /* 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]); - } + gem_set_isr(s, q, GEM_INT_TXCMPL); /* Handle interrupt consequences */ gem_update_int_status(s); @@ -1287,7 +1291,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) { + gem_set_isr(s, 0, GEM_INT_TXUSED); + } gem_update_int_status(s); } } From patchwork Tue May 12 13:10:01 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: 11543173 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 4FD5D1668 for ; Tue, 12 May 2020 13:24: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 167B6206DD for ; Tue, 12 May 2020 13:24:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Aw8Ju/O1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 167B6206DD 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]:37220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUu2-00084i-5Y for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:24:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnt-0007U7-PW; Tue, 12 May 2020 09:18:37 -0400 Received: from mail-eopbgr770057.outbound.protection.outlook.com ([40.107.77.57]:51590 helo=NAM02-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 1jYUns-0001zl-B6; Tue, 12 May 2020 09:18:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hd2qQ5WENmFx54q79LGQuE/fox+MeNCracYIWCP4DcvEQl49P5q2hw+rgA8AK1GPPXZwY/h9y1sjkggxmWblyYGETOxwI5bDWrLRi6kVUfmfcYGPrJDbQi49FomtCsJsfsKiF+Ib+UmgJEuSNjMd8zLadhSsiP60lZ0R4KXb7n1Nafx23mfyAn6noVH/3Uo3h0/96z1JcEjFpndUcw4QwfFpjqz4144bD6Ul3sH6lxZc86d1Io+cSoLLyF4NATL7NADUjRtcRA+1uNxWNclSyVukc8clrNtHqyl0laFp5UIJr2Iz/aPClnOSI8lpQZugIrVeORhL15aLxl6WEth7Ww== 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=9ul1DI5bs18h0UmD7LmGtj1djuX+GBUkpQUm2gJMMH0=; b=n+mmvLhu0s3Co3+YLqWVFhuPL+ez0HXcVAvl3z4kJASh+fSD17XIKB3B1n1SWshogiXHzcKhFqacT83hiw5xzPFqIhWTr0PJWRTjahFOcOut3zOc0eoDyLc6hCsnoIid1IhwhasE0HhuMfdJ4edy6q0w431ryN7cYhE81oytsL6qvd4cUl3VAXXM5QIb3QxaDNaJRy/7oi0x0YCxIYktuzWb6+M5ZDl8cZwYfU8dXD92X0GygFignKu6HIhaYagxxIGq0F82ZU8vTRXoAVaGUFOSM1/QOHeAR6TnuwR7M2wONv35DebP36YttxLqRJJ2yfSd2ztuBCTZA3okXEZuGQ== 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=9ul1DI5bs18h0UmD7LmGtj1djuX+GBUkpQUm2gJMMH0=; b=Aw8Ju/O10ecCZMUWxFkJ/fTj26KdZ6/tYLVRuaeHXWkQuNbYOHxfg2wsCpH/RuDO3w9klHlhL2k0gcfqy6wsicfWGWxq5Wp5TL4amYQcxiUiRU6F1c8udVUUB6OeDng3XNj7Yo6pdrQIUQpDbgtSY/KfRKcF+3PQKiSIOvGilDU= Received: from CY4PR13CA0045.namprd13.prod.outlook.com (2603:10b6:903:99::31) by CH2PR02MB7079.namprd02.prod.outlook.com (2603:10b6:610:82::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.30; Tue, 12 May 2020 13:18:33 +0000 Received: from CY1NAM02FT046.eop-nam02.prod.protection.outlook.com (2603:10b6:903:99:cafe::f9) by CY4PR13CA0045.outlook.office365.com (2603:10b6:903:99::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.12 via Frontend Transport; Tue, 12 May 2020 13:18:32 +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 CY1NAM02FT046.mail.protection.outlook.com (10.152.74.232) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:32 +0000 Received: from [149.199.38.66] (port=47676 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnX-0002QY-SL; Tue, 12 May 2020 06:18: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 1jYUno-0005ZK-3S; Tue, 12 May 2020 06:18:32 -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 04CDIVhe028652; Tue, 12 May 2020 06:18:31 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnm-0005Yb-KU; Tue, 12 May 2020 06:18:31 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id A6B4213C0168; Tue, 12 May 2020 18:40:27 +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 v4 06/12] net: cadence_gem: Move tx/rx packet buffert to CadenceGEMState Date: Tue, 12 May 2020 18:40:01 +0530 Message-Id: <1589289007-23629-7-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(346002)(136003)(46966005)(33430700001)(478600001)(186003)(82310400002)(2616005)(6266002)(4326008)(26005)(426003)(33440700001)(5660300002)(336012)(6666004)(8936002)(316002)(42186006)(110136005)(356005)(81166007)(70586007)(36756003)(2906002)(70206006)(47076004)(82740400003)(8676002); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67240b90-fdc3-477a-2272-08d7f676f80a X-MS-TrafficTypeDiagnostic: CH2PR02MB7079: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1824; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vWcI59pJS9GoMXtK4CUp+IL0JfPhghguSYaPonmrr/vKGlW/I0SKNlrY428livgHfRGiEx5rfMm8gni+Y5Osn4ylHpdTFA2AlRPKdFkGTbPKfYsVrPJOspjWKlwaulLiMGsQF8zKJgLGgUYBRGd4OsIw7IsaqnmBiCvBzR45KX7iJtxd7L3qYgc05Cl49uIcIXlAWQlJi+oXUZYdCTJka3Emw9Ac9bnYOdnf95xgOMImXB/L0fdd7Fht+cOAqwl3+faNCVQC5BB5N3apDMQ08NK/dRz7UmrLra512JPmEOkWPXiby1NNvzOZH1TSkwEVMKfWU7WAU7djd4MRN9ltLlqmUkt+7c6fWJZkOxfAe7dx2B27ecsbVdV9taci7zE6BIMkRcGA3RR0OluINl02CA8ocUOdKA5C5dQWnkfeaSP4UIMlrPcRe0JtuAKxAehvEik74b+Hav0S4JOFpF2vSKvXoOlDWbXozVKcxFeyEWIqDxYpAx72WTtE5PKA3xsg57I8ClzR2o6v1uDDFW2wiJ+xwQb55j5iZrsEPuw06bH95dk/Ue4Ji9CQE+FBAJaiViClvhj5Un66V0scBlJOXw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:32.4062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67240b90-fdc3-477a-2272-08d7f676f80a 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: CH2PR02MB7079 Received-SPF: pass client-ip=40.107.77.57; envelope-from=saipava@xilinx.com; helo=NAM02-SN1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 09:18:34 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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" Moving this buffers to CadenceGEMState, as their size will be increased more when JUMBO frames support is added. Signed-off-by: Sai Pavan Boddu Reviewed-by: Edgar E. Iglesias --- hw/net/cadence_gem.c | 38 +++++++++++++++++--------------------- include/hw/net/cadence_gem.h | 4 ++++ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index d3f7166..11e36d0 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -928,17 +928,14 @@ static void gem_get_rx_desc(CadenceGEMState *s, int q) */ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) { - CadenceGEMState *s; + CadenceGEMState *s = qemu_get_nic_opaque(nc); unsigned rxbufsize, bytes_to_copy; unsigned rxbuf_offset; - uint8_t rxbuf[2048]; uint8_t *rxbuf_ptr; bool first_desc = true; int maf; int q = 0; - s = qemu_get_nic_opaque(nc); - /* Is this destination MAC address "for us" ? */ maf = gem_mac_address_filter(s, buf); if (maf == GEM_RX_REJECT) { @@ -994,19 +991,19 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) } else { unsigned crc_val; - if (size > sizeof(rxbuf) - sizeof(crc_val)) { - size = sizeof(rxbuf) - sizeof(crc_val); + if (size > MAX_FRAME_SIZE - sizeof(crc_val)) { + size = MAX_FRAME_SIZE - sizeof(crc_val); } bytes_to_copy = size; /* The application wants the FCS field, which QEMU does not provide. * We must try and calculate one. */ - memcpy(rxbuf, buf, size); - memset(rxbuf + size, 0, sizeof(rxbuf) - size); - rxbuf_ptr = rxbuf; - crc_val = cpu_to_le32(crc32(0, rxbuf, MAX(size, 60))); - memcpy(rxbuf + size, &crc_val, sizeof(crc_val)); + memcpy(s->rx_packet, buf, size); + memset(s->rx_packet + size, 0, MAX_FRAME_SIZE - size); + rxbuf_ptr = s->rx_packet; + crc_val = cpu_to_le32(crc32(0, s->rx_packet, MAX(size, 60))); + memcpy(s->rx_packet + size, &crc_val, sizeof(crc_val)); bytes_to_copy += 4; size += 4; @@ -1152,7 +1149,6 @@ static void gem_transmit(CadenceGEMState *s) { uint32_t desc[DESC_MAX_NUM_WORDS]; hwaddr packet_desc_addr; - uint8_t tx_packet[2048]; uint8_t *p; unsigned total_bytes; int q = 0; @@ -1168,7 +1164,7 @@ static void gem_transmit(CadenceGEMState *s) * Packets scattered across multiple descriptors are gathered to this * one contiguous buffer first. */ - p = tx_packet; + p = s->tx_packet; total_bytes = 0; for (q = s->num_priority_queues - 1; q >= 0; q--) { @@ -1198,12 +1194,12 @@ static void gem_transmit(CadenceGEMState *s) break; } - if (tx_desc_get_length(desc) > sizeof(tx_packet) - - (p - tx_packet)) { + if (tx_desc_get_length(desc) > MAX_FRAME_SIZE - + (p - s->tx_packet)) { DB_PRINT("TX descriptor @ 0x%" HWADDR_PRIx \ " too large: size 0x%x space 0x%zx\n", packet_desc_addr, tx_desc_get_length(desc), - sizeof(tx_packet) - (p - tx_packet)); + MAX_FRAME_SIZE - (p - s->tx_packet)); break; } @@ -1248,24 +1244,24 @@ static void gem_transmit(CadenceGEMState *s) /* Is checksum offload enabled? */ if (s->regs[GEM_DMACFG] & GEM_DMACFG_TXCSUM_OFFL) { - net_checksum_calculate(tx_packet, total_bytes); + net_checksum_calculate(s->tx_packet, total_bytes); } /* Update MAC statistics */ - gem_transmit_updatestats(s, tx_packet, total_bytes); + gem_transmit_updatestats(s, s->tx_packet, total_bytes); /* Send the packet somewhere */ if (s->phy_loop || (s->regs[GEM_NWCTRL] & GEM_NWCTRL_LOCALLOOP)) { - gem_receive(qemu_get_queue(s->nic), tx_packet, + gem_receive(qemu_get_queue(s->nic), s->tx_packet, total_bytes); } else { - qemu_send_packet(qemu_get_queue(s->nic), tx_packet, + qemu_send_packet(qemu_get_queue(s->nic), s->tx_packet, total_bytes); } /* Prepare for next packet */ - p = tx_packet; + p = s->tx_packet; total_bytes = 0; } diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h index 5c83036..eddac70 100644 --- a/include/hw/net/cadence_gem.h +++ b/include/hw/net/cadence_gem.h @@ -40,6 +40,8 @@ #define MAX_TYPE1_SCREENERS 16 #define MAX_TYPE2_SCREENERS 16 +#define MAX_FRAME_SIZE 2048 + typedef struct CadenceGEMState { /*< private >*/ SysBusDevice parent_obj; @@ -80,6 +82,8 @@ typedef struct CadenceGEMState { uint8_t can_rx_state; /* Debug only */ + uint8_t tx_packet[MAX_FRAME_SIZE]; + uint8_t rx_packet[MAX_FRAME_SIZE]; uint32_t rx_desc[MAX_PRIORITY_QUEUES][DESC_MAX_NUM_WORDS]; bool sar_active[4]; From patchwork Tue May 12 13:10:02 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: 11543175 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 21E7B139F for ; Tue, 12 May 2020 13:26: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 D92F9206DD for ; Tue, 12 May 2020 13:26:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Uxzrp53P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D92F9206DD 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]:41798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUvJ-00026K-Uq for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:26:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnx-0007aJ-10; Tue, 12 May 2020 09:18:41 -0400 Received: from mail-bn8nam11on2061.outbound.protection.outlook.com ([40.107.236.61]:26970 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 1jYUns-0001zv-Jp; Tue, 12 May 2020 09:18:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3ePuXFZg2C7/ckRFT08Myp5ZfHlquL8ILS53I1P+GUxT4fYmX8iHUlDIPEC1XeJDLqTB7pGCPq1spLgK8/9lkn1n0Oix4baEaa+P/nHsXHYyk1NtZxyPcQJmLkHraHMLwdPPMJHtsaPThllPjmGzsWgTttABwdD0CMCAzv79NhF5h9SUdWwBtFMQvx4vTGFzOpL34xWx+njQppkMqr9UUnyX0vgfaF0QkzPdS8k1TaEev8yShA0r8x1Yc8VnCjnzDkHtlyqhF1OQVTQCh1bEcvRL7KqamZjYEiRwN8A5rCCikB55DDMdu2zoC7k8MmXG1CPFUxLHyO49IaJoVaxoA== 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=QDDfQay8WPdmdMcKmLynxs0u9Nr1s4msHPOvoJh9eKE=; b=iUPW4xAQSr857fH90o90h3mxkSgQkAQ6gLxblbaggXiJtNLHrH5Gfygdjwo2Jsy1pl6JXQ+1wlnsdyxHl1CObpSZXtj99r0RJ3zc3Tx1iuKnw4AVdgpNCRGx6mwP7WMYUxmDHLmOWei8cJVV0YszVhxAXUgW+uEz/iXbRMK6JxrHh341Gw24T1nke1u1dfizTuuZieUju69aTorkddLZeyY7DaKl4lZUMKBPnDpvoiP3nxTRrrkjFEMFUU3288T/0sQ01PYDD9oaHva6px5wz9ExCCx6n91NKM3vH0QaiRrDKmPl2pUwqB3au+mIHvqo/CopT9Uh332OnpifNCrdzQ== 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=QDDfQay8WPdmdMcKmLynxs0u9Nr1s4msHPOvoJh9eKE=; b=Uxzrp53PUBJJbeUkrfYda4Q/28IJIVMLa2HL6hEGHPbz2+7QluZEFgwzIOg2qDhJauYzHUtMFjPUoL5vPeEE5FKE6grbOBA2U2tNannScAtibyASRoXvhdx4JL1PO5sBe7pJGa9WWM9hD/vh3ro9nyyX6sAwSAbpp08emjU4V1s= Received: from SN4PR0501CA0081.namprd05.prod.outlook.com (2603:10b6:803:22::19) by BYAPR02MB5543.namprd02.prod.outlook.com (2603:10b6:a03:9f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Tue, 12 May 2020 13:18:33 +0000 Received: from SN1NAM02FT050.eop-nam02.prod.protection.outlook.com (2603:10b6:803:22:cafe::1) by SN4PR0501CA0081.outlook.office365.com (2603:10b6:803:22::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.12 via Frontend Transport; Tue, 12 May 2020 13:18:33 +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 SN1NAM02FT050.mail.protection.outlook.com (10.152.72.128) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:33 +0000 Received: from [149.199.38.66] (port=47692 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnY-0002Qb-OP; Tue, 12 May 2020 06:18: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 1jYUno-0005ZR-Vt; Tue, 12 May 2020 06:18:33 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 04CDIVs5028654; Tue, 12 May 2020 06:18:31 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnn-0005Yh-74; Tue, 12 May 2020 06:18:31 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 454D613C0170; Tue, 12 May 2020 18:40:28 +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 v4 07/12] net: cadence_gem: Fix up code style Date: Tue, 12 May 2020 18:40:02 +0530 Message-Id: <1589289007-23629-8-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(396003)(46966005)(33430700001)(70206006)(81166007)(2906002)(47076004)(8676002)(6666004)(356005)(70586007)(82740400003)(33440700001)(82310400002)(478600001)(110136005)(42186006)(26005)(30864003)(316002)(186003)(2616005)(4326008)(36756003)(5660300002)(6266002)(426003)(8936002)(336012); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 558cdf6b-a7d8-4699-7894-08d7f676f896 X-MS-TrafficTypeDiagnostic: BYAPR02MB5543: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:281; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wmh5T9yDtOxMcZ+BhEJ3DsGFC8z3Msan81VHOVVY1qIL6DIm4ChRR3cZSfzObB3EHLz1z4Zq5dUFDo1h1+7MRlwshDKe6r7fei7gEsPLHTUCSNqEFAbcyxPBgxzcD7nMC0jsvVYiVOCIRGaPoz9WGR1KQ2NtjEkMCLUiakqzrv80sM7P4q/WxdYzjXrFQGbuflNopI1Qms6ounBCtpxyrcZWM3d4Zq55IIlgWPLrd3HShasFkenKVjnvcQeMeD4FfAhGIAwXTm7FVHWzamEMFYZR9hsZaaIi+d2brFPifOk38f5ldm97hsLG75KeOcjtt0/ELxCGJBLZcNTRCIz+/20CttfkX0wLNw0IhKMZuHqfffDoa5Uj3oBT+CvE8NfHgcQnjNsoL7Lw2ZFgW5+bS/HBRbkeXbNdZ0/nuCtQh61xAcPpd2jZQ87ytLt/FB0i+EM6ZZOwLZ/ncidxBAGdBJpwQUbktB89vDyrEsA7jkOT2aE6itn7hAPfL1rv1VRtO0HGK9TI9kydz763DJ4X3Dib1UJKs1SHZ3aWEV3UsN1ct2+OKVa3YMOEPVSjmMDcMNypw1SqfldJigxFd0kjng== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:33.3259 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 558cdf6b-a7d8-4699-7894-08d7f676f896 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: BYAPR02MB5543 Received-SPF: pass client-ip=40.107.236.61; 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/12 09:18:35 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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" Fix the code style for register definitions. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 204 ++++++++++++++++++++++++++------------------------- 1 file changed, 103 insertions(+), 101 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 11e36d0..f6ff27c 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -43,110 +43,112 @@ } \ } while (0) -#define GEM_NWCTRL (0x00000000/4) /* Network Control reg */ -#define GEM_NWCFG (0x00000004/4) /* Network Config reg */ -#define GEM_NWSTATUS (0x00000008/4) /* Network Status reg */ -#define GEM_USERIO (0x0000000C/4) /* User IO reg */ -#define GEM_DMACFG (0x00000010/4) /* DMA Control reg */ -#define GEM_TXSTATUS (0x00000014/4) /* TX Status reg */ -#define GEM_RXQBASE (0x00000018/4) /* RX Q Base address reg */ -#define GEM_TXQBASE (0x0000001C/4) /* TX Q Base address reg */ -#define GEM_RXSTATUS (0x00000020/4) /* RX Status reg */ -#define GEM_ISR (0x00000024/4) /* Interrupt Status reg */ -#define GEM_IER (0x00000028/4) /* Interrupt Enable reg */ -#define GEM_IDR (0x0000002C/4) /* Interrupt Disable reg */ -#define GEM_IMR (0x00000030/4) /* Interrupt Mask reg */ -#define GEM_PHYMNTNC (0x00000034/4) /* Phy Maintenance reg */ -#define GEM_RXPAUSE (0x00000038/4) /* RX Pause Time reg */ -#define GEM_TXPAUSE (0x0000003C/4) /* TX Pause Time reg */ -#define GEM_TXPARTIALSF (0x00000040/4) /* TX Partial Store and Forward */ -#define GEM_RXPARTIALSF (0x00000044/4) /* RX Partial Store and Forward */ -#define GEM_HASHLO (0x00000080/4) /* Hash Low address reg */ -#define GEM_HASHHI (0x00000084/4) /* Hash High address reg */ -#define GEM_SPADDR1LO (0x00000088/4) /* Specific addr 1 low reg */ -#define GEM_SPADDR1HI (0x0000008C/4) /* Specific addr 1 high reg */ -#define GEM_SPADDR2LO (0x00000090/4) /* Specific addr 2 low reg */ -#define GEM_SPADDR2HI (0x00000094/4) /* Specific addr 2 high reg */ -#define GEM_SPADDR3LO (0x00000098/4) /* Specific addr 3 low reg */ -#define GEM_SPADDR3HI (0x0000009C/4) /* Specific addr 3 high reg */ -#define GEM_SPADDR4LO (0x000000A0/4) /* Specific addr 4 low reg */ -#define GEM_SPADDR4HI (0x000000A4/4) /* Specific addr 4 high reg */ -#define GEM_TIDMATCH1 (0x000000A8/4) /* Type ID1 Match reg */ -#define GEM_TIDMATCH2 (0x000000AC/4) /* Type ID2 Match reg */ -#define GEM_TIDMATCH3 (0x000000B0/4) /* Type ID3 Match reg */ -#define GEM_TIDMATCH4 (0x000000B4/4) /* Type ID4 Match reg */ -#define GEM_WOLAN (0x000000B8/4) /* Wake on LAN reg */ -#define GEM_IPGSTRETCH (0x000000BC/4) /* IPG Stretch reg */ -#define GEM_SVLAN (0x000000C0/4) /* Stacked VLAN reg */ -#define GEM_MODID (0x000000FC/4) /* Module ID reg */ -#define GEM_OCTTXLO (0x00000100/4) /* Octects transmitted Low reg */ -#define GEM_OCTTXHI (0x00000104/4) /* Octects transmitted High reg */ -#define GEM_TXCNT (0x00000108/4) /* Error-free Frames transmitted */ -#define GEM_TXBCNT (0x0000010C/4) /* Error-free Broadcast Frames */ -#define GEM_TXMCNT (0x00000110/4) /* Error-free Multicast Frame */ -#define GEM_TXPAUSECNT (0x00000114/4) /* Pause Frames Transmitted */ -#define GEM_TX64CNT (0x00000118/4) /* Error-free 64 TX */ -#define GEM_TX65CNT (0x0000011C/4) /* Error-free 65-127 TX */ -#define GEM_TX128CNT (0x00000120/4) /* Error-free 128-255 TX */ -#define GEM_TX256CNT (0x00000124/4) /* Error-free 256-511 */ -#define GEM_TX512CNT (0x00000128/4) /* Error-free 512-1023 TX */ -#define GEM_TX1024CNT (0x0000012C/4) /* Error-free 1024-1518 TX */ -#define GEM_TX1519CNT (0x00000130/4) /* Error-free larger than 1519 TX */ -#define GEM_TXURUNCNT (0x00000134/4) /* TX under run error counter */ -#define GEM_SINGLECOLLCNT (0x00000138/4) /* Single Collision Frames */ -#define GEM_MULTCOLLCNT (0x0000013C/4) /* Multiple Collision Frames */ -#define GEM_EXCESSCOLLCNT (0x00000140/4) /* Excessive Collision Frames */ -#define GEM_LATECOLLCNT (0x00000144/4) /* Late Collision Frames */ -#define GEM_DEFERTXCNT (0x00000148/4) /* Deferred Transmission Frames */ -#define GEM_CSENSECNT (0x0000014C/4) /* Carrier Sense Error Counter */ -#define GEM_OCTRXLO (0x00000150/4) /* Octects Received register Low */ -#define GEM_OCTRXHI (0x00000154/4) /* Octects Received register High */ -#define GEM_RXCNT (0x00000158/4) /* Error-free Frames Received */ -#define GEM_RXBROADCNT (0x0000015C/4) /* Error-free Broadcast Frames RX */ -#define GEM_RXMULTICNT (0x00000160/4) /* Error-free Multicast Frames RX */ -#define GEM_RXPAUSECNT (0x00000164/4) /* Pause Frames Received Counter */ -#define GEM_RX64CNT (0x00000168/4) /* Error-free 64 byte Frames RX */ -#define GEM_RX65CNT (0x0000016C/4) /* Error-free 65-127B Frames RX */ -#define GEM_RX128CNT (0x00000170/4) /* Error-free 128-255B Frames RX */ -#define GEM_RX256CNT (0x00000174/4) /* Error-free 256-512B Frames RX */ -#define GEM_RX512CNT (0x00000178/4) /* Error-free 512-1023B Frames RX */ -#define GEM_RX1024CNT (0x0000017C/4) /* Error-free 1024-1518B Frames RX */ -#define GEM_RX1519CNT (0x00000180/4) /* Error-free 1519-max Frames RX */ -#define GEM_RXUNDERCNT (0x00000184/4) /* Undersize Frames Received */ -#define GEM_RXOVERCNT (0x00000188/4) /* Oversize Frames Received */ -#define GEM_RXJABCNT (0x0000018C/4) /* Jabbers Received Counter */ -#define GEM_RXFCSCNT (0x00000190/4) /* Frame Check seq. Error Counter */ -#define GEM_RXLENERRCNT (0x00000194/4) /* Length Field Error Counter */ -#define GEM_RXSYMERRCNT (0x00000198/4) /* Symbol Error Counter */ -#define GEM_RXALIGNERRCNT (0x0000019C/4) /* Alignment Error Counter */ -#define GEM_RXRSCERRCNT (0x000001A0/4) /* Receive Resource Error Counter */ -#define GEM_RXORUNCNT (0x000001A4/4) /* Receive Overrun Counter */ -#define GEM_RXIPCSERRCNT (0x000001A8/4) /* IP header Checksum Error Counter */ -#define GEM_RXTCPCCNT (0x000001AC/4) /* TCP Checksum Error Counter */ -#define GEM_RXUDPCCNT (0x000001B0/4) /* UDP Checksum Error Counter */ - -#define GEM_1588S (0x000001D0/4) /* 1588 Timer Seconds */ -#define GEM_1588NS (0x000001D4/4) /* 1588 Timer Nanoseconds */ -#define GEM_1588ADJ (0x000001D8/4) /* 1588 Timer Adjust */ -#define GEM_1588INC (0x000001DC/4) /* 1588 Timer Increment */ -#define GEM_PTPETXS (0x000001E0/4) /* PTP Event Frame Transmitted (s) */ -#define GEM_PTPETXNS (0x000001E4/4) /* PTP Event Frame Transmitted (ns) */ -#define GEM_PTPERXS (0x000001E8/4) /* PTP Event Frame Received (s) */ -#define GEM_PTPERXNS (0x000001EC/4) /* PTP Event Frame Received (ns) */ -#define GEM_PTPPTXS (0x000001E0/4) /* PTP Peer Frame Transmitted (s) */ -#define GEM_PTPPTXNS (0x000001E4/4) /* PTP Peer Frame Transmitted (ns) */ -#define GEM_PTPPRXS (0x000001E8/4) /* PTP Peer Frame Received (s) */ -#define GEM_PTPPRXNS (0x000001EC/4) /* PTP Peer Frame Received (ns) */ +#define GEM_NWCTRL (0x00000000 / 4) /* Network Control reg */ +#define GEM_NWCFG (0x00000004 / 4) /* Network Config reg */ +#define GEM_NWSTATUS (0x00000008 / 4) /* Network Status reg */ +#define GEM_USERIO (0x0000000C / 4) /* User IO reg */ +#define GEM_DMACFG (0x00000010 / 4) /* DMA Control reg */ +#define GEM_TXSTATUS (0x00000014 / 4) /* TX Status reg */ +#define GEM_RXQBASE (0x00000018 / 4) /* RX Q Base address reg */ +#define GEM_TXQBASE (0x0000001C / 4) /* TX Q Base address reg */ +#define GEM_RXSTATUS (0x00000020 / 4) /* RX Status reg */ +#define GEM_ISR (0x00000024 / 4) /* Interrupt Status reg */ +#define GEM_IER (0x00000028 / 4) /* Interrupt Enable reg */ +#define GEM_IDR (0x0000002C / 4) /* Interrupt Disable reg */ +#define GEM_IMR (0x00000030 / 4) /* Interrupt Mask reg */ +#define GEM_PHYMNTNC (0x00000034 / 4) /* Phy Maintenance reg */ +#define GEM_RXPAUSE (0x00000038 / 4) /* RX Pause Time reg */ +#define GEM_TXPAUSE (0x0000003C / 4) /* TX Pause Time reg */ +#define GEM_TXPARTIALSF (0x00000040 / 4) /* TX Partial Store and Forward */ +#define GEM_RXPARTIALSF (0x00000044 / 4) /* RX Partial Store and Forward */ +#define GEM_HASHLO (0x00000080 / 4) /* Hash Low address reg */ +#define GEM_HASHHI (0x00000084 / 4) /* Hash High address reg */ +#define GEM_SPADDR1LO (0x00000088 / 4) /* Specific addr 1 low reg */ +#define GEM_SPADDR1HI (0x0000008C / 4) /* Specific addr 1 high reg */ +#define GEM_SPADDR2LO (0x00000090 / 4) /* Specific addr 2 low reg */ +#define GEM_SPADDR2HI (0x00000094 / 4) /* Specific addr 2 high reg */ +#define GEM_SPADDR3LO (0x00000098 / 4) /* Specific addr 3 low reg */ +#define GEM_SPADDR3HI (0x0000009C / 4) /* Specific addr 3 high reg */ +#define GEM_SPADDR4LO (0x000000A0 / 4) /* Specific addr 4 low reg */ +#define GEM_SPADDR4HI (0x000000A4 / 4) /* Specific addr 4 high reg */ +#define GEM_TIDMATCH1 (0x000000A8 / 4) /* Type ID1 Match reg */ +#define GEM_TIDMATCH2 (0x000000AC / 4) /* Type ID2 Match reg */ +#define GEM_TIDMATCH3 (0x000000B0 / 4) /* Type ID3 Match reg */ +#define GEM_TIDMATCH4 (0x000000B4 / 4) /* Type ID4 Match reg */ +#define GEM_WOLAN (0x000000B8 / 4) /* Wake on LAN reg */ +#define GEM_IPGSTRETCH (0x000000BC / 4) /* IPG Stretch reg */ +#define GEM_SVLAN (0x000000C0 / 4) /* Stacked VLAN reg */ +#define GEM_MODID (0x000000FC / 4) /* Module ID reg */ +#define GEM_OCTTXLO (0x00000100 / 4) /* Octects transmitted Low reg */ +#define GEM_OCTTXHI (0x00000104 / 4) /* Octects transmitted High reg */ +#define GEM_TXCNT (0x00000108 / 4) /* Error-free Frames transmitted */ +#define GEM_TXBCNT (0x0000010C / 4) /* Error-free Broadcast Frames */ +#define GEM_TXMCNT (0x00000110 / 4) /* Error-free Multicast Frame */ +#define GEM_TXPAUSECNT (0x00000114 / 4) /* Pause Frames Transmitted */ +#define GEM_TX64CNT (0x00000118 / 4) /* Error-free 64 TX */ +#define GEM_TX65CNT (0x0000011C / 4) /* Error-free 65-127 TX */ +#define GEM_TX128CNT (0x00000120 / 4) /* Error-free 128-255 TX */ +#define GEM_TX256CNT (0x00000124 / 4) /* Error-free 256-511 */ +#define GEM_TX512CNT (0x00000128 / 4) /* Error-free 512-1023 TX */ +#define GEM_TX1024CNT (0x0000012C / 4) /* Error-free 1024-1518 TX */ +#define GEM_TX1519CNT (0x00000130 / 4) /* Error-free larger than 1519 TX */ +#define GEM_TXURUNCNT (0x00000134 / 4) /* TX under run error counter */ +#define GEM_SINGLECOLLCNT (0x00000138 / 4) /* Single Collision Frames */ +#define GEM_MULTCOLLCNT (0x0000013C / 4) /* Multiple Collision Frames */ +#define GEM_EXCESSCOLLCNT (0x00000140 / 4) /* Excessive Collision Frames */ +#define GEM_LATECOLLCNT (0x00000144 / 4) /* Late Collision Frames */ +#define GEM_DEFERTXCNT (0x00000148 / 4) /* Deferred Transmission Frames */ +#define GEM_CSENSECNT (0x0000014C / 4) /* Carrier Sense Error Counter */ +#define GEM_OCTRXLO (0x00000150 / 4) /* Octects Received register Low */ +#define GEM_OCTRXHI (0x00000154 / 4) /* Octects Received register High */ +#define GEM_RXCNT (0x00000158 / 4) /* Error-free Frames Received */ +#define GEM_RXBROADCNT (0x0000015C / 4) /* Error-free Broadcast Frames RX */ +#define GEM_RXMULTICNT (0x00000160 / 4) /* Error-free Multicast Frames RX */ +#define GEM_RXPAUSECNT (0x00000164 / 4) /* Pause Frames Received Counter */ +#define GEM_RX64CNT (0x00000168 / 4) /* Error-free 64 byte Frames RX */ +#define GEM_RX65CNT (0x0000016C / 4) /* Error-free 65-127B Frames RX */ +#define GEM_RX128CNT (0x00000170 / 4) /* Error-free 128-255B Frames RX */ +#define GEM_RX256CNT (0x00000174 / 4) /* Error-free 256-512B Frames RX */ +#define GEM_RX512CNT (0x00000178 / 4) /* Error-free 512-1023B Frames RX */ +#define GEM_RX1024CNT (0x0000017C / 4) /* Error-free 1024-1518B Frames RX */ +#define GEM_RX1519CNT (0x00000180 / 4) /* Error-free 1519-max Frames RX */ +#define GEM_RXUNDERCNT (0x00000184 / 4) /* Undersize Frames Received */ +#define GEM_RXOVERCNT (0x00000188 / 4) /* Oversize Frames Received */ +#define GEM_RXJABCNT (0x0000018C / 4) /* Jabbers Received Counter */ +#define GEM_RXFCSCNT (0x00000190 / 4) /* Frame Check seq. Error Counter */ +#define GEM_RXLENERRCNT (0x00000194 / 4) /* Length Field Error Counter */ +#define GEM_RXSYMERRCNT (0x00000198 / 4) /* Symbol Error Counter */ +#define GEM_RXALIGNERRCNT (0x0000019C / 4) /* Alignment Error Counter */ +#define GEM_RXRSCERRCNT (0x000001A0 / 4) /* Receive Resource Error Counter */ +#define GEM_RXORUNCNT (0x000001A4 / 4) /* Receive Overrun Counter */ +#define GEM_RXIPCSERRCNT (0x000001A8 / 4) /* IP header Checksum Err Counter */ +#define GEM_RXTCPCCNT (0x000001AC / 4) /* TCP Checksum Error Counter */ +#define GEM_RXUDPCCNT (0x000001B0 / 4) /* UDP Checksum Error Counter */ + +#define GEM_1588S (0x000001D0 / 4) /* 1588 Timer Seconds */ +#define GEM_1588NS (0x000001D4 / 4) /* 1588 Timer Nanoseconds */ +#define GEM_1588ADJ (0x000001D8 / 4) /* 1588 Timer Adjust */ +#define GEM_1588INC (0x000001DC / 4) /* 1588 Timer Increment */ +#define GEM_PTPETXS (0x000001E0 / 4) /* PTP Event Frame Transmitted (s) */ +#define GEM_PTPETXNS (0x000001E4 / 4) /* + * PTP Event Frame Transmitted (ns) + */ +#define GEM_PTPERXS (0x000001E8 / 4) /* PTP Event Frame Received (s) */ +#define GEM_PTPERXNS (0x000001EC / 4) /* PTP Event Frame Received (ns) */ +#define GEM_PTPPTXS (0x000001E0 / 4) /* PTP Peer Frame Transmitted (s) */ +#define GEM_PTPPTXNS (0x000001E4 / 4) /* PTP Peer Frame Transmitted (ns) */ +#define GEM_PTPPRXS (0x000001E8 / 4) /* PTP Peer Frame Received (s) */ +#define GEM_PTPPRXNS (0x000001EC / 4) /* PTP Peer Frame Received (ns) */ /* Design Configuration Registers */ -#define GEM_DESCONF (0x00000280/4) -#define GEM_DESCONF2 (0x00000284/4) -#define GEM_DESCONF3 (0x00000288/4) -#define GEM_DESCONF4 (0x0000028C/4) -#define GEM_DESCONF5 (0x00000290/4) -#define GEM_DESCONF6 (0x00000294/4) +#define GEM_DESCONF (0x00000280 / 4) +#define GEM_DESCONF2 (0x00000284 / 4) +#define GEM_DESCONF3 (0x00000288 / 4) +#define GEM_DESCONF4 (0x0000028C / 4) +#define GEM_DESCONF5 (0x00000290 / 4) +#define GEM_DESCONF6 (0x00000294 / 4) #define GEM_DESCONF6_64B_MASK (1U << 23) -#define GEM_DESCONF7 (0x00000298/4) +#define GEM_DESCONF7 (0x00000298 / 4) #define GEM_INT_Q1_STATUS (0x00000400 / 4) #define GEM_INT_Q1_MASK (0x00000640 / 4) From patchwork Tue May 12 13:10:03 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: 11543161 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 33162139F for ; Tue, 12 May 2020 13:22:07 +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 EAC8B206DD for ; Tue, 12 May 2020 13:22:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="KCeyFGX/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAC8B206DD 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]:55442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUrG-0003fS-3L for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:22:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnv-0007Xb-QA; Tue, 12 May 2020 09:18:39 -0400 Received: from mail-co1nam11on2062.outbound.protection.outlook.com ([40.107.220.62]:6135 helo=NAM11-CO1-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 1jYUnt-0001zy-Et; Tue, 12 May 2020 09:18:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QSysTS7g3zcJNFjeHTuJExEDAzpUZaLvu9+x+vYszOWh9Gy51X6xlZSVuko2wP2ohTHw3HqgZC4TaAgoanKiRRTU1CnlJE1uf5h5HrwI5Q4xaO8gRo8QX7KsWBRlTa+vbZ/FZOt6WxfxRXp7wu/TJ0jMBOJPh+v/H39qe/rGmblUr5bpMbbExzrWmJAv9EnFaZRNHs1ecZeroqLzUkY4dlSE8MV+LYKdYhj1NOloK+hSwbovcPTmSohgtQQuYcFL52pPTBAUFOxXD0NMsYAhcWmRFLcVH1j9kOvNfNfMT0dV8Td3ZFw1niQEevyqT+4H4xzZ4fht1V7BNIfv/8UTAg== 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=sDwcrhsY51j0FKDUMxTnNU1qPxw/GNcOUTL856PDq8w=; b=by0GHr8AcqTNlU+qwhlT4evYGr/HKk2j6Mbk7m9VO6vTGie7OhN9uFAs11HKOMineMFDasusiSyhECe8+QaugcEh4ggasfkJjQjJQ+PMtqpMnIjP3Ng9V0qS8Q2AzaUD50S5od42XD1Vc1Jpi9zf5KpcwFkix4VS8zqv2jJzaj5+J4SxyUZ6zZdfI2cY0a4g1f72gCmV8uLvBGQuwKhve8uNnn1x8lJP8nxbfzmyRPVGe1ip19heZfloA/vujQLBpLNVnfJbO6yZcDWu0W5Vt2D3byDU8/FymAftOT2qCBJ+Q6cbwbOIXurELuxdL2tqFhiN9Ab56RtH3IUiD83QHA== 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=sDwcrhsY51j0FKDUMxTnNU1qPxw/GNcOUTL856PDq8w=; b=KCeyFGX/FuLKHjlun/XOQqksqogmxIsDyPuV5VOIqv9QmFnozxYFtO6ovN2h00XvZcCpyQsglMUzt8kzF7T6GIlifRTpsPkZ5wYkVrDfdzBa2XrWX97+VvqkGasMBxHK/CcuUrrJ9pgYLn2UO24uVJDcYSsDLuOW+M4UGyBDPvU= Received: from SN6PR2101CA0013.namprd21.prod.outlook.com (2603:10b6:805:106::23) by CH2PR02MB6824.namprd02.prod.outlook.com (2603:10b6:610:af::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 13:18:34 +0000 Received: from SN1NAM02FT009.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::7a) by SN6PR2101CA0013.outlook.office365.com (2603:10b6:805:106::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Tue, 12 May 2020 13:18:34 +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 SN1NAM02FT009.mail.protection.outlook.com (10.152.73.32) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:33 +0000 Received: from [149.199.38.66] (port=47705 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnZ-0002Qf-AH; Tue, 12 May 2020 06:18:17 -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 1jYUnp-0005Zf-IC; Tue, 12 May 2020 06:18:33 -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 04CDIWkJ028677; Tue, 12 May 2020 06:18:32 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnn-0005Yb-Qk; Tue, 12 May 2020 06:18:32 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id D983313C0168; Tue, 12 May 2020 18:40:28 +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 v4 08/12] net: cadence_gem: Add support for jumbo frames Date: Tue, 12 May 2020 18:40:03 +0530 Message-Id: <1589289007-23629-9-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(376002)(346002)(46966005)(33430700001)(70206006)(36756003)(316002)(110136005)(2616005)(47076004)(81166007)(336012)(82740400003)(42186006)(426003)(8676002)(70586007)(8936002)(356005)(5660300002)(82310400002)(4326008)(33440700001)(6266002)(2906002)(26005)(186003)(478600001)(6666004); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41d4f001-0df7-458c-20af-08d7f676f8ed X-MS-TrafficTypeDiagnostic: CH2PR02MB6824: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:186; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tff6rCK0Eqmol3d+8udivNylczn8HDezKufWbCOe6FZ3Hp1gQ4i6OW6XwCuMlHRTzWxn0fDUxVSzz5KprAuqFsc7wZRQX9i5VIRlZHHdJICv357tANtObagXLfQywTgEaZByziAT5MSvgjFE9pkIq6XyVlQNPZyTwv/fuy0ilv+nOpvlMjnxZ7c/1si+qDoVlIPTXrW6xFY9z+LLTxOQFIi0AvNtBCzI6Ph6SjQrM1f05pomTd61iLZkpNAiL9fg/Vun9aIxq1Spi14nmIKp0ohz2kgmYcQFRk7ylYvFZPkqM2FWx1Nt1RLiKlegcTGEtnvzzudCSSGjFB0loNLnt1Fg6Q9B9xiDKXjwJHP6/tqvl+aFHGcu5eC9RyFjatfIEU3m0kYi2uH1raPtLe+tQHFUoOkAagVjG34C+5ua5yWlCTuiO1hnORP+dDI0FXNf0TQFXo8m5iG1yVe04hoSAWTE1yuaQ77aqANo3BbzK+uOd8nmi/A7M6OsjIcLBuRFh86H1i96unfVIjbvB2d6FjxzNQmx9pIdkBb5PDUQekjzlLRttfAA9mwzczWKL/C8kM4st6KdCY9Ja565TNaBoQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:33.8878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41d4f001-0df7-458c-20af-08d7f676f8ed 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: CH2PR02MB6824 Received-SPF: pass client-ip=40.107.220.62; envelope-from=saipava@xilinx.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 09:18:35 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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" Add a property "jumbo-max-len", which sets default value of jumbo frames up to 16,383 bytes. Add Frame length checks for standard and jumbo frames. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 46 +++++++++++++++++++++++++++++++++++++++----- include/hw/net/cadence_gem.h | 4 +++- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index f6ff27c..85142e1 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -61,6 +61,7 @@ #define GEM_TXPAUSE (0x0000003C / 4) /* TX Pause Time reg */ #define GEM_TXPARTIALSF (0x00000040 / 4) /* TX Partial Store and Forward */ #define GEM_RXPARTIALSF (0x00000044 / 4) /* RX Partial Store and Forward */ +#define GEM_JUMBO_MAX_LEN (0x00000048 / 4) /* Max Jumbo Frame Size */ #define GEM_HASHLO (0x00000080 / 4) /* Hash Low address reg */ #define GEM_HASHHI (0x00000084 / 4) /* Hash High address reg */ #define GEM_SPADDR1LO (0x00000088 / 4) /* Specific addr 1 low reg */ @@ -212,10 +213,12 @@ #define GEM_NWCFG_LERR_DISC 0x00010000 /* Discard RX frames with len err */ #define GEM_NWCFG_BUFF_OFST_M 0x0000C000 /* Receive buffer offset mask */ #define GEM_NWCFG_BUFF_OFST_S 14 /* Receive buffer offset shift */ +#define GEM_NWCFG_RCV_1538 0x00000100 /* Receive 1538 bytes frame */ #define GEM_NWCFG_UCAST_HASH 0x00000080 /* accept unicast if hash match */ #define GEM_NWCFG_MCAST_HASH 0x00000040 /* accept multicast if hash match */ #define GEM_NWCFG_BCAST_REJ 0x00000020 /* Reject broadcast packets */ #define GEM_NWCFG_PROMISC 0x00000010 /* Accept all packets */ +#define GEM_NWCFG_JUMBO_FRAME 0x00000008 /* Jumbo Frames enable */ #define GEM_DMACFG_ADDR_64B (1U << 30) #define GEM_DMACFG_TX_BD_EXT (1U << 29) @@ -233,6 +236,7 @@ /* GEM_ISR GEM_IER GEM_IDR GEM_IMR */ #define GEM_INT_TXCMPL 0x00000080 /* Transmit Complete */ +#define GEM_INT_AMBA_ERR 0x00000040 #define GEM_INT_TXUSED 0x00000008 #define GEM_INT_RXUSED 0x00000004 #define GEM_INT_RXCMPL 0x00000002 @@ -453,6 +457,19 @@ static inline void rx_desc_set_sar(uint32_t *desc, int sar_idx) /* The broadcast MAC address: 0xFFFFFFFFFFFF */ static const uint8_t broadcast_addr[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; +static uint32_t gem_get_max_buf_len(CadenceGEMState *s, bool tx) +{ + uint32_t size; + if (s->regs[GEM_NWCFG] & GEM_NWCFG_JUMBO_FRAME) { + size = s->regs[GEM_JUMBO_MAX_LEN]; + } else if (tx) { + size = 1518; + } else { + size = s->regs[GEM_NWCFG] & GEM_NWCFG_RCV_1538 ? 1538 : 1518; + } + return size; +} + static void gem_set_isr(CadenceGEMState *s, int q, uint32_t flag) { if (q == 0) { @@ -1016,6 +1033,12 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) /* Find which queue we are targeting */ q = get_queue_from_screen(s, rxbuf_ptr, rxbufsize); + if (size > gem_get_max_buf_len(s, false)) { + qemu_log_mask(LOG_GUEST_ERROR, "rx frame too long\n"); + gem_set_isr(s, q, GEM_INT_AMBA_ERR); + return -1; + } + while (bytes_to_copy) { hwaddr desc_addr; @@ -1196,12 +1219,13 @@ static void gem_transmit(CadenceGEMState *s) break; } - if (tx_desc_get_length(desc) > MAX_FRAME_SIZE - + if (tx_desc_get_length(desc) > gem_get_max_buf_len(s, true) - (p - s->tx_packet)) { - DB_PRINT("TX descriptor @ 0x%" HWADDR_PRIx \ - " too large: size 0x%x space 0x%zx\n", + qemu_log_mask(LOG_GUEST_ERROR, "TX descriptor @ 0x%" \ + HWADDR_PRIx " too large: size 0x%x space 0x%zx\n", packet_desc_addr, tx_desc_get_length(desc), - MAX_FRAME_SIZE - (p - s->tx_packet)); + gem_get_max_buf_len(s, true) - (p - s->tx_packet)); + gem_set_isr(s, q, GEM_INT_AMBA_ERR); break; } @@ -1343,9 +1367,10 @@ 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] = 0x2ab10000 | s->jumbo_max_len; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; + s->regs[GEM_JUMBO_MAX_LEN] = s->jumbo_max_len; if (s->num_priority_queues > 1) { queues_mask = MAKE_64BIT_MASK(1, s->num_priority_queues - 1); @@ -1516,6 +1541,9 @@ static void gem_write(void *opaque, hwaddr offset, uint64_t val, s->regs[GEM_IMR] &= ~val; gem_update_int_status(s); break; + case GEM_JUMBO_MAX_LEN: + s->regs[GEM_JUMBO_MAX_LEN] = val & MAX_JUMBO_FRAME_SIZE_MASK; + break; case GEM_INT_Q1_ENABLE ... GEM_INT_Q7_ENABLE: s->regs[GEM_INT_Q1_MASK + offset - GEM_INT_Q1_ENABLE] &= ~val; gem_update_int_status(s); @@ -1610,6 +1638,12 @@ static void gem_realize(DeviceState *dev, Error **errp) s->nic = qemu_new_nic(&net_gem_info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s); + + if (s->jumbo_max_len > MAX_FRAME_SIZE) { + error_setg(errp, "jumbo-max-len is greater than %d", + MAX_FRAME_SIZE); + return; + } } static void gem_init(Object *obj) @@ -1659,6 +1693,8 @@ static Property gem_properties[] = { num_type1_screeners, 4), DEFINE_PROP_UINT8("num-type2-screeners", CadenceGEMState, num_type2_screeners, 4), + DEFINE_PROP_UINT16("jumbo-max-len", CadenceGEMState, + jumbo_max_len, 10240), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h index eddac70..f6523dc 100644 --- a/include/hw/net/cadence_gem.h +++ b/include/hw/net/cadence_gem.h @@ -40,7 +40,8 @@ #define MAX_TYPE1_SCREENERS 16 #define MAX_TYPE2_SCREENERS 16 -#define MAX_FRAME_SIZE 2048 +#define MAX_JUMBO_FRAME_SIZE_MASK 0x3FFF +#define MAX_FRAME_SIZE MAX_JUMBO_FRAME_SIZE_MASK typedef struct CadenceGEMState { /*< private >*/ @@ -84,6 +85,7 @@ typedef struct CadenceGEMState { uint8_t tx_packet[MAX_FRAME_SIZE]; uint8_t rx_packet[MAX_FRAME_SIZE]; + uint16_t jumbo_max_len; uint32_t rx_desc[MAX_PRIORITY_QUEUES][DESC_MAX_NUM_WORDS]; bool sar_active[4]; From patchwork Tue May 12 13:10:04 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: 11543189 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 851FF1668 for ; Tue, 12 May 2020 13:26:39 +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 57A6A206DD for ; Tue, 12 May 2020 13:26:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ItDxrq8Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57A6A206DD 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]:43122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUve-0002lB-E7 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:26:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnu-0007Ur-FB; Tue, 12 May 2020 09:18:38 -0400 Received: from mail-bn8nam12on2040.outbound.protection.outlook.com ([40.107.237.40]:61811 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 1jYUnt-0001zz-3L; Tue, 12 May 2020 09:18:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=atXAPXFIQLrkgJ3cOJXgd5e02uYkeEF/HcdSOkHppHnJXloq2duNAbP7rQq+x0vaPJUkgqz2QuQHjk50K92PKru8yAQaQcjej0I17UBuYqJ3RL5OZWbWyjXX/LzNxXRetOIvlVUUpCNJ1fTO7Yojf0j731y0NhVz28MP47Llk3VvFY+SIcXAwQIi6oKNpG7/V9Yy4ETcg+sOLMBJ3HzUQFZCHq5tFhdqyaJMPF7ZZk3PD6RnMQWwYN3kDBNJPoM6Mio62BpNpNUWsodZGzFrDZlOr3spkp1iKOqby2eAWbhujZLtQdDSy/jQ6QfPQ2p+xsDtox3938MEUaO/G2UaTw== 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=2EpXeOfC1ILQqopTX3n4mY2+rnEuGrApg5c5SMjIDoY=; b=mgehmsIuWSMNxGmvZRADJhQn3NtGPN2XatzVHqjQshXL9C4vdmsMLVIawWMGB56u9wT11AC9+PEOoxXUAGOzScVNjg/EpkLLUpQMv5653wsYyuT3KAYdfYXpMK0VmwKWuXOmPokpQLWlHFTT8+imFDGUYcHba9Te1gODZ/so9/bF/bqn/sWJP4uvz+6wXF1+otcbcx4Dvl2ZZXzdErS2uYatpRzrb3MEdMooZMiiSDd6EAgijoY9cPrqaIjSFj7Xz8kf55lz1Pb7Qwlt8lnHYcVMnx/8ftxZMRr4dJ0P7gBcDYPCCztq//rWMKSIlLtYf/+Kyte4gR0VvjP4a6d2TA== 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=2EpXeOfC1ILQqopTX3n4mY2+rnEuGrApg5c5SMjIDoY=; b=ItDxrq8ZUJr2Ut1jLl2ZfZAFMUf/2aJcNNcCyL7ajj8osDALjMFDhlUJR9Xj2dJ8NUSB1jYtm6gdZ3Cl6Le11mE/krGW5YKNN/H5HFc4YDOK9rUsheYpmKR19cZf7+FF2iZzrCunMDALZSA26nBhrA3TTGlX5of8u/sCjEmY3W8= Received: from SN4PR0701CA0001.namprd07.prod.outlook.com (2603:10b6:803:28::11) by DM6PR02MB4762.namprd02.prod.outlook.com (2603:10b6:5:10::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 13:18:34 +0000 Received: from SN1NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:803:28:cafe::b4) by SN4PR0701CA0001.outlook.office365.com (2603:10b6:803:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 13:18:34 +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 SN1NAM02FT029.mail.protection.outlook.com (10.152.72.110) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:34 +0000 Received: from [149.199.38.66] (port=47714 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnZ-0002Qi-Gw; Tue, 12 May 2020 06:18:17 -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 1jYUnp-0005Ze-OY; Tue, 12 May 2020 06:18:33 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 04CDIWgb016850; Tue, 12 May 2020 06:18:32 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUno-0005Yh-DW; Tue, 12 May 2020 06:18:32 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 75E5B13C0170; Tue, 12 May 2020 18:40:29 +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 v4 09/12] net: cadnece_gem: Update irq_read_clear field of designcfg_debug1 reg Date: Tue, 12 May 2020 18:40:04 +0530 Message-Id: <1589289007-23629-10-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(136003)(46966005)(33430700001)(33440700001)(2616005)(6666004)(4326008)(42186006)(110136005)(478600001)(4744005)(426003)(316002)(26005)(6266002)(356005)(186003)(8676002)(70586007)(2906002)(82740400003)(47076004)(5660300002)(82310400002)(81166007)(8936002)(70206006)(36756003)(336012); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 544f08c5-52a9-4838-a34f-08d7f676f923 X-MS-TrafficTypeDiagnostic: DM6PR02MB4762: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:185; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XIIJmpWtNnSNhfOGux7s+LDTV8yzpVQ1Qk0kf3mrcfmOsyms4RNZ9bld1YIt8UChnw9Xwj+VwN4KYVVNps/z6EdUaUlIJc3f45+XuAQMaz8ZRcK2YrlP0Mg9qm5nBRYTUc1f3aI7V4uI1qfplsdrTJ6sPycUAQWupHYSDF6aV6TqQslCCoq0ZJ1wcLvSJePedyzkn9DHMKQ+dEcqs/TeBpBcXk3DMaKY3alBDI6r4cpAA6HX/K5OhldfJYz1YSqort1Dfl7xAwAGEhDlmncFZ8aNi0a+D+EH8dC3SHf8k0slS0wwqGWHYCzgOtPufPdm3wdrR1Smv3jp4Axddv7x9gaHxsL1polEp00eK2fKhN3Vj5FyQt70K7ygCYq8KzYr239U5lnRDFJcM+PIY13k4ZLf0YIcdr5Pnvc5ZPUgQAC1wPIxwbKNOA44S8JZrfsbzqHirxUOn8BJzxhd7OkJpq0duKLn6ZksMTT5xFTcWoVq04eEeX5d8rWwXYReY9+dDzHjQoio8ttiPKmMEjO59LKPn7SCcwsfL3R5bJ4rI70nnPU9wgmHwCS9+TeshKzmsgLiHWChilYIQtV43Opbvg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:34.2510 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 544f08c5-52a9-4838-a34f-08d7f676f923 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: DM6PR02MB4762 Received-SPF: pass client-ip=40.107.237.40; 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/12 09:18:35 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-by: Edgar E. Iglesias --- 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 85142e1..423b47a 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1366,7 +1366,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] = 0x2ab10000 | s->jumbo_max_len; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; From patchwork Tue May 12 13:10: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: 11543169 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 6EAE8139F for ; Tue, 12 May 2020 13:24:06 +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 444F9206F5 for ; Tue, 12 May 2020 13:24:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="peP/6b30" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 444F9206F5 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]:34500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUtB-0006xn-GT for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnw-0007ZN-L4; Tue, 12 May 2020 09:18:40 -0400 Received: from mail-eopbgr760052.outbound.protection.outlook.com ([40.107.76.52]:41286 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 1jYUnv-00020f-71; Tue, 12 May 2020 09:18:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EX19zkeNLZYum6Hx1tXVen0pHkEJKhRWcaahKClYAPw5QwMlXC/w9xpmLHwuz6TALGmEsif001cSKKwsxVzrEnBv+BaNkYotH5Toyqp/ABXNiC2ktf7IVzZUundG2l8uyZ4WXMCIm6UgyKvgW/ymlHuizENX/E5mbDiHcSPresRY5kK0JPRiBE8i+YKbHmccDX8TtNm5f+LVgw1bij1uO+6KtkIwibw7EWizrW6opwiy2wGt4xfs1TmPBg8wiQrJs62V+itHjymkQ9TzvwsPqLsgr4IkMvuzET+ZE9EkS7zrslz0yvSHAYLgVyS4pkwLNPslKezZJi/+Y4uNBc22CA== 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=YM3L9vIT53CsI7LryR5moDnPHpoe37dlZRZ8NoCe+og=; b=DLzXsA/t7iLSEKNVLiKGhllQJQeGN/JOv8AatbzeBYGin8ouesr3VP+g0l/UEUWjw1zUNbe+j8kZmepzykTlh3TF7GJS2L9rDRITDsIAEAJeIV9RfJgaL8o3Gg4Ebi6yho2EiIdcLeQbNJ3yiADVjEi+PkkGsIgdCCnlz812wuzcAQU3d8KJgU7lVpSOFaWiv/UMZBNKw5jO8RTod9q+9k5wItxwx8LG1XX0fhTy9hANrD2RJg8P8hYqGzlnOHJH3QvPNPYNyS3Yjqizj7oUrA9PZ5E97NQ/qdCY4cWC3KwfiREQ0h+/St46bSq0xSEIYX64L8HVKvC3k27NtkvdAg== 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=YM3L9vIT53CsI7LryR5moDnPHpoe37dlZRZ8NoCe+og=; b=peP/6b307GycH627A/5R7JKPDC9NPZFyI/TFRQrPryFDy8vv1NqfkAvR03D0as5BakYXwh5DqLGFc87kpk8aJ7gxdL7ddj8gAOfmJ+BEGzL4OFRNBRXj7/gFB+QCMa4pVdLK8LgaU1Bo2ZdGZQnyoK71uX3x5GrWtuFrcAV+dGw= Received: from SN6PR2101CA0013.namprd21.prod.outlook.com (2603:10b6:805:106::23) by BYAPR02MB5352.namprd02.prod.outlook.com (2603:10b6:a03:63::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 13:18:36 +0000 Received: from SN1NAM02FT009.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::7a) by SN6PR2101CA0013.outlook.office365.com (2603:10b6:805:106::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Tue, 12 May 2020 13:18:36 +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 SN1NAM02FT009.mail.protection.outlook.com (10.152.73.32) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:36 +0000 Received: from [149.199.38.66] (port=47733 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUna-0002Qm-K5; Tue, 12 May 2020 06:18:18 -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 1jYUnq-0005Zu-Rn; Tue, 12 May 2020 06:18:34 -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 04CDIXXw016854; Tue, 12 May 2020 06:18:33 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnp-0005ZZ-Ec; Tue, 12 May 2020 06:18:33 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 1651713C0175; Tue, 12 May 2020 18:40:30 +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 v4 10/12] net: cadence_gem: Update the reset value for interrupt mask register Date: Tue, 12 May 2020 18:40:05 +0530 Message-Id: <1589289007-23629-11-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(396003)(376002)(46966005)(33430700001)(82740400003)(6666004)(2616005)(33440700001)(8676002)(70586007)(336012)(82310400002)(5660300002)(36756003)(8936002)(81166007)(70206006)(47076004)(2906002)(478600001)(426003)(356005)(42186006)(6266002)(186003)(4744005)(4326008)(110136005)(316002)(26005); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b5f651a-8a0d-4414-4e7e-08d7f676fa39 X-MS-TrafficTypeDiagnostic: BYAPR02MB5352: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:83; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E84SPnocAiLNuEXi9/UgxpSsVXttnHRUkcJ598p22BSKzhX+cwDhLlkRMjsAPVO6sOFXsFnUz3p2yU3OuwuzqCr5OAQYgMucd7YkpVoLuGww8hZ6mLAcU6M2yZgjzq7ukXWflHy+Lpm7Gm43Gg/goi4yCg91nfiqx+RnNhd3T6hv4o5pNCw0JZ5tSsJDIPZok8UoJB3TzQfNF+muLs7aczR94eOaEEy5RqKjy7giCGZfVSHxGh+M0PNRqDQerpWIUKEjmX0XC8vOcP665Ao1EOx8qMdem+avUz8BBTy5h1lHGBfoSqbKj3goEynwLN7rU9VvSQZZP/8lvv7TQ5LvpUe65abQfneQOO+aYTNVtUn4dZadpbfMLm3k9NKBICed0L+K29Oto8bcv5Xt+whvTsMFHdlFTDSO/mliG5OF4LA5qrw+QREYMdnwi6MDBSyQblhHQKRBd/usHFbSWuz3EMtqdLdIhsDVKmsjnIONnGevrMWbh8P9hblPbcTzISNdMXCKZcflsp372nSFWuOJuTb9ar2iysgL9LNHK5hzeqIMg23y3iy3f5OGFZb4HDD3S9TaAaJKwxTe7Tip7LkoQQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:36.0678 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b5f651a-8a0d-4414-4e7e-08d7f676fa39 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: BYAPR02MB5352 Received-SPF: pass client-ip=40.107.76.52; 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/12 09:18:33 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-by: Edgar E. Iglesias --- 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 423b47a..1b2e31d 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1370,6 +1370,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_DESCONF2] = 0x2ab10000 | s->jumbo_max_len; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; + s->regs[GEM_INT_Q1_MASK] = 0x00000CE6; s->regs[GEM_JUMBO_MAX_LEN] = s->jumbo_max_len; if (s->num_priority_queues > 1) { From patchwork Tue May 12 13:10: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: 11543201 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 E4783139F for ; Tue, 12 May 2020 13:26:56 +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 BAF24206F5 for ; Tue, 12 May 2020 13:26:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="J2j6tPFM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAF24206F5 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]:43790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUvv-00033q-Ty for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:26:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnw-0007Y7-3q; Tue, 12 May 2020 09:18:40 -0400 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:6190 helo=NAM12-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 1jYUnu-00020b-Td; Tue, 12 May 2020 09:18:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZQhezXpYw9Tu8gSjHXu27ClNN9lU7NNTnAIcT2cgWDBN5aW7WCr9fJY07kseNT2otabU4XBsOIbLH4Ivh1Lbws1nT/2a2TI+7fnNvi6oFfEIGCr7K/euADHXySsnSGkZQS34paEG/5CfRwjrQyNsYV0Nrb15T9xBSJgp27ZzvsH12eghiBZkLPdlRF6hb0YTb5FbJLZ/z0d1x3xpsHx19/kHX/gggsgjAR9RntrCkW21RaHGTffYXMEIIi7ty/degYOGLTQNwy+Ie3t4mkPRY33nwM+plhU2Ks5mp1EfVU0Q7gOzJMlzyQdQ2Vd7cr4lEq5Sk4+L4P4hurzoh6iBxA== 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=BiCAYYWSKAdgAGxBCh2o5jla2c/4m9/c42RLwzsMhUQ=; b=jCeSFyVTW5tV7lQ8SabjOlGjJEuT3I41HduljR67YlaQYq+xS+0StqkXO6inUhQL3sRkEQVSmkD12q+r7FFHiwQz08T6n6DZ3p8K/M65mOmrT9ZwGiuobwNVoL275GtMluPl9PgS0MOJ7wQjjUSjd6pYkr/oGPkDxNra4MatA5IV6OCdMuNYwnukSCvSYR9bR5K+PowxNMTDdGZrVLT4TnCqVlzpu2V2oexXInbuIDxSniPXpz2RKVcLo/8HnFZ4w3faGzPXZY6G5mibwz09HkT7jYosLmeNXE83dEuVDXCKlbQ+K661Sh1xpJLwYDwcBCFNejbQJGoWkdvm+84QlQ== 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=BiCAYYWSKAdgAGxBCh2o5jla2c/4m9/c42RLwzsMhUQ=; b=J2j6tPFMfDGxyDsHk3pTIviyrvWzeDMBouwoEj9OGn+UP/2qV5lVJEnuGrGIeLWKLHVSE2d5GrzrY/4AGKrb39MsgOLKGeA9WqVu/HR+5Furuen5HbitoYEfpUI8m42Z/ZLa7TEzMPQU10XVmGjZqPdaEtBcJS1mENzt8Po9CnA= Received: from DM5PR18CA0060.namprd18.prod.outlook.com (2603:10b6:3:22::22) by MW2PR02MB3692.namprd02.prod.outlook.com (2603:10b6:907:e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 13:18:36 +0000 Received: from CY1NAM02FT043.eop-nam02.prod.protection.outlook.com (2603:10b6:3:22:cafe::fd) by DM5PR18CA0060.outlook.office365.com (2603:10b6:3:22::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 13:18:35 +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 CY1NAM02FT043.mail.protection.outlook.com (10.152.74.182) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:35 +0000 Received: from [149.199.38.66] (port=47738 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUna-0002Qp-QG; Tue, 12 May 2020 06:18:18 -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 1jYUnr-0005Zw-1Y; Tue, 12 May 2020 06:18:35 -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 04CDIYv7028685; Tue, 12 May 2020 06:18:34 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnp-0005Yh-Oe; Tue, 12 May 2020 06:18:33 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id C785613C0168; Tue, 12 May 2020 18:40:30 +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 v4 11/12] net: cadence_gem: TX_LAST bit should be set by guest Date: Tue, 12 May 2020 18:40:06 +0530 Message-Id: <1589289007-23629-12-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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:(39860400002)(346002)(376002)(136003)(396003)(46966005)(33430700001)(81166007)(26005)(6266002)(33440700001)(4326008)(2906002)(186003)(6666004)(478600001)(2616005)(110136005)(42186006)(8676002)(426003)(47076004)(316002)(5660300002)(356005)(8936002)(70206006)(82740400003)(36756003)(82310400002)(70586007)(336012); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ea89f56-5ce1-4e1b-6c66-08d7f676f9ca X-MS-TrafficTypeDiagnostic: MW2PR02MB3692: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:255; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4wW7piYRJKerenFDPuNYBXCNGXUsfUygD3jteIZyUzhsL794x+EdifHxwa/YMmjgxLQuS+iKuxifKObd1fDgTdm6kIyJ3Ez8GitfKcv5z4K3iTCK0pE887cSCSZwoKHon7XvQmxiRx8BYrfBBtUGqVQcHwmJqAQo0+FLNOly4u0ZKGRRwloodG1EaaL3bbKvKtjN1oe2UTRFrCfmKyq51dAQLKkUqjox0diek7Bkaf2D6NQXSAnmCDOeW8h2ZeKNI0oovwJWc9SAut29YSYqSRJe6eMIm3GvKLzkDnM7E8UapQlfgSEOKxCCOB8KSTyL9NI7q/d1+cKB5QtKheTRoYqQzN7SZ4IonbiFn3Dqz6x3xd9zQR8SbDvWtUtxamPykd9KPmCxnk2jCj5qvq/hvNBGHolxDGlvnzBH1169drcmW97jrsugejlt48r3wioFFVTdivT8F6HaYArqN+LzhaMU2ZvKLTLLJJjy2ZHoGvwxStkWzamqPCilh/3FiNX+zTez6AwISnJaUABsWRdl9orRPo7W3hm73oOfRiqL1LGQ8UielGoDFehVGaZj8+X3lOf3AWxc6/vdkUWHSPC4rA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:35.3441 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ea89f56-5ce1-4e1b-6c66-08d7f676f9ca 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: MW2PR02MB3692 Received-SPF: pass client-ip=40.107.243.72; envelope-from=saipava@xilinx.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 09:18:37 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-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 1b2e31d..00fe5d7 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -350,11 +350,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; @@ -1293,7 +1288,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 Tue May 12 13:10: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: 11543223 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 61A3F139F for ; Tue, 12 May 2020 13:28:18 +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 35DBA20752 for ; Tue, 12 May 2020 13:28:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="tTnhXeI8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35DBA20752 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]:49076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYUxF-0005Fu-BS for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 May 2020 09:28:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYUnz-0007fr-Ig; Tue, 12 May 2020 09:18:43 -0400 Received: from mail-dm6nam11on2044.outbound.protection.outlook.com ([40.107.223.44]:34913 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 1jYUny-00022K-AU; Tue, 12 May 2020 09:18:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NhgrlmBnEFJ/7jSWshCucHQogQavYSLyQ7pMbOpTLdDsFNOnJtzOsYwFyzExFbyAogS3492hbCCjJvr2qse2hz9Th792BmtvFYXvRijLu7nCn7zJRs/XOnYzksco8ETFYg/a2KNR+P1z33yk3+QB1+dXeOMO51+0XmRBcY3r0AgrkOWNz5nQE+YCkYshcsBd6UWNKT85YTg0g2LK9FGEjEBnzpJrL3T8ypwaKJGXuiLLYM1VXkcEcmnfa4mWqWH/WugQpT229g4k4j+GliDBSS5rL7PNF0u8FvB322Fkh8yc8IjRHONbWCGyHrFb3tK0pmnrKraqms5RWUjgkdR6TA== 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=grgNXVOzkjl0aS2jc5ism/z0QVBi8SQ5OEXBYFA6Hk4=; b=AZY0ggkWC9A/tCagHdSrK+WENNpjWPk9uxWS1wsI3v/e8Q3JgHWp+hNvDRM9gzPxivCzj/YioOJEmfZ18sK3XJFyQahKmdk53os5DsYYLH64aRfRLc6okOseH3Kqyoc883H1B7Z+/MvNe5CPzgvHN0Bjqv4NhEknvGXaFjx+xRiQP/5PQhtjbihnK7PKQh/3TS7DgESJHIAQotTezAcwZtigSzt2FY29msRehhqMaJRAblCGjMDweriWqSCCsnHo1dZOPX0j21nu3GfK0ocEy8JmShMj+mC7mckk0xdBEgjBKyKBfs6inoiC692E+C+ol7TBC6zHTaWR+hg0zjzbLw== 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=grgNXVOzkjl0aS2jc5ism/z0QVBi8SQ5OEXBYFA6Hk4=; b=tTnhXeI86/OK/kP2QWT53s+2+9eP+0paQlx5GcaF2+2Yl6cw+Byvz5rT/QZAEbgnGmsJvjgE0tG8Ju7jO5APZjNsczDv1Fn8dB3jZrL3NyK/55xflo3TdcXJ42EpAjE1ogVxiXR95RlGoIL9B1tJlPH2b1zzzr86N0FQqJVHyZM= Received: from SN6PR2101CA0007.namprd21.prod.outlook.com (2603:10b6:805:106::17) by BYAPR02MB3989.namprd02.prod.outlook.com (2603:10b6:a02:f1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.35; Tue, 12 May 2020 13:18:38 +0000 Received: from SN1NAM02FT004.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::f6) by SN6PR2101CA0007.outlook.office365.com (2603:10b6:805:106::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Tue, 12 May 2020 13:18:38 +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 SN1NAM02FT004.mail.protection.outlook.com (10.152.72.175) with Microsoft SMTP Server id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 13:18:36 +0000 Received: from [149.199.38.66] (port=47747 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jYUnc-0002Qt-6E; Tue, 12 May 2020 06:18:20 -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 1jYUns-0005a7-Dg; Tue, 12 May 2020 06:18:36 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 04CDIZML016858; Tue, 12 May 2020 06:18:35 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jYUnr-0005Zv-0J; Tue, 12 May 2020 06:18:35 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id A0DBA13C0168; Tue, 12 May 2020 18:40:31 +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 v4 12/12] net: cadence_gem: Fix RX address filtering Date: Tue, 12 May 2020 18:40:07 +0530 Message-Id: <1589289007-23629-13-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589289007-23629-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1589289007-23629-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)(39860400002)(396003)(376002)(346002)(46966005)(33430700001)(110136005)(82740400003)(26005)(426003)(81166007)(70586007)(70206006)(36756003)(356005)(186003)(8676002)(336012)(33440700001)(2616005)(6666004)(2906002)(8936002)(478600001)(82310400002)(5660300002)(6266002)(42186006)(316002)(47076004)(4326008); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2b5dcda-6bc4-42d5-1b76-08d7f676faa1 X-MS-TrafficTypeDiagnostic: BYAPR02MB3989: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:236; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mrra3HYY262zXvD+1OnKyTS47TN0jD7WJNEZE+HLKPv9IeTYxBqD3ygJ72Sf7Fus2PReceshxMF1KfNWEnU0sHFq+T2yB+aUM0MwRGPIm5eUWV3x6EgoWhS/3F5bbmL0Fo+pll2W07noLm6rjiCvf+Mr7NXIpfF3eJSjEUfmf2bDat3Tn7NUor7tmziYXuhpGJ2L7BQVF3kxDBB8HLBCbnZ2WKmY+2aMNVXvruSjdH0WaAqfrNEOXkRQNR0q+q/Mv9bEnmpnUxMXlHR+nIjoi3GzqSy+Sj26tWk7gV4vZ+J/rqCJLuuZPjKhNRYYns7GRLlL6DcE36Whlj0fP+sIRbbKJgxX9HO2J47R/ikukjChQjc8Zq/ByWDohcMTft7f0CzgBvcckdbg6yxn6DsFLJ2n5A7TUwDJy9kfj/+l6YcFz6J/K9nBvHbX0PTvebJ5/XJ6jggF4WqvdzVsQkm739uy4hUvftqPU7F08zU4ZqK+Yv+HMLPrlkzV7IgOE70XNu7qlUjpsbPjPZ1SFBagFeitgwbMR6kFIyzTHp/gXHBjNmb1lmykmicdlBZWYuB2ly3kN24GOO5lhhGg6FKPKg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 13:18:36.7500 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2b5dcda-6bc4-42d5-1b76-08d7f676faa1 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: BYAPR02MB3989 Received-SPF: pass client-ip=40.107.223.44; 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/12 09:18:40 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 Reviewed-by: Edgar E. Iglesias --- 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 00fe5d7..e911859 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 {\ @@ -697,7 +698,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) { @@ -713,22 +714,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; } } @@ -953,7 +949,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 ? */