From patchwork Fri Mar 4 22:42:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 12770085 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93AA9C433F5 for ; Fri, 4 Mar 2022 22:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbiCDWo1 (ORCPT ); Fri, 4 Mar 2022 17:44:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiCDWoZ (ORCPT ); Fri, 4 Mar 2022 17:44:25 -0500 Received: from mx0d-0054df01.pphosted.com (mx0d-0054df01.pphosted.com [67.231.150.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AAB15FF35 for ; Fri, 4 Mar 2022 14:43:36 -0800 (PST) Received: from pps.filterd (m0209000.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 224MaIDh005553; Fri, 4 Mar 2022 17:43:05 -0500 Received: from can01-to1-obe.outbound.protection.outlook.com (mail-to1can01lp2059.outbound.protection.outlook.com [104.47.61.59]) by mx0c-0054df01.pphosted.com (PPS) with ESMTPS id 3ek4hy8n9q-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Mar 2022 17:43:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gBbQxCsNwEkgpHkgXefhpSf4YxBgKSOfm5eafMfwmzlNjeB1gsiTf5FfwZIZ9HGdz301OiAOfSwBOfpc6oBwmvEcUyH+0dJKd7h7sFtwcifYOLazqwjq6pFEdiNqZlrYYghfrfnuL1VETpFfMvgEWnLKAmkARoOA38YrnBJ0R43N01jsjfu6vWM2wBg0QFV4OEkZNZFSr08j3+XTDZfYM4ae2SgbunIRBHVadqqqNonLqta55tXajp+HgraPcFpMEoUvzjcNqyA16GhtcfMzWyWD2E4kNIvR0R8hnINBuRKlZk3ZTUOoTWPVqw7ThK9T7FCQo4TnckJG7jERGOWRxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LmGF+PECeuzxRb/Bym8EaMgnscDUXKqiVlYkBMd5pHc=; b=e0PgORuM6D99du2IygQeyqH77wxLYdbgZqbZnoGhZjGnUv2G3v97skjhz6iSD7+BEYQe+/MppFPwQe5FGKEthi2Gm27FDX6tN7JJjxft9ideXS+iEdPuGETNUtoXysnKSVEdZJNp2T4ijOYJD0PKXgesKwONu7jajY2VODssx7ckdnnShXXICFJbz6u0KD4e9qH0332O/GfQJJrP1Cscvd5r9oBLv3BYAzkNpaKFulzXuXTF3WMp4F4CVgaqyARg4RuMKf8ew4ZLP694MWNz0wgNqMHZWzZpoLbOuUCxp1e1CjPp9Um4UoZuLEJpTqkz1sUhOcHL0pYE9tuECHG68w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=calian.com; dmarc=pass action=none header.from=calian.com; dkim=pass header.d=calian.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LmGF+PECeuzxRb/Bym8EaMgnscDUXKqiVlYkBMd5pHc=; b=36JlKSEOIThioLmz4hpdwnBDWw1MhnNTw38tngCYaLzzJqm6zfAZIh7PCbuQgpQWZAC5sTERRYSzVL1xrTddJItMSCpEd1TZrYQH6N1GWof4mWt5kmRtqAKsA1wLJqJ7Cal4lzfQ228kZz6tlKeEzfnxr/D0Qde8TFoGHe33n1w= Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) by YQBPR0101MB6540.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:4b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Fri, 4 Mar 2022 22:43:04 +0000 Received: from YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::e8a8:1158:905f:8230]) by YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM ([fe80::e8a8:1158:905f:8230%7]) with mapi id 15.20.5038.017; Fri, 4 Mar 2022 22:43:03 +0000 From: Robert Hancock To: netdev@vger.kernel.org Cc: radhey.shyam.pandey@xilinx.com, davem@davemloft.net, kuba@kernel.org, michal.simek@xilinx.com, linux@armlinux.org.uk, ariane.keller@tik.ee.ethz.ch, daniel@iogearbox.net, Robert Hancock Subject: [PATCH net-next 4/7] net: axienet: don't set IRQ timer when IRQ delay not used Date: Fri, 4 Mar 2022 16:42:02 -0600 Message-Id: <20220304224205.3198029-5-robert.hancock@calian.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220304224205.3198029-1-robert.hancock@calian.com> References: <20220304224205.3198029-1-robert.hancock@calian.com> X-ClientProxiedBy: CH0PR13CA0005.namprd13.prod.outlook.com (2603:10b6:610:b1::10) To YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8edf53cf-d6d2-4b8d-95b2-08d9fe3057fb X-MS-TrafficTypeDiagnostic: YQBPR0101MB6540:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8QuSre7KMDEq4sQHR0JUTa8EBnCNgypEwCMRidOkpHY4vNN+9wjxx+gvdfPHscz5R1U+XQavFuVySwYnqOvGoEigSyUz4PQQhH0+bZlHwWKIgoqmRx98O8BqMcUBTxqJcVplx/8JANDns1Wqp+Vcp9UYwedNs/16tVq/m8JFY8v/K+6uJMDAvlqvU27Y/i+7y+hcC/o/890aM2sfXu/IGn+r/BAPcLpVs0P0tDrnmFOjAGVWQBcR2Bywga4rut6uSAto87zK0yGlp9eRKqR6i/zA20aMUw2eF44vgTRYPWPGiXQWD8kJkjdGSCW2CHRvojLXlRMqUY+sag8AU+OIa5id6i09ygTCxBPEuyWKkAhy/gM418yGtBsk6I1hntRzRamrnd9sIkmw2ldQ78uyxFW627xA/hGHt5NDbXjMe158bvFM6Lg7OG0NNweSOD5+2yyrZsXm1MLnGlwN6mlMRR5m8qDyp5+DuFHkaM5DeKHmC5F3wp28sYbkHGBEm/VaHdyO8kKzZ+ckK4AN/Zw2vRb0vi/iExOTut4LfCAu30KeGGlFLshvVQVikl1N2pakg7NDMKsVCg/PLO19HkSJmHiK5qqC3DLKgqykOjm4JgJzSpPvcZed/f5W/WxWOPSE9MguRvfcbYYUmvL0tME+w3FZu4FMv79lM8bhMnMCBFbQBcCm2S/iiyb0JGa8UP2Tk7c6xvh4/+hZvPig+14dpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(26005)(186003)(316002)(2616005)(44832011)(36756003)(1076003)(6512007)(8936002)(107886003)(8676002)(66556008)(6506007)(66946007)(2906002)(5660300002)(66476007)(52116002)(4326008)(86362001)(38100700002)(508600001)(6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A5H3A/oeJ8+5yp5K5booCSZcKHnx3lRYi3FwGXL8Cja19i9YlTxIsZCSDAaI/AiNRlRw1JPwtgQfPUMqxHv9LBwPpcerFfMnK11UnzQClS3oJP3mpJDci0dipqB74j+tkQ0UR90Ey8mCbME7+uduFdkU+K1Sfr5sUzQKF8BbNLybFsfzZ5I9ZzLRPC3gWYzciM7w29/T0GgKpCxn0ci3GSQS/hlKMuF6pUtRZLVmZEXBMzgDu6JVWdQrQBQuL1sawRL+wzmWiq1LAW2CqEB7aK8MR1EcWb2Gkqb5va//Eedp8Z/h08gDrgPD43/vbzMyDX12CWsu6kiR7+NQxkFX1fWHKvc1dIEDGeIb6A7o0fkOvc9sU5tZMBDpb9x+rBecj81Pinbbc2kGo0Ma+fjx6z7JJB3+aM8FAbkNDFcJfXiGyGN+z0g+bWyglHwm8tig5hTpS3ouS3oGGZZjzXsPy3s7Hgk/u20DRl/d98pzN3ImnCP6b6oxTMpi4CuDKY5TkcPzpsYFrNWjlsWab4TCWAQ0AkZYCgCFYS+lvpZGHxht9YlhJ6gwPWAxRjLVQXUt2+pjaRlss6etpQaUCxyUsw0I5QFD/zAayhDE7aIEMokVwTe2rd3QGgmaQ1Dcq1xf/cvV6PrsIKhB+jMBgUvw0fSv7uibuqT3/OUlRZh3y12/Kvz4nZGFE6WgrzigsSrVGcKbuhdlmXqSmDJ3SsIsChkIzw= X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8edf53cf-d6d2-4b8d-95b2-08d9fe3057fb X-MS-Exchange-CrossTenant-AuthSource: YT3PR01MB6274.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2022 22:43:03.8720 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eOBGPAHtVuNenaFarRIswSWH1uoAX9OnaRjJmJAY2e4FDn6Azgiaj3j75kWP2CrOnZUcKST9T2FQ6B34R0ecUY7TMarnuNdaYmWW6KdS1rU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB6540 X-Proofpoint-ORIG-GUID: qs3oUk7M7s5yCV5Epry3XQsO2OpQH91o X-Proofpoint-GUID: qs3oUk7M7s5yCV5Epry3XQsO2OpQH91o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-04_09,2022-03-04_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 mlxscore=0 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 adultscore=0 mlxlogscore=836 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203040112 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When the RX or TX coalesce count is set to 1, there's no point in setting the delay timer value since an interrupt will already be raised on every packet, and the delay interrupt just causes extra pointless interrupts. Signed-off-by: Robert Hancock --- .../net/ethernet/xilinx/xilinx_axienet_main.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index d705b62c3958..b374800279e7 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -236,14 +236,24 @@ static void axienet_dma_start(struct axienet_local *lp) /* Start updating the Rx channel control register */ rx_cr = (lp->coalesce_count_rx << XAXIDMA_COALESCE_SHIFT) | - (XAXIDMA_DFT_RX_WAITBOUND << XAXIDMA_DELAY_SHIFT) | - XAXIDMA_IRQ_ALL_MASK; + XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_ERROR_MASK; + /* Only set interrupt delay timer if not generating an interrupt on + * the first RX packet. Otherwise leave at 0 to disable delay interrupt. + */ + if (lp->coalesce_count_rx > 1) + rx_cr |= (XAXIDMA_DFT_RX_WAITBOUND << XAXIDMA_DELAY_SHIFT) | + XAXIDMA_IRQ_DELAY_MASK; axienet_dma_out32(lp, XAXIDMA_RX_CR_OFFSET, rx_cr); /* Start updating the Tx channel control register */ tx_cr = (lp->coalesce_count_tx << XAXIDMA_COALESCE_SHIFT) | - (XAXIDMA_DFT_TX_WAITBOUND << XAXIDMA_DELAY_SHIFT) | - XAXIDMA_IRQ_ALL_MASK; + XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_ERROR_MASK; + /* Only set interrupt delay timer if not generating an interrupt on + * the first TX packet. Otherwise leave at 0 to disable delay interrupt. + */ + if (lp->coalesce_count_tx > 1) + tx_cr |= (XAXIDMA_DFT_TX_WAITBOUND << XAXIDMA_DELAY_SHIFT) | + XAXIDMA_IRQ_DELAY_MASK; axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET, tx_cr); /* Populate the tail pointer and bring the Rx Axi DMA engine out of