From patchwork Mon May 4 14:05: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: 11526269 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 28F8C92A for ; Mon, 4 May 2020 14:15:16 +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 F1CA620721 for ; Mon, 4 May 2020 14:15:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="a0XbfN8R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1CA620721 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]:57220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbsJ-0000Lj-0U for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:15:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrL-00070M-Rg; Mon, 04 May 2020 10:14:15 -0400 Received: from mail-eopbgr680042.outbound.protection.outlook.com ([40.107.68.42]:25978 helo=NAM04-BN3-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 1jVbrJ-0005VP-D4; Mon, 04 May 2020 10:14:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ayCxXjNgrIR3lugml+Rn/fU3IkpRCNYRtHHWtLgdPBlVaE37pqtoUgbG5gPsvi8lMz0YP7caNDGJl0FRCtXvVg34uaJ66P8ws+LQOR8g/Z5LiYdiMKiUEK8gRsZvfvNvBay8UDcW79W0kxX6AGul027oYdQWJ+4Hwo3MPV5DkwT+/oJePeV4ZDjlAhaItw3N+4F63nVAy37p4tAqagLLjYotII1Pxz9UR+JUksM+v13uzIG+cJEjdDTIrf+odNB9XwXurF0DUdqAIyB05RxGm/B+dJwBVy0V2dGW+rAaGkHZTg2xi59918X2EWSeiFfJHV2rlJ7Mf46DRnTyAoiuSw== 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=KhxeHJpUlpQ1L4o3LaqYsZmLi/2REIgJCY51CXmjyrE=; b=lyvOHOpdetK21KbQ12BADi+y7tfOgHvne472ZOnHL8TPIfifJnstdv+r/nMz6UA3Sdj9KGyxWzHqWJ8LzR+CPaULP7+G/Q+ySvW9hn52h4zJS7/VfebTmqvf9y9bvzq/YNPfnEtpOiSWZdfxzjMQbikSAg6rXXGhoipFShTYl8dFRBFlVpH3GuEI/U9Uyi3xMabu+Obk3IyNg3KRWqD2Vim9ejaKpeC5ByMcvKyNJ50D1jdCxwegYRQHU9CUx6jDyCb/LPHTsdM73BlR33BBOBcHM3pNBsuXfjznyeofeuHqs/mMHEbBHgGH6robEp2iOkCuNaoI/i0C2Rxia891xQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=KhxeHJpUlpQ1L4o3LaqYsZmLi/2REIgJCY51CXmjyrE=; b=a0XbfN8RjKBWieV8EPT9tx5dpUr2A2/oR1X2A/TZf6ZmJjY9zQx2Jo1Vi4GpzjbRGPqXyXyAXpRRnxkX8aqhIFdZjO4ZVL0U9uEi7h4HyFg77850OCDUMvSgYLXC25mBKuSpwJcqn1BP8alGX3U2FHLxUstsbPYbIsF/kDYhETA= Received: from CY4PR06CA0025.namprd06.prod.outlook.com (2603:10b6:903:77::11) by BYAPR02MB5592.namprd02.prod.outlook.com (2603:10b6:a03:9b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Mon, 4 May 2020 14:14:10 +0000 Received: from CY1NAM02FT007.eop-nam02.prod.protection.outlook.com (2603:10b6:903:77:cafe::f5) by CY4PR06CA0025.outlook.office365.com (2603:10b6:903:77::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 14:14:10 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 CY1NAM02FT007.mail.protection.outlook.com (10.152.75.5) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:09 +0000 Received: from [149.199.38.66] (port=42912 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbr9-0000GP-Kq; Mon, 04 May 2020 07:14:03 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrF-0000vG-8n; Mon, 04 May 2020 07:14:09 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrE-0000v6-MP; Mon, 04 May 2020 07:14:08 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 68CC013C2E73; Mon, 4 May 2020 19:36: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 v2 01/10] net: cadence_gem: Fix debug statements Date: Mon, 4 May 2020 19:35:59 +0530 Message-Id: <1588601168-27576-2-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(42186006)(110136005)(2616005)(498600001)(186003)(8676002)(4326008)(6666004)(426003)(81166007)(336012)(82310400002)(8936002)(47076004)(26005)(5660300002)(356005)(36756003)(70206006)(2906002)(70586007)(6266002); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e06332ce-8dbc-4c05-1403-08d7f03569dc X-MS-TrafficTypeDiagnostic: BYAPR02MB5592: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:127; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5ic7zmkpkOa6og7w6vjiyvofNp3TPxuAxo5rZ5S7Me+Ox+ifZWWojqEXpqFO4XRy4wM1KOoBfgQ9V1T+cX67ev1pfLEKHkySxdgt0rQCFR5jaymbTvEYV+tH+ORWhXGFRPwwuCAuoARnXrnHUv/v8N5jciyq0EXmaBYymtycjOynz12qejhNNfaIsqUrOd6L2YtolpxZZnMZ7xujLRsESBDjRS3+m/OYyufFA/PvihjSG1GHHq7KXEg7RpG9E5IKHdtHT3VUqsYnRlMUNW/wtsaG9OY887+bdCLdIUvXSHJH/9JbyuvsrNPqmbZRu+TSWi4Illy4o7Xronm5BBMZlSvxBQ3o9RqEw32T9WN0CpFNV0/JdkkZEo//rNGBUYDMH/5BHlcAy8U+H4iQz6kLsFrkzb3ssrhtGYsgV97BT1Imt0/jtS8fMfiloR1up/HPuLWoxhpiLJkI+xG9GYu2WVKAzUGkIeB9EOgklWQXk+C5YWbMAQyA96mP0kOQcmFHpXrPh7Ns2iDab6H7FyWHBg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:09.5818 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e06332ce-8dbc-4c05-1403-08d7f03569dc 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: BYAPR02MB5592 Received-SPF: pass client-ip=40.107.68.42; envelope-from=saipava@xilinx.com; helo=NAM04-BN3-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 10:14:11 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" 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 --- hw/net/cadence_gem.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 22a0b1b..2f244eb 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,8 @@ 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: %" PRIu64 " packet size: %" PRIu64 "\n", + (uint64_t) rxbufsize, (uint64_t) size); /* Find which queue we are targeting */ q = get_queue_from_screen(s, rxbuf_ptr, rxbufsize); @@ -992,9 +992,9 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) return -1; } - DB_PRINT("copy %u bytes to 0x%" PRIx64 "\n", - MIN(bytes_to_copy, rxbufsize), - rx_desc_get_buffer(s, s->rx_desc[q])); + DB_PRINT("copy %" PRIu32 " bytes to 0x%" PRIx64 "\n", + MIN(bytes_to_copy, rxbufsize), + rx_desc_get_buffer(s, s->rx_desc[q] + rxbuf_offset)); /* Copy packet data to emulated DMA buffer */ address_space_write(&s->dma_as, rx_desc_get_buffer(s, s->rx_desc[q]) + @@ -1160,8 +1160,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 Mon May 4 14:06: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: 11526267 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 98A4E92A for ; Mon, 4 May 2020 14:15:03 +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 6C88220721 for ; Mon, 4 May 2020 14:15:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="cXitUW03" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C88220721 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]:56932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbs6-0000Dq-GV for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:15:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrL-00070O-VP; Mon, 04 May 2020 10:14:15 -0400 Received: from mail-bn8nam11on2047.outbound.protection.outlook.com ([40.107.236.47]:21953 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 1jVbrK-0005Ya-LL; Mon, 04 May 2020 10:14:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xo860cErilOO9mYZMDu9B0k5Br+Tniac4WpPdXCM4V+V+uZunjCdESpF7T7ACSRWxwXU+JvyCgqe9zdZ0gHlFYSy3F0+Hw1S5i2y5WBh8TFvoZcXqucbgjyy//JkbdEueNou/C2iOlOBuwlNkkayCTEt5hmiYzQ/zXSoRkJmr6fPPdkpLgkSJKYJLOQT1e4BPVmzqYX3FL4drQsiMSz7vPR1MM66wi3ZumPLdRvKF7SEs017MzOONjA28nhncEKM+r5qK4leX8bUZ2F2KBdZ7t3zNt6zDoYjS2kzXosJ/DbGB8RDTxYITjLe1XiFovvNBGWbaVh0avyWwu95P/EBLg== 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=5vIlQ64Qy3AwLV3W8Jl4OO97FOoWaouspVZ8rsKCRrI=; b=d2LVInw5i4ToxkCooBt/I5uuiLZvyDwouqJsyC0CGJoj/QwBeTmAEc5YOX0802VHqNq1mnDFrvmnsTMav03+mExZFXIyP1IQZ7djQqJ/nHmMDhexZypucCnrZ9gtUDT5RCDnH/yPxODdW0RjLDbstIp9f1zdGkyDIjpx1UCRMREW7ELHtbnwLq+yMJ5v1I5e+nE62St2cY7uTPCtpCgXMCx8eiMwaNMBb3hdYAHYuOWL+TYvhPGApNH9wQeE1Iem2QCAxJEXSYxfFKMymYqfNjMa9Nf14GghULjkAieH07MFaaNzeocst2QL0Yu12qsexKEKwYuDWW4E9Vu+cxj8HQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=5vIlQ64Qy3AwLV3W8Jl4OO97FOoWaouspVZ8rsKCRrI=; b=cXitUW038Sflra7xi4wG2GeoT2HNUIPIJ/Vb0g2E86d29ZCk5BmSiE/fHxntgfD9TuutbCHBmC61+hxJV4sSSdgrWzzL/EsOnbLWW59VNmURPov4hKx32OXRhtJQUppIyYFMfub4HZHo/ItBfGFzI8h/2VnQ7oVNdKh1lVg5oN8= Received: from DM5PR11CA0007.namprd11.prod.outlook.com (2603:10b6:3:115::17) by BYAPR02MB5638.namprd02.prod.outlook.com (2603:10b6:a03:9f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Mon, 4 May 2020 14:14:11 +0000 Received: from CY1NAM02FT037.eop-nam02.prod.protection.outlook.com (2603:10b6:3:115:cafe::c7) by DM5PR11CA0007.outlook.office365.com (2603:10b6:3:115::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 14:14:11 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 CY1NAM02FT037.mail.protection.outlook.com (10.152.75.77) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:10 +0000 Received: from [149.199.38.66] (port=42931 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrA-0000GW-O8; Mon, 04 May 2020 07:14:04 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrG-0000vT-Cs; Mon, 04 May 2020 07:14:10 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrF-0000vK-RI; Mon, 04 May 2020 07:14:10 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 8B9B913C2E73; Mon, 4 May 2020 19:36: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 v2 02/10] net: cadence_gem: Fix the queue address update during wrap around Date: Mon, 4 May 2020 19:36:00 +0530 Message-Id: <1588601168-27576-3-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(426003)(47076004)(336012)(498600001)(110136005)(2616005)(42186006)(6666004)(26005)(186003)(36756003)(5660300002)(6266002)(4326008)(8676002)(8936002)(81166007)(70206006)(2906002)(356005)(82310400002)(70586007); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0626f3a-4ca5-4616-6894-08d7f0356a84 X-MS-TrafficTypeDiagnostic: BYAPR02MB5638: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:483; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YAtZd3r3ozq6PjLR+vKoMfRXHL87g2CJF7j6KtHTeogXH8eJBgVbNTe6Xp8RxZ1ywGVKk0u6lGrzn0XpTlX4YLjry8qnGnwPwJ0JcFHGn6Mdw/R4FO2BhMkV/4fBtshm6/B+yRsqzxpGD+v1huQc9ldEYQLYtIG8gtiNdi/+FvZ3RXw7tKoTRItpWmReiZbbljkGWuaVn8rcZBcwy7PYmzIiu747Z6AaHXqAiDUBY6zMOZLOYAzD7TW97+KAJnhSGKneaOcGlyarMrHT/1i7xVeRamWubiMk3NUseSP5SWrhftnX19uGNwzaSQmW513ICzSrf7CYpVk9n8slM4iELefMqkke6AfSdfAHpN5fN88hOmUiWyYTgdbtFEpng4s4iOi7AcHh6Mghu8hv06UyQ6qLB2zkpNJw06PYCLG6or3MPdKUhp311cuiKWV04zpXR60slv2RrEL7rV6s/vFH40dV6a9fOfLth62QZ7wjKMFRyzErIWQZfbxaXoF6DcOKxQr1+lOErNBVkP6JBcNpWg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:10.6890 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0626f3a-4ca5-4616-6894-08d7f0356a84 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: BYAPR02MB5638 Received-SPF: pass client-ip=40.107.236.47; 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/04 10:14:13 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" 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 | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 2f244eb..6cb2f64 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -845,6 +845,25 @@ static int get_queue_from_screen(CadenceGEMState *s, uint8_t *rxbuf_ptr, return 0; } +static uint32_t gem_get_queue_base_addr(CadenceGEMState *s, bool tx, int q) +{ + uint32_t base_addr = 0; + + switch (q) { + case 0: + base_addr = s->regs[tx ? GEM_TXQBASE : GEM_RXQBASE]; + break; + case 1 ... (MAX_PRIORITY_QUEUES - 1): + base_addr = s->regs[(tx ? GEM_TRANSMIT_Q1_PTR : + GEM_RECEIVE_Q1_PTR) + q - 1]; + break; + default: + g_assert_not_reached(); + }; + + return base_addr; +} + static hwaddr gem_get_desc_addr(CadenceGEMState *s, bool tx, int q) { hwaddr desc_addr = 0; @@ -1044,7 +1063,7 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) /* Next descriptor */ if (rx_desc_get_wrap(s->rx_desc[q])) { DB_PRINT("wrapping RX descriptor list\n"); - s->rx_desc_addr[q] = s->regs[GEM_RXQBASE]; + s->rx_desc_addr[q] = gem_get_queue_base_addr(s, false, q); } else { DB_PRINT("incrementing RX descriptor list\n"); s->rx_desc_addr[q] += 4 * gem_get_desc_len(s, true); @@ -1200,7 +1219,8 @@ static void gem_transmit(CadenceGEMState *s) sizeof(desc_first)); /* Advance the hardware current descriptor past this packet */ if (tx_desc_get_wrap(desc)) { - s->tx_desc_addr[q] = s->regs[GEM_TXQBASE]; + s->tx_desc_addr[q] = gem_get_queue_base_addr(s, + true, q); } else { s->tx_desc_addr[q] = packet_desc_addr + 4 * gem_get_desc_len(s, false); @@ -1252,7 +1272,8 @@ static void gem_transmit(CadenceGEMState *s) } else { packet_desc_addr = 0; } - packet_desc_addr |= s->regs[GEM_TXQBASE]; + packet_desc_addr |= gem_get_queue_base_addr(s, + true, q); } else { packet_desc_addr += 4 * gem_get_desc_len(s, false); } @@ -1458,7 +1479,7 @@ static void gem_write(void *opaque, hwaddr offset, uint64_t val, if (!(val & GEM_NWCTRL_TXENA)) { /* Reset to start of Q when transmit disabled. */ for (i = 0; i < s->num_priority_queues; i++) { - s->tx_desc_addr[i] = s->regs[GEM_TXQBASE]; + s->tx_desc_addr[i] = gem_get_queue_base_addr(s, true, i); } } if (gem_can_receive(qemu_get_queue(s->nic))) { From patchwork Mon May 4 14:06: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: 11526275 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 7600E139A for ; Mon, 4 May 2020 14:15:33 +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 4B8F520721 for ; Mon, 4 May 2020 14:15:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="bVal49ru" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B8F520721 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]:58134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbsa-0000qj-D2 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:15:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrN-00071c-RM; Mon, 04 May 2020 10:14:17 -0400 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:21177 helo=NAM10-BN7-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 1jVbrM-0005ZF-Hi; Mon, 04 May 2020 10:14:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z4R5LQIQkdZAo4ufqhaQU4S7GBGjvDS58KS3TCg9KyQaFUxhs1k+Tja8ZkjTZuRMWtpJUC7o8ncWbBrHq6uj9qFO9u6UhELA+4BY1xtl1IgynEPmWB7kPSM4/XOeqQFp8A0/Gk7BaXYT2Rn/0pAD8dg6jeolYIIaGv+S9o8xcmD59aINy2fRgjoxtopIziRVYMhbTKTVaihE+FXlJ1xNvf90YoU/H6/UyIw9UBsXTue3UB2hO0OfBlIq7Kr737DphB/4x+yU4yIfKDFey1/2Tg/OW4Uu50eg1ECUGOp0lH5mCwK/3E+6SEZt/5lFTuz5EauBYuVcshkLHsYrmugQBw== 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=gNypU1hmvTA3ufvj5CT0uiTWGobo8vak4WTs0wpZ9rg=; b=QNnSQ3XhHFdGBK+AZJDeja1x6MPUo13bXR9d6gyHkOm5J06ybU8fSQ7Xe2DVMoqXXOxoui41P1S9qXzVavpDH9SYL3uJNXRnnyMEYVTyzKraC3bDK43oQmBXUHP7uQ5arZcQj7j7T3DNpKMVILYkGgkTtZLOagYwydi7j14DiT55a1MDgx6EUxusKj5MFh5HD7mImXaM0GLyF5X0xMI8IebRyi28U/t0UwWiG7JinDzm7hWXOL9VQvGbVDuKwGy0YWEqV5w9N02hJzeBkvdmxYVixYkhMc1e4ZaUfqhWxTgdrVcgyWQWxpY2PjIlfhLfU5UxnuOccU9U7tJUbdTtYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=gNypU1hmvTA3ufvj5CT0uiTWGobo8vak4WTs0wpZ9rg=; b=bVal49ruD+wC079+eIqDygrAFSwLt4qxxvtzi8XWgfeO+LQREF0Nb5Z2EuMwS1tvJTLprKZx+MU22xMs9pSC5oNFBFkCBh7MpVtiCXv0T3yEehoZyYtr5ZTzJKotZi5tNlAC8L1UYyQOTSViVhe4rywSbRmbS0QwN7vvavsHkOk= Received: from CY1PR07CA0005.namprd07.prod.outlook.com (2a01:111:e400:c60a::15) by MN2PR02MB6766.namprd02.prod.outlook.com (2603:10b6:208:1dc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Mon, 4 May 2020 14:14:13 +0000 Received: from CY1NAM02FT027.eop-nam02.prod.protection.outlook.com (2a01:111:e400:c60a:cafe::d0) by CY1PR07CA0005.outlook.office365.com (2a01:111:e400:c60a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 14:14:13 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 CY1NAM02FT027.mail.protection.outlook.com (10.152.75.159) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:12 +0000 Received: from [149.199.38.66] (port=42972 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrD-0000Gb-1T; Mon, 04 May 2020 07:14:07 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrI-0000vr-Lv; Mon, 04 May 2020 07:14:12 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrI-0000vi-4Q; Mon, 04 May 2020 07:14:12 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id D26F513C2E73; Mon, 4 May 2020 19:36: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 v2 03/10] net: cadence_gem: Fix irq update w.r.t queue Date: Mon, 4 May 2020 19:36:01 +0530 Message-Id: <1588601168-27576-4-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(4326008)(36756003)(336012)(498600001)(70586007)(42186006)(70206006)(426003)(5660300002)(186003)(110136005)(8676002)(8936002)(81166007)(26005)(6266002)(2906002)(82310400002)(6666004)(47076004)(2616005)(356005)(309714004); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0391a052-4ce2-4d93-65ca-08d7f0356bdf X-MS-TrafficTypeDiagnostic: MN2PR02MB6766: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:514; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cQnmclnSlggDdh7YsVSr+T2H6LPWSrVKVK8bf+hu3Zzz3XMtrjByqjkXSF8Gc/QmEOCdZ8UdJd7oS7tP1kRXIYYrXHqW4sYjNi6mj6fo+rLKPpA8nVSAYgVrrTMMEKzb723OKOTxclSMaku0AHN1x/ywJkYvnecmSo1MDSQpJnS/FRsu4jnYEPmskRi7hO7RIx299ivZR710inrpaygfRJF6RNZ6OLbcz4MF8Dfxa71on6zN5kEHBX2WEgJcKPsCQv9rxAy9vEtQdCHvagtEUXuDMakS5Nlbi9ReKdCAMenEzRvbT+LKK7FSC5xM2ihhRJErVUhEtoZCS+gakmIbCdh1fRaK9aFC2xD9ZWnY5rrsznHkf6AdoTeZce/gGWPtvvuBRlzcm4d95mO1x4iCsJL4owJqNtBMRZrNg3Q9TsJwHqvw58S7FMjV6qs921ZMl0w10eknS64btsxk/mpt+E4veceb5rwA4my447qVdRTl46J8K0kjazZXX2KysQr5lptdIRhn0NnNETw+vesV2SNBdEkAsRhBlLsbuOF3oD0= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:12.9810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0391a052-4ce2-4d93-65ca-08d7f0356bdf 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: MN2PR02MB6766 Received-SPF: pass client-ip=40.107.92.64; envelope-from=saipava@xilinx.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 10:14:15 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 6cb2f64..a930bf1 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 Mon May 4 14:06: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: 11526283 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 C10BA92A for ; Mon, 4 May 2020 14:17:42 +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 9640A20721 for ; Mon, 4 May 2020 14:17:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="lSKLuxYV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9640A20721 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]:38572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbuf-0004Qf-Ok for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:17:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrO-00072G-2j; Mon, 04 May 2020 10:14:18 -0400 Received: from mail-dm6nam11on2081.outbound.protection.outlook.com ([40.107.223.81]:7004 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 1jVbrN-0005Zx-4J; Mon, 04 May 2020 10:14:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KsimN+X6r4alWi9R+4sdR9IuVBs5hh3LhpIt8JNhlNQ0qd//S/9sbxFRYfWiC5fMwEeNx+dIr+/nREpjjAuDvEgKiByCEKrNFaT24M9VzomSqtpvoXR2Rht0TmSQiaH1ys3KvvVhtmbxcuYSJNMCeCcShrGcmiydRLpRUFOByeXvfU0IQSzu8g3ipGjYR1VDu+ekXU9whZwYOltmlqeWV5Fozc92CyNQSBJn8G4AIRkh4RBawteQB3l/ZZhreybKwMdRtoe2RqKrdEDcanqGq5ZWuTF25wr0hkCO92FtccODljiUf3kim/E5fwjZoASvHeL6MIHRflRVqhG3ozQkuw== 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=wAuDjr+zIBOLa810TTj8jaKa1T8kU+Kf4Se1Tq8SOdU=; b=lannz9DcMJ3cvtY3wPAxIV/YwzQQjN8LY9kRB6XHOxcstg7zur2CYr1lpbFu+TKeostqE1Uj3KGpToH6+vCelN9PmGosw2J/ZqNQBErkZCqZtM+cgr+JWi1uiXb56RWplTvhLgG4/pL0zit5lldN2kVw1H0xFWFrob7I8d4mrPkHYoUsU5B2CGBTGgIJRoVna95LJv9J+SNpa2ZJPr5F+hkAFLG/J1KU5bIHhoIn5HoIJDYAOd1v+E/JD0JVE1vr7GfLMUS8TPQKAmPBV1hC7fs44HEPhATlCOiAAl6WmRs+0Gyizj5qPIXsd1z1P/F/sIcKaSI6cx5FcAR8idB1aA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=wAuDjr+zIBOLa810TTj8jaKa1T8kU+Kf4Se1Tq8SOdU=; b=lSKLuxYVrpr9ROBnQR/HawVILkQtubqBgss6DFjTQPodj+DgVixTcrvP0cvwjxFH99Af6uACQRIanj9Ma27d+mhvHd/hE3NUME1JB2io2TinjGfBuUijq2O65/2xP55zP7WjgIDbk/021d3MKk6+iYnPbmPm5p/uMeFGX5cjNh8= Received: from SN4PR0801CA0001.namprd08.prod.outlook.com (2603:10b6:803:29::11) by SN6PR02MB5039.namprd02.prod.outlook.com (2603:10b6:805:70::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Mon, 4 May 2020 14:14:14 +0000 Received: from SN1NAM02FT059.eop-nam02.prod.protection.outlook.com (2603:10b6:803:29:cafe::37) by SN4PR0801CA0001.outlook.office365.com (2603:10b6:803:29::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Mon, 4 May 2020 14:14:14 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT059.mail.protection.outlook.com (10.152.72.177) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:14 +0000 Received: from [149.199.38.66] (port=42997 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrE-0000Gf-35; Mon, 04 May 2020 07:14:08 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrJ-0000w5-Nm; Mon, 04 May 2020 07:14:13 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrJ-0000vt-2C; Mon, 04 May 2020 07:14:13 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id C273713C304C; Mon, 4 May 2020 19:36: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 v2 04/10] net: cadence_gem: Define access permission for interrupt registers Date: Mon, 4 May 2020 19:36:02 +0530 Message-Id: <1588601168-27576-5-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(8676002)(8936002)(6266002)(4326008)(356005)(70206006)(2906002)(81166007)(82310400002)(70586007)(42186006)(110136005)(47076004)(426003)(336012)(498600001)(2616005)(186003)(36756003)(26005)(5660300002)(6666004); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c9eeb401-34e6-432e-f5ea-08d7f0356c88 X-MS-TrafficTypeDiagnostic: SN6PR02MB5039: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:153; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AXxTRzR+f04jAPG5PZpn/9OWofb/LlGvTIQALURn6aZSLW1ZCovfmuogS6UToObCQutne5B6hAtynTFoYe6k1vZYb8kKlHtbKfepyrs1hCFhi3f+ZQ0/ztAaZnI6dgdN3FWh1XKCcUcOxl5d6IcTuJ/J8PJcr6ZG8DsrwmXwImTlL876wawrmalykBw/rS5ykNs8qtQAjgYbYAZeJcD4jDMprSglM8rAXBkS2azmTCC/PUatEK1qjMotINGBY+V+ZM1RB28P2mLX2sUebWRzMzwc9WplW5U0hnlBAberuXB37Km+tOx6kwmuB4D+p5YqZ2dqJzBw6nyti9J3eTid06lcgPQGKjoxv6RESEFp80DpZfopgH8PELlZ60PCHcGXAyInYaBXVNn+vpcYQEN39w8u3UeQwCIi8DI51AuDCi/pY39q8k9UCTkgs+mopadknsaq1wEMldGmpr4zMqS5PEdzQPfx2RdFFey9wxHGwEElXSucXlCO0udWGpkeCU6v7Lv0Uy7RQIZpjYppZiQapw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:14.0912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9eeb401-34e6-432e-f5ea-08d7f0356c88 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: SN6PR02MB5039 Received-SPF: pass client-ip=40.107.223.81; 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/04 10:14:15 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" 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 a930bf1..c532a14 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -458,6 +458,7 @@ static const uint8_t broadcast_addr[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; */ static void gem_init_register_masks(CadenceGEMState *s) { + unsigned int i; /* Mask of register bits which are read only */ memset(&s->regs_ro[0], 0, sizeof(s->regs_ro)); s->regs_ro[GEM_NWCTRL] = 0xFFF80000; @@ -470,10 +471,19 @@ static void gem_init_register_masks(CadenceGEMState *s) s->regs_ro[GEM_ISR] = 0xFFFFFFFF; s->regs_ro[GEM_IMR] = 0xFFFFFFFF; s->regs_ro[GEM_MODID] = 0xFFFFFFFF; + for (i = 0; i < s->num_priority_queues; i++) { + s->regs_ro[GEM_INT_Q1_STATUS + i] = 0xFFFFFFFF; + s->regs_ro[GEM_INT_Q1_ENABLE + i] = 0xFFFFE319; + s->regs_ro[GEM_INT_Q1_DISABLE + i] = 0xFFFFE319; + s->regs_ro[GEM_INT_Q1_MASK + i] = 0xFFFFFFFF; + } /* Mask of register bits which are clear on read */ memset(&s->regs_rtc[0], 0, sizeof(s->regs_rtc)); s->regs_rtc[GEM_ISR] = 0xFFFFFFFF; + for (i = 0; i < s->num_priority_queues; i++) { + s->regs_rtc[GEM_INT_Q1_STATUS + i] = 0x00000CE6; + } /* Mask of register bits which are write 1 to clear */ memset(&s->regs_w1c[0], 0, sizeof(s->regs_w1c)); @@ -485,6 +495,10 @@ static void gem_init_register_masks(CadenceGEMState *s) s->regs_wo[GEM_NWCTRL] = 0x00073E60; s->regs_wo[GEM_IER] = 0x07FFFFFF; s->regs_wo[GEM_IDR] = 0x07FFFFFF; + for (i = 0; i < s->num_priority_queues; i++) { + s->regs_wo[GEM_INT_Q1_ENABLE + i] = 0x00000CE6; + s->regs_wo[GEM_INT_Q1_DISABLE + i] = 0x00000CE6; + } } /* From patchwork Mon May 4 14:06: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: 11526285 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 A81F692A for ; Mon, 4 May 2020 14:17:55 +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 7CF9A20721 for ; Mon, 4 May 2020 14:17:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="B1+dYnql" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CF9A20721 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]:38870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbus-0004Yk-Jf for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:17:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrQ-000791-Pq; Mon, 04 May 2020 10:14:20 -0400 Received: from mail-bn8nam12on2051.outbound.protection.outlook.com ([40.107.237.51]:6173 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 1jVbrP-0005dC-QF; Mon, 04 May 2020 10:14:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=avNvRfiLh/A9JahMFMqVdlyXwW5vt6CaLBYOMD5PcEz6Ciiw7S7LZDesE7kreEq6aMVecT/LMZJxGeCyD41m+Cg1ByW4f5a48zTJRr2M8Jsr8xvysEUbXaIvZlbTzYt9c1apK30QTHvKerBmOhxWnsR0cZ0/jyqUexx+H2tskimWbXbVeSNZzsOjNgBhOeQHRoyRAYarqWBkbrL1m9WKAT5lVa3dvL/R3dKtDy7BUSHl3LdsEvTIu5dL6mMyPpDANLod3+OTt8PbMwCP4dmyvwwhNi7A5nyJYpFcm5Umc/yxCtwtxrdQhex8Dp/ONF3oepOQUuY+JlRBpgWORVUvzw== 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=/6HbE8gMqCyOai28ZLOwVOXU19t12aPfUTwPZ2g2ZC8=; b=EBw/4i7UyHmWvZIvHrQ0v23WWjhn6LugqY3mdwa2ErhAf1NTZiUZSsgk9Cb9ABAdY3DCCpMtZcabIXqm772qkeqGU3V+wRV+6wSAyYZfAdC46IDnvUBPIkiywOKmxvT9+kNhCoh8bJenrbmz8T1hjOs9hitQr4smGmQ8fT+T3zxS9BTRIWlu+xpxszYOpbaJoBIpVpvE81lxYHtEHzWdbwYTswMVW8dcS3CJmVUlFRJZkJbsgr6wKfp0HkCfS9KkM1e6wf+DFVCJfNTso1mt1J2AkV6p+z6xkDf+kZtDfXGYZyAkGSzln28VYgslzByFUsZd+6EaAb8saZqG/HALsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=/6HbE8gMqCyOai28ZLOwVOXU19t12aPfUTwPZ2g2ZC8=; b=B1+dYnql2FBfV39t9DaR2qn129SNpUnOSXhUKGWeyYjiE4nH+tqk66B+0l22/KrCCrr+Fb0FqcrTGFmgKeTFptSj7ZRwchhwuj5TXcZjc7JqM658cyzKouObQGbv7eRf4JKdyF0V/n4QDIHtgUFTdiQjGaMtDdXSflkBuikocx8= Received: from SN6PR16CA0041.namprd16.prod.outlook.com (2603:10b6:805:ca::18) by MWHPR02MB2880.namprd02.prod.outlook.com (2603:10b6:300:106::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Mon, 4 May 2020 14:14:15 +0000 Received: from SN1NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:805:ca:cafe::f3) by SN6PR16CA0041.outlook.office365.com (2603:10b6:805:ca::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 14:14:15 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:14 +0000 Received: from [149.199.38.66] (port=43016 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrE-0000Gj-SA; Mon, 04 May 2020 07:14:08 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrK-0000wK-H2; Mon, 04 May 2020 07:14:14 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrK-0000wA-2q; Mon, 04 May 2020 07:14:14 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id C5BBA13C2E73; Mon, 4 May 2020 19:36:32 +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 v2 05/10] net: cadence_gem: Set ISR according to queue in use Date: Mon, 4 May 2020 19:36:03 +0530 Message-Id: <1588601168-27576-6-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(8676002)(4326008)(82310400002)(356005)(8936002)(498600001)(336012)(110136005)(5660300002)(81166007)(426003)(2906002)(47076004)(2616005)(186003)(26005)(70586007)(70206006)(42186006)(36756003)(6266002)(6666004); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2ca8c25-fbb5-4286-04b9-08d7f0356cff X-MS-TrafficTypeDiagnostic: MWHPR02MB2880: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:220; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pxo0274jkAOFPXeNFCw17ap8MDXGfrsKZhc4m7CTrXd7LvCPT/f+fuc2dHyleTIq7GwkUefDHyqg73wNipk7c8ST/UUdRp+99pRah0m+kmgUasie0nyErXv+GJh62aMV7MM88Z0bWCIs0W9whW1nE30snX/nYnBjd1rTYpJs0LuloRLikoRC/E3Vy+R6REbHKSK+POSNmEAkV4mK4xfUoDSo2jm51DlafpaS7zSLX5dnP8GucO9cStLzFi8uiBM4upgto4uUCha/t+de6uUxDOHcqaVO+3pOGxh4fNaVMFnu0dCJ34qIjj6ekedvUzB/NHO8D07r2h2WxkuhQ8SN/DB3eh4QdfsjgvV/b4E8g+xcvDRAtpf5yrMTRP2QUgwOsFZLBJ5L/grqAOL9Ndc4c+LDuZVnV+1rV12KaVOWw2pRfwNIY4aldsqOkdhQiNKavN4B+DN4FWbOA3ykJxz1wI4gUFdmjbSrlqm8O+hZGc5RalM1UB3GX/XCg31lAtdqjU5CzcI72zfj/77n9/HLoA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:14.8659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2ca8c25-fbb5-4286-04b9-08d7f0356cff 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: MWHPR02MB2880 Received-SPF: pass client-ip=40.107.237.51; 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/04 10:14:18 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 | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index c532a14..beb38ec 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -896,7 +896,13 @@ static void gem_get_rx_desc(CadenceGEMState *s, int q) if (rx_desc_get_ownership(s->rx_desc[q]) == 1) { DB_PRINT("descriptor 0x%" HWADDR_PRIx " owned by sw.\n", desc_addr); s->regs[GEM_RXSTATUS] |= GEM_RXSTATUS_NOBUF; - s->regs[GEM_ISR] |= GEM_INT_RXUSED & ~(s->regs[GEM_IMR]); + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_RXUSED & ~(s->regs[GEM_IMR]); + } else { + s->regs[GEM_INT_Q1_STATUS + q - 1] |= GEM_INT_RXUSED & + ~(s->regs[GEM_INT_Q1_MASK + q - 1]); + } + /* Handle interrupt consequences */ gem_update_int_status(s); } @@ -1071,8 +1077,12 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) gem_receive_updatestats(s, buf, size); s->regs[GEM_RXSTATUS] |= GEM_RXSTATUS_FRMRCVD; - s->regs[GEM_ISR] |= GEM_INT_RXCMPL & ~(s->regs[GEM_IMR]); - + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_RXCMPL & ~(s->regs[GEM_IMR]); + } else { + s->regs[GEM_INT_Q1_STATUS + q - 1] |= GEM_INT_RXCMPL & + ~(s->regs[GEM_INT_Q1_MASK + q - 1]); + } /* Handle interrupt consequences */ gem_update_int_status(s); @@ -1223,12 +1233,12 @@ static void gem_transmit(CadenceGEMState *s) DB_PRINT("TX descriptor next: 0x%08x\n", s->tx_desc_addr[q]); s->regs[GEM_TXSTATUS] |= GEM_TXSTATUS_TXCMPL; - s->regs[GEM_ISR] |= GEM_INT_TXCMPL & ~(s->regs[GEM_IMR]); - + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_TXCMPL & ~(s->regs[GEM_IMR]); + } else { /* Update queue interrupt status */ - if (s->num_priority_queues > 1) { - s->regs[GEM_INT_Q1_STATUS + q] |= - GEM_INT_TXCMPL & ~(s->regs[GEM_INT_Q1_MASK + q]); + s->regs[GEM_INT_Q1_STATUS + q - 1] |= + GEM_INT_TXCMPL & ~s->regs[GEM_INT_Q1_MASK + q - 1]; } /* Handle interrupt consequences */ @@ -1280,7 +1290,10 @@ static void gem_transmit(CadenceGEMState *s) if (tx_desc_get_used(desc)) { s->regs[GEM_TXSTATUS] |= GEM_TXSTATUS_USED; - s->regs[GEM_ISR] |= GEM_INT_TXUSED & ~(s->regs[GEM_IMR]); + /* IRQ TXUSED is defined only for queue 0 */ + if (q == 0) { + s->regs[GEM_ISR] |= GEM_INT_TXUSED & ~(s->regs[GEM_IMR]); + } gem_update_int_status(s); } } From patchwork Mon May 4 14:06: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: 11526305 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 872C6139A for ; Mon, 4 May 2020 14:22:17 +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 599C020721 for ; Mon, 4 May 2020 14:22:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="f057PTeF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 599C020721 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]:53756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbz6-0002wb-HC for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:22:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrS-0007CJ-8K; Mon, 04 May 2020 10:14:22 -0400 Received: from mail-dm6nam12on2071.outbound.protection.outlook.com ([40.107.243.71]:52449 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 1jVbrP-0005dG-VD; Mon, 04 May 2020 10:14:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mL/M2EgGbG5QjYyO/6fAdHafU8YR6GxbDSWO5IUo0VmVKiMp3eU19VQcjZFSUwfLMy9h3nICAegiyyLNkAanDgaWykKOpOuVuSWyjUY4vGBduU1NtUKbG5U7N8BGNZRXkTWbRRgUNTJhakDiZ5q6vtXIsRBc34YFrADfqIG9kU5iJhIYlEDsCGTJKyreP3gwO7wYdYLdusmPDyENiJD56gF2SZhPj5XjDib1DGg7hxVE8FPp/RGsLg+RbS0KaO1rHZlxHdRyiTwxaDyVyEDzm4rGOOri30RPkmfTLNrxzeg4nOvwEPdT0EBPCIwsYgHOQy0R8JY4QY/5DfHVOis3Ow== 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=WJPoZj1jwk82kYAZvdgPn3Oj+p95NBJnd5p5MgU1IVA=; b=c5bYgecE6grcZqvggE7YeiQbwW85+ZASPpKbjwYEJX62ZE548n7Nc+AqUa2qsaDu2MK8dsidVnAUcvH57dUKZbIy6X1N+f8u8vSQcAJm3FnWIjDD+6hkXjmUF8XZnocC8bYVJ+W7L9csxoVbgbcdzC7IhVO0Oyfc7rb+fSDiiniwv9DjFFL2XtqGBNUWnHyE8FWfb7N4Ih9cfHEQFD9lEU5vJdTYCyc117SMdjkCxoHwKT8kEHnRAnOMrRdu7END2aRSQjY1JpIUcBv7C5aQhWNg8N6+B9d9P0+Rn+KMrK+EnLW9K17FOJKRZUnYvrf6sIO6DUjrh4tJdoesgQEbjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=WJPoZj1jwk82kYAZvdgPn3Oj+p95NBJnd5p5MgU1IVA=; b=f057PTeFFypCINTRO7uR03PVxtYQKE2CxD7rHKn68O/QmWcVqVsYHapU4SzmZRmKQ3cEFpO+rTwx+aBTExAcD3Q8C07YPPzpa0+kgwqXCxk0jAOTdUaam/gaDlzZJ1k9qxFDrrRlavpdJSingdEs72j1C9WTCp1hQe3ij07Xihk= Received: from SN4PR0501CA0151.namprd05.prod.outlook.com (2603:10b6:803:2c::29) by CY4PR02MB2296.namprd02.prod.outlook.com (2603:10b6:903:b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Mon, 4 May 2020 14:14:16 +0000 Received: from SN1NAM02FT052.eop-nam02.prod.protection.outlook.com (2603:10b6:803:2c:cafe::ec) by SN4PR0501CA0151.outlook.office365.com (2603:10b6:803:2c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.16 via Frontend Transport; Mon, 4 May 2020 14:14:16 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 SN1NAM02FT052.mail.protection.outlook.com (10.152.72.146) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:16 +0000 Received: from [149.199.38.66] (port=43039 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrG-0000Gn-53; Mon, 04 May 2020 07:14:10 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrL-0000wX-Pz; Mon, 04 May 2020 07:14:15 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrL-0000wO-0u; Mon, 04 May 2020 07:14:15 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id BA12613C304C; Mon, 4 May 2020 19:36:33 +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 v2 06/10] net: cadence_gem: Add support for jumbo frames Date: Mon, 4 May 2020 19:36:04 +0530 Message-Id: <1588601168-27576-7-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(186003)(6266002)(5660300002)(8936002)(4326008)(2906002)(26005)(6666004)(8676002)(70586007)(70206006)(36756003)(42186006)(110136005)(81166007)(47076004)(336012)(2616005)(356005)(426003)(82310400002)(498600001); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eebaf62c-bbbe-4bcc-69af-08d7f0356dc2 X-MS-TrafficTypeDiagnostic: CY4PR02MB2296: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:68; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 89Rfra+WyNFMuLHVRE9ateI8tVeMdg8WPPBawq2Xcu+ckEtFJQyvtLxsGhE6P21c1Ur4fis9mSkIsgqPXTNoGTCzs1LB8y2dtiRw4cH9YbpOzSbD+6iNxd4OYkXjrusvqCOpvsOB4EYaXdrGGOSquHJD8kCGTs1pQuvKz8zcEIfId5vs6xCPXpmg2Za/gguhBrHvJLpBVDAwuaq0Mq7neCiyTouetYRhK4uwAM51I8GNoJzTEMhjGCr0HfzaGxLfexfJ+qDSr7qNRVs92+DLpA/HLjfUI6BMGRnipatlHT6gBLk2mJL31R3rBIhG92jMdoUQZB3rzz6Q1PMf0RhdFKSIpmxQCA7Ob2Z2i8N6slSGCQa3XOnoJXSFDPaJKZYdWgo5yILBCv1hYgWq6+z0noAEemkaUrW8l0nEbkWPPhcSO1FpEuWQOAOPIFe0hn4szLajZCD6G58m0FpGRAaeKCF2shFfaIjmX5F9oT/X4aDANoUNfwqdlBWEkNGi4cuEB4oqCkiT3eV42sgb1UILEg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:16.1475 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eebaf62c-bbbe-4bcc-69af-08d7f0356dc2 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: CY4PR02MB2296 Received-SPF: pass client-ip=40.107.243.71; 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/04 10:14:18 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" Jumbo frames of size 10240 bytes is added. Signed-off-by: Sai Pavan Boddu --- hw/net/cadence_gem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index beb38ec..848be3f 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -313,6 +313,7 @@ #define DESC_1_RX_EOF 0x00008000 #define GEM_MODID_VALUE 0x00020118 +#define MAX_TX_FRAME_SIZE 10240 static inline uint64_t tx_desc_get_buffer(CadenceGEMState *s, uint32_t *desc) { @@ -1143,7 +1144,7 @@ static void gem_transmit(CadenceGEMState *s) { uint32_t desc[DESC_MAX_NUM_WORDS]; hwaddr packet_desc_addr; - uint8_t tx_packet[2048]; + uint8_t tx_packet[MAX_TX_FRAME_SIZE]; uint8_t *p; unsigned total_bytes; int q = 0; @@ -1344,7 +1345,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_RXPARTIALSF] = 0x000003ff; s->regs[GEM_MODID] = s->revision; s->regs[GEM_DESCONF] = 0x02500111; - s->regs[GEM_DESCONF2] = 0x2ab13fff; + s->regs[GEM_DESCONF2] = 0x2ab12800; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; From patchwork Mon May 4 14:06: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: 11526289 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 04E21139A for ; Mon, 4 May 2020 14:20:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE86520721 for ; Mon, 4 May 2020 14:20:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="F0efQ6oW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE86520721 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]:47288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbx2-000897-T9 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:20:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrR-0007BL-Oe; Mon, 04 May 2020 10:14:21 -0400 Received: from mail-eopbgr680052.outbound.protection.outlook.com ([40.107.68.52]:22918 helo=NAM04-BN3-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 1jVbrQ-0005dX-IL; Mon, 04 May 2020 10:14:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MBY8iwk/3xhpsNwpHLs2a4pv2ubm59YNFzYwLWnNcagzFTj0nbcj8gpq00UTNwghHXMPEBwsTpP41c16dKy5WUkAHVSuuDB5+MlnYkC6GH355h8JFO1J1mFQ6Ir8jpHSC4k87K2DJe6zf/BuZRa9V+9RWNfkSTdKP1AKaVBCFovkpXFRv7gz5za1eq75ya82N7qiZHWUEdOoF7ZMRkodhnAWBYXnbceLomx0qrChqAqjkUY8FjuJ8xdLYDgOVG2ZwMEqfSYZd8aeRoF0DfcD+6l14XnzzHtPeZl6e4MpnaEWs90h0+cyF7SF1gt3JntEgClM4YEe383gp+IFa+qEqg== 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=DLw9nesv8ObZmzDZcurZrBf/ki2S2Gf/YPbDnpCiXfM=; b=J0L2kI5DtdNpaas9HzyfnuPNtiYOUGa4loxyEQoW4HAsyGRbh+ZXvyU+MDCb3XAQm6FmSFbI5+sqJTqZ7+iHdmXrTV+ux4Tl8pZIsj2J+iS/JI61ENDmAV/iv9Z2B4WRnn7S8FYdZkG+w5ydKpuH0n0TL236h0ulJ4cN3KQPUH6rNAmLmjkACGdZ0c3b4bAolfQHQkw2AhFT8+mhF+UhMuNkes5DiqMA3rNyRkeFMd9lD/AOngEaVzgZP4QJVqUptYz4Pobm6HfOdCHutos86PEUzhpCcCbN9M6y6xo61pSwpgRKSGV45Lp/N1UemKthC3oemOvdfji1IoDWfeueCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=DLw9nesv8ObZmzDZcurZrBf/ki2S2Gf/YPbDnpCiXfM=; b=F0efQ6oWinMESTsH96j+FU2hdhUpscne6XzZ7NGdGDRzOMyDV5ej5a+V1Ze16Omhtl6JxdD3pnqAIkN8ArDC+41AgZLAeGDZH3qSa2rKX0z8lDynXSgdgnKNGhOYPXh2pAaxskUKJH/jj5YreV6/xOVXJvEVF2yowVaM9EQWaqg= Received: from SN6PR01CA0002.prod.exchangelabs.com (2603:10b6:805:b6::15) by SN6PR02MB4110.namprd02.prod.outlook.com (2603:10b6:805:31::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Mon, 4 May 2020 14:14:17 +0000 Received: from SN1NAM02FT047.eop-nam02.prod.protection.outlook.com (2603:10b6:805:b6:cafe::4a) by SN6PR01CA0002.outlook.office365.com (2603:10b6:805:b6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 14:14:17 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 SN1NAM02FT047.mail.protection.outlook.com (10.152.72.201) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:16 +0000 Received: from [149.199.38.66] (port=43045 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrG-0000Gr-P3; Mon, 04 May 2020 07:14:10 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrM-0000wc-Dl; Mon, 04 May 2020 07:14:16 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrL-0000wA-IA; Mon, 04 May 2020 07:14:15 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id AA53C13C2E73; Mon, 4 May 2020 19:36:34 +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 v2 07/10] net: cadnece_gem: Update irq_read_clear field of designcfg_debug1 reg Date: Mon, 4 May 2020 19:36:05 +0530 Message-Id: <1588601168-27576-8-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(8676002)(8936002)(6266002)(4326008)(82310400002)(2906002)(81166007)(70206006)(70586007)(356005)(2616005)(42186006)(110136005)(426003)(47076004)(498600001)(336012)(36756003)(186003)(5660300002)(6666004)(26005)(4744005); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f35b1d38-9608-4678-15b7-08d7f0356e22 X-MS-TrafficTypeDiagnostic: SN6PR02MB4110: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:185; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V4WBDEi8lY7LpjdZVNGKajwfM4SCks6DJWE6s8i4Na5hP2cLbhqI+9SkU6/4JIuvkaAlafkmIroaL0YFEeKnN40AwrsZJL2a4ugeVrqVjsYyrlhP7iwUYsjVVjAD+RyUlNAy4gK+ftgpxuhoNHVdwEWpyMjF4DZcuuvisiOgVunWrFPaDFazBEsjGgp4m2QC+dKo8DtCqQ+H++g6uE/zWzvMgc4KsmHUy475Gr2JpLv8THKgjT0VwkPbVxZAUpmNSBPnodpK0dLQuON+BiNHmE4FkEX6061XbT0QbMOpKo3twbcx9NcwTVdPec9dNLQmHWtR+eyxl9syrlGKUHbYnQc3d2hW1I62OuecZUfwSdj5rShKrZfT5q/phxxrrpZXYA4+izGhs8WEqhXH4xD8l3IJDjnb+Bgj4wljEcl6cpxarYkKMvc4hvUvHBCt4S7R/6FWSwrQnZAeweO9biOUrnJNXIc5lbVWBpGZKSpBzlkWFoxgo0aWtOx+RubCa4EVxU35nbViPQZDklNL1yhJkg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:16.7745 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f35b1d38-9608-4678-15b7-08d7f0356e22 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: SN6PR02MB4110 Received-SPF: pass client-ip=40.107.68.52; envelope-from=saipava@xilinx.com; helo=NAM04-BN3-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 10:14:19 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" 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 848be3f..9eb72a2 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1344,7 +1344,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_TXPARTIALSF] = 0x000003ff; s->regs[GEM_RXPARTIALSF] = 0x000003ff; s->regs[GEM_MODID] = s->revision; - s->regs[GEM_DESCONF] = 0x02500111; + s->regs[GEM_DESCONF] = 0x02D00111; s->regs[GEM_DESCONF2] = 0x2ab12800; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; From patchwork Mon May 4 14:06: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: 11526279 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 460AA92A for ; Mon, 4 May 2020 14:16: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 1B2CC20721 for ; Mon, 4 May 2020 14:16: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="kB9/XfEy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B2CC20721 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]:34562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbtc-0002oG-8H for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:16:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrS-0007Cl-E0; Mon, 04 May 2020 10:14:22 -0400 Received: from mail-bn8nam11on2067.outbound.protection.outlook.com ([40.107.236.67]:20641 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 1jVbrR-0005e4-HF; Mon, 04 May 2020 10:14:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=irR4B1MyJE+7bAuZ8qVRvtzD3XpLsdokuKMzQsDWV+S3AmlgxE+CRiPos9GAXVzlPyQY1JklTd8IB/irBZtgie4s51ryHgrS/GIaVVWUefTVxhpjtfsDYeJqk0UIdryQJjUL8udRkdxUFpOdM62JB++G+J9OItZ3Gv0/lljVPGFUoT+G9VQYn0ikIm6YVzqliv+m/FugFGrCLQotinfuG4yshYPufeChBUx9Zy7zJP2Ay+Bdeo7oiOXMI7yx43OeUdPOzT1SCudzy1TocNECLcQ11i5MHjLPzA+YeUvPpcyCiPv1koQhMhMfbmxHlebTTSAMNlNres/xLlfz4JwM+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RNuahRkyku4wOSuP0kH987muvBcuhMG7AY7NoF+zC+g=; b=JMLNk3Lzwm+GJADHF9wQN5TlPT8zqDSGIBwJt5SaLKQTWi6t0X2FwglseFdpZi67xAqwybFgETqcSf/IYg3k65cDUlhnX8HUXv6Hcjm7f8shJevo5T16s5FW2SHLTYwtk7by0dcxFGHHThdViy84boTVwuBtPYS4VNGL6lvrqrv+TyiCYaRmnvAQr8INxFC/KLg+HYjb6wFcz87YsDIVk9iSwLzotgeRygdrBS/oYbEPGEfJ4X+9oTK6r50tpFR94FRv1vORU39bX/mkmHMvycjGuu7W7swPfyuSIctgC6iSqjEAFVsDr4H63tSfk/8+Y5Ba59VM89P8PXWN4EHmKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=RNuahRkyku4wOSuP0kH987muvBcuhMG7AY7NoF+zC+g=; b=kB9/XfEyl/5g72G5Gr7OA9p5AL5DbJdbrG8AqHd9VTXm6LvX/y7qXfesNWs7tUIoRhgPM8O/cb1LmtfcJ70zfrzzHd4A/oJQZNbMN9fjIb62Nxo7e+97hkqHNnGie0huxiHYzf5P9STBlSKEyPlreeNnEDdBGnS8NBbo8cb981M= Received: from SN6PR04CA0077.namprd04.prod.outlook.com (2603:10b6:805:f2::18) by BYAPR02MB5591.namprd02.prod.outlook.com (2603:10b6:a03:a6::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Mon, 4 May 2020 14:14:18 +0000 Received: from SN1NAM02FT007.eop-nam02.prod.protection.outlook.com (2603:10b6:805:f2:cafe::31) by SN6PR04CA0077.outlook.office365.com (2603:10b6:805:f2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 14:14:18 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 SN1NAM02FT007.mail.protection.outlook.com (10.152.72.88) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:18 +0000 Received: from [149.199.38.66] (port=43073 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrI-0000Gz-6r; Mon, 04 May 2020 07:14:12 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrN-0000wt-Rr; Mon, 04 May 2020 07:14:17 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrN-0000wk-0A; Mon, 04 May 2020 07:14:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id B15E913C2E73; Mon, 4 May 2020 19:36:35 +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 v2 08/10] net: cadence_gem: Update the reset value for interrupt mask register Date: Mon, 4 May 2020 19:36:06 +0530 Message-Id: <1588601168-27576-9-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(42186006)(70206006)(4326008)(47076004)(6266002)(8936002)(336012)(2616005)(426003)(8676002)(110136005)(26005)(82310400002)(356005)(498600001)(186003)(2906002)(36756003)(4744005)(5660300002)(81166007)(6666004)(70586007); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 519e84e6-8e2a-4fad-fcd7-08d7f0356efc X-MS-TrafficTypeDiagnostic: BYAPR02MB5591: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:83; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cQV2Uj9Jdsb5RPXKHvZZcZNh4mT2TZQMJwGU/k0hNImqnCoKzwzQY+Iz0Sq6eYBVhDArWn3SRFegXiBsrO/v2ZvTGKvNIU11cMdw5Dyr+QLFEjg8UY7CvTGng7wSanQzXYwy61q8lcCEjt5O8iuKLF6U6GxgeXrQMSKBgFftIRBsaz5Ro72EoR4mbiUIrLO2UgA2SXmZHsZxqXvu8OvKpnSnMxcUlObGqIbsLOFewTI5NQXt92/y2Q2xH65AYYX1q9hkpUVclavgyBZqpkcY2WH0EsX2gxqte5wHZ9A0YZUf0vreHQahsJp3yD4PatLNmcMdRs2n37sa6Nt0kJKx41kAmzbkQ5DEobxvWVkatAJBlxM+4riPZfZ2e9lB3UITPyyna0V+EFN0O0U9gUQd4FNa6q3WKpilAYXi+qksecwGWBAtJE0yBhJ5aTDZmiPlUWxleAdoVqwV2usVhDYQLeC76W71CHPjOE7/tDv6UwsTMLS3cB0B+TGdE95cvw4FY/9HiBqD47g71fTnOAtwBw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:18.2091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 519e84e6-8e2a-4fad-fcd7-08d7f0356efc 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: BYAPR02MB5591 Received-SPF: pass client-ip=40.107.236.67; 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/04 10:14:20 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 9eb72a2..ac3a553 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1348,6 +1348,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_DESCONF2] = 0x2ab12800; s->regs[GEM_DESCONF5] = 0x002f2045; s->regs[GEM_DESCONF6] = GEM_DESCONF6_64B_MASK; + s->regs[GEM_INT_Q1_MASK] = 0x00000CE6; if (s->num_priority_queues > 1) { queues_mask = MAKE_64BIT_MASK(1, s->num_priority_queues - 1); From patchwork Mon May 4 14:06: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: 11526287 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 BEC9892A for ; Mon, 4 May 2020 14: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 4641B20721 for ; Mon, 4 May 2020 14:20:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="qeubX+2Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4641B20721 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]:46922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbwy-0007zm-4W for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:20:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrT-0007Fd-Hc; Mon, 04 May 2020 10:14:23 -0400 Received: from mail-co1nam11on2042.outbound.protection.outlook.com ([40.107.220.42]:6168 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 1jVbrS-0005fA-Ki; Mon, 04 May 2020 10:14:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WXdTvabhVC5hHhHNyTk5VpPHgb1HuiH10bV76ExHo74fvwpL+xDbTjOHjXT9FYVh6UziWJ3kLa2SsPnMrLKTSDk2T283aYwOE2nwCaZ6Denk5AAlUFn4GXWhaq7pm1sDKptCmuhABmqrGLfyT7GVUpzWEU+nVURL9q+Fq/ia6OxYAD78HheSa/iKKT50eFOy+ksZTVk7Tdz/uxafaE0KvEKZK3h35ZcyTGuIaPbfMamBRjKoN1g92WlCNnYQhJ83BmD7TruFWn5qqA3HxLKWRIkKJpcdOMmfr2qLsbdgts3sZNOVI6015rlOR0/VvZt/w9hJy/3SqfipTIP/kFYpjw== 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=mGx+SxXbXZIAxhdl9mfewkcW+atilS8t+n5VksQTe54=; b=MKN9GCvYWGF2bMMW0Et74tBrk4WrzI++h8fUzrV6lNe34oUv/uzeNN/8N/wlacCfoNmndsbhLOpTKSabIbOej66ASxycgrC9981kcjxgOEMqN1rcpVxlyUvDfoqNa5GLQVmKJyNDuxAXuB7S0G0AtSvA1aNQTuzVes/x2JVuEEqW9lQ9USHTm2ZplEAPRy5vR4aEUf/YnPlRiDSs3p4f54t5e6ANi97vIEJFbNJyfwhwILK/I4EYof9TKmrcRv3kf6DHD5zMXAqGJLdwbPO9JXP1XBV2RWiJmeySmo6WEY3GaLJXX2NwxIRUr6kaTtjE6oxYZfzTguPNUcTwoCJ4kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=mGx+SxXbXZIAxhdl9mfewkcW+atilS8t+n5VksQTe54=; b=qeubX+2Y7hU9dXh+Ga9wXzlpiCd9QU/az0c0W7lFMNvp0fqsaEmM/92hy3vIasU1qHrCSe/F+8bW0gG/S4UjJHk8uFEY0Mg3nEUA1d+/yjduZNSll0lnhpfO6XsbOJQ0vw32qwLU3gboHBv6w3R4qD35bXIhzycqpsdrMOhqszQ= Received: from SN4PR0501CA0109.namprd05.prod.outlook.com (2603:10b6:803:42::26) by BN7PR02MB5201.namprd02.prod.outlook.com (2603:10b6:408:21::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Mon, 4 May 2020 14:14:19 +0000 Received: from SN1NAM02FT044.eop-nam02.prod.protection.outlook.com (2603:10b6:803:42:cafe::98) by SN4PR0501CA0109.outlook.office365.com (2603:10b6:803:42::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.16 via Frontend Transport; Mon, 4 May 2020 14:14:19 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 SN1NAM02FT044.mail.protection.outlook.com (10.152.72.173) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:18 +0000 Received: from [149.199.38.66] (port=43096 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrI-0000H2-QW; Mon, 04 May 2020 07:14:12 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrO-0000x7-FR; Mon, 04 May 2020 07:14:18 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrN-0000wu-PQ; Mon, 04 May 2020 07:14:17 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 7FB7213C304C; Mon, 4 May 2020 19:36:36 +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 v2 09/10] net: cadence_gem: TX_LAST bit should be set by guest Date: Mon, 4 May 2020 19:36:07 +0530 Message-Id: <1588601168-27576-10-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(26005)(4326008)(36756003)(2906002)(82310400002)(356005)(81166007)(47076004)(2616005)(426003)(498600001)(186003)(5660300002)(70586007)(4744005)(70206006)(336012)(6666004)(42186006)(110136005)(8936002)(8676002)(6266002); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 00232cb5-2f1f-4493-add3-08d7f0356f58 X-MS-TrafficTypeDiagnostic: BN7PR02MB5201: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:255; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WOslS5waQLZtN8USdiikpWnQceMoD3qgA8CITmb2W48BJ5v9di1ca8kR+GefX1Z3+NI5t6m6ENY2BsDX0VPvOomZS734n1g/dpuRb8XgqNM3tSfxvMwiMNNxXdzA6lh6a6yk/Lj6Lxs0/7SxD90PchIhStBVxW7vr+Y4YdXNN7J1YaqqLfOibZiAe1v6ckjN0TcFq0QbGjiUW4u1rn7+EJST7J3nwBDIE8Gt84lvEyJ9uYSxMD/dap7umT3uczuutdKV182Wy1h/lSHwQN3yMpTkn9q4H4lAkEv1TxTbudMll5iVHHkfvNqfPrBTfJMkogkhiok5XfpuCwAW7xaR3ZknkabfNFnosKBvyiMRCew3Y5lkiBcgwBrmVUpyzRjdB1PZPJ2LR3De/18B0D7DVjfyRjVvRvWbYEVHQTQgLDdclN+RUpPgMutIOA9Gh9UUNdm1vhE18YcE2zBq2f//8+2Tb0u9s7Rfw7gEOGfrxMeAZMk1LUoccjBkvGhSUiTipBm3OYaGctP6R9pei/gutQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:18.8090 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00232cb5-2f1f-4493-add3-08d7f0356f58 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: BN7PR02MB5201 Received-SPF: pass client-ip=40.107.220.42; 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/04 10:14:20 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 ac3a553..f0bf2e7 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -345,11 +345,6 @@ static inline unsigned tx_desc_get_last(uint32_t *desc) return (desc[1] & DESC_1_TX_LAST) ? 1 : 0; } -static inline void tx_desc_set_last(uint32_t *desc) -{ - desc[1] |= DESC_1_TX_LAST; -} - static inline unsigned tx_desc_get_length(uint32_t *desc) { return desc[1] & DESC_1_LENGTH; @@ -1270,7 +1265,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 Mon May 4 14:06:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 11526291 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 9E803139A for ; Mon, 4 May 2020 14:20:27 +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 73DFB20752 for ; Mon, 4 May 2020 14:20:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="enIe/pMW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73DFB20752 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]:48130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbxK-0000BT-GR for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 May 2020 10:20:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbrU-0007Hb-Cg; Mon, 04 May 2020 10:14:24 -0400 Received: from mail-mw2nam12on2074.outbound.protection.outlook.com ([40.107.244.74]:6150 helo=NAM12-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 1jVbrT-0005gh-9t; Mon, 04 May 2020 10:14:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DDgYO9DNY9fa0GUkHJh9FYoG6ZZBgU7RCXsjaN+I2uggvMNXMaVYD0ipQlcGMfzm1bMgLlvwbFhnfdTAZC6QfB7Z8x6lnRct0zeIxQFk5GXc20Utw7x6tLowsXtOrmdEtI+QwVtU32TVSpXWProHBhDgbcIsh2opBYeLLLthi4TTsyH5Ra4YxysqZN6U/EO7hQ1IYPZ0nmHs14T836SO0GdiZ1WDEupW0gpsLgelOPT9aHeRth+PppEWim7p20rlvrEGpCjF7J69HPfVwE92xglZQ0vz1/K1RNAiFzPlnmlu+sm5HhGhJ3dNV6tFUM8al3GuUbbWzzTreV+ZGUMFhA== 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=hinxdvB+SmjEyX1WmnJdXgfcuwaXO0a8Auar+RLVvl4=; b=O/uyLpHU5K6rPdJnXN0KU8zQbngSt0ChGKfN7d+kMrj0woh3cwDR/gVWhr9MuWmbKbuarkLiRzJ2ErMH3EejYuFCB3S6py2Op2scXUwmQYd5xw7skvec2Ne/LPO4UASAfrbl0PaUoH+F8jt8MCZ3zW08yVZyYoaQHWjVC2wmaGeSb8uU+Xm0BaShM35ruPYiYvb9Zr5NDo1UapbA3qkNHwV+e4mPp1/mSTeVA5v2t4ahk3LXSqj18Fhs7rGRvhujXgDu9eMgAgXo4AISahz709uzFCxx9AZuOH22SU/+DzXO+cmA+65+h7ISOvayBPDJdAWmNdYOWoRpRXLvsR9N2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=gmail.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=hinxdvB+SmjEyX1WmnJdXgfcuwaXO0a8Auar+RLVvl4=; b=enIe/pMWRVF9Ko81Y2zd9xgKo76vMRLHTUOJYKHpNOwKEyGHxF4um78KZBmoZI9vkCPKz8CYLobXuYGNgGnwupfDQ4r5uFYLnMkSwn7F0nfCEfx4DPEnd7+fPWImQMeQyNfyyVPsCWXDzF7jb/CBWyJs/VJNFwCsnLIZviCm3mU= Received: from DM6PR12CA0021.namprd12.prod.outlook.com (2603:10b6:5:1c0::34) by DM5PR02MB3653.namprd02.prod.outlook.com (2603:10b6:4:bb::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Mon, 4 May 2020 14:14:20 +0000 Received: from CY1NAM02FT039.eop-nam02.prod.protection.outlook.com (2603:10b6:5:1c0:cafe::7c) by DM6PR12CA0021.outlook.office365.com (2603:10b6:5:1c0::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Mon, 4 May 2020 14:14:19 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.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 CY1NAM02FT039.mail.protection.outlook.com (10.152.75.140) with Microsoft SMTP Server id 15.20.2958.27 via Frontend Transport; Mon, 4 May 2020 14:14:19 +0000 Received: from [149.199.38.66] (port=43115 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jVbrJ-0000H6-Fe; Mon, 04 May 2020 07:14:13 -0700 Received: from localhost ([127.0.0.1] helo=xsj-pvapsmtp01) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrP-0000xJ-3p; Mon, 04 May 2020 07:14:19 -0700 Received: from [10.140.6.35] (helo=xhdsaipava40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jVbrO-0000x5-EA; Mon, 04 May 2020 07:14:18 -0700 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 2A53B13C2E73; Mon, 4 May 2020 19:36:37 +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 v2 10/10] net: cadence_gem: Fix RX address filtering Date: Mon, 4 May 2020 19:36:08 +0530 Message-Id: <1588601168-27576-11-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1588601168-27576-1-git-send-email-sai.pavan.boddu@xilinx.com> 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:(46966005)(110136005)(6666004)(70206006)(26005)(42186006)(186003)(70586007)(5660300002)(336012)(8936002)(356005)(82310400002)(47076004)(8676002)(81166007)(36756003)(498600001)(6266002)(2906002)(426003)(2616005)(4326008); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80d4ec12-cf09-49ae-ec37-08d7f0356fb4 X-MS-TrafficTypeDiagnostic: DM5PR02MB3653: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:236; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vh5E7o9mW2CfkRad6hNbqTfAzyJhgmUtwdnnKYzenzlhkf2lgTvvALGnY13hsjpP4bRV1/WE5CzurIyJEUzaiHHq6p/EVMHxqBEHjHZLnGniP+YdOkG9ZwHwCODzElLDT5m2IwHa3Z7i9DGf0S2ysqsThRNx7lMBq5M4vhyqgdR8Ydb/yVjk1yO7VC1LdU2tPKW6NHcgJrANhBpquKfWdKoX4DU437fcw+Yh1LgxqamJf5M0Sp6IYc3tWR/URdBtBRoEkGYssUAxe0Ma0fNYkJAuFGbotQwojqOzUycAoZyHA0p1rqXoc7Kyje9dLWs7TF26pWB4hjKGYNXcPWP5gF1oqFM7IfvEBkIQMggoxj3rSCPDxLaeJZVKJ+Iola5Ha4J0W+LRcxW5Lkn2kyZhN9XTD+PDG0izwgV27dEjX+CbICuKYsQ0RRZl8nertEFHDmkL8B/9Ukdv9jRlEyBq7bK4dMjftbu3STXTrAyXEjYNh/DjtQ4VcXQox8+zOgcuO8ZRmrvCg2n8yYiVpc08YQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 14:14:19.4145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80d4ec12-cf09-49ae-ec37-08d7f0356fb4 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: DM5PR02MB3653 Received-SPF: pass client-ip=40.107.244.74; envelope-from=saipava@xilinx.com; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 10:14:21 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 f0bf2e7..112794a 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -34,6 +34,7 @@ #include "qemu/module.h" #include "sysemu/dma.h" #include "net/checksum.h" +#include "net/eth.h" #define CADENCE_GEM_ERR_DEBUG 0 #define DB_PRINT(...) do {\ @@ -669,7 +670,7 @@ static unsigned calc_mac_hash(const uint8_t *mac) static int gem_mac_address_filter(CadenceGEMState *s, const uint8_t *packet) { uint8_t *gem_spaddr; - int i; + int i, is_mc; /* Promiscuous mode? */ if (s->regs[GEM_NWCFG] & GEM_NWCFG_PROMISC) { @@ -685,22 +686,17 @@ static int gem_mac_address_filter(CadenceGEMState *s, const uint8_t *packet) } /* Accept packets -w- hash match? */ - if ((packet[0] == 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) || - (packet[0] != 0x01 && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH))) { + is_mc = is_multicast_ether_addr(packet); + if ((is_mc && (s->regs[GEM_NWCFG] & GEM_NWCFG_MCAST_HASH)) || + (!is_mc && (s->regs[GEM_NWCFG] & GEM_NWCFG_UCAST_HASH))) { + uint64_t buckets; unsigned hash_index; hash_index = calc_mac_hash(packet); - if (hash_index < 32) { - if (s->regs[GEM_HASHLO] & (1<regs[GEM_HASHHI] & (1<regs[GEM_HASHHI] << 32) | s->regs[GEM_HASHLO]; + if ((buckets >> hash_index) & 1) { + return is_mc ? GEM_RX_MULTICAST_HASH_ACCEPT + : GEM_RX_UNICAST_HASH_ACCEPT; } } @@ -924,7 +920,7 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) /* Is this destination MAC address "for us" ? */ maf = gem_mac_address_filter(s, buf); if (maf == GEM_RX_REJECT) { - return -1; + return size; /* no, drop siliently b/c it's not an error */ } /* Discard packets with receive length error enabled ? */