From patchwork Fri Jan 10 19:26:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13935440 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83D24212FB9 for ; Fri, 10 Jan 2025 19:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736537187; cv=none; b=g/qRAkOWgSPExHgJMryljDQQ8xAi0OfHy8kiqxYbZnOjgcO8Ph8fxFU2fNIDOKvrGdjUMwGchDK21VAduUcefwv5CXdixcRJwdre1AvVGOvzXjlRrd8SKY/JJBfiZMcV3COVfO/feGHw43kwVmAH7CBenTjGO9FATsxxdK1Pqgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736537187; c=relaxed/simple; bh=Rz6BR9gOjGIcUDMO1gIRT0IJDTXGqkvmjJdJ9bYWJZw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pHbEelRyHPYPb0rCYqGu5agtZLTAmc+RTlZUeYxs8cPmFt+uLXDwq4ZCjBQU5ugp+5u8oEtLqhgBop0YbPrhR1N3M6cJGi9KQnKMoqMBh7ytDY9OGlpUYFERsf1jQpfyY9Cqudmx1OrgukfUOARcktX4d9MIYRpQHjHI/+7Kq/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=GGKDDtac; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="GGKDDtac" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736537182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FxFSWBvNwwzGpNauOKJOh690c9DKh5Hm6FAncQMyVDc=; b=GGKDDtacV4yf0lK6ELn1ocYpufe2by1H/DwGK/SqiiJuk0KQ/wG34ylMnBZ1SnQofYAL2/ SZ7+uYXtWjP4W39fxdF+BHQ4WjGEyqISAZs6LwY306b3RJhG0hmXfUuYI3UvCyYzpkx1r1 VkBuneSKfG79zdyLae0gtuNrh73i7Jc= From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Radhey Shyam Pandey , netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Shannon Nelson , Michal Simek , linux-kernel@vger.kernel.org, Sean Anderson , Heng Qi Subject: [PATCH net-next v3 0/6] net: xilinx: axienet: Enable adaptive IRQ coalescing with DIM Date: Fri, 10 Jan 2025 14:26:10 -0500 Message-Id: <20250110192616.2075055-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Patchwork-Delegate: kuba@kernel.org To improve performance without sacrificing latency under low load, enable DIM. While I appreciate not having to write the library myself, I do think there are many unusual aspects to DIM, as detailed in the last patch. This series depends on [1]. [1] https://lore.kernel.org/netdev/20250110190726.2057790-1-sean.anderson@linux.dev/ Changes in v3: - Fix mismatched parameter name documentation for axienet_calc_cr - Integrate some cleanups originally included in https://lore.kernel.org/netdev/20240909230908.1319982-1-sean.anderson@linux.dev/ - Move spin (un)locking in IRQs inside the if condition of napi_schedule_prep. This lets us hold the lock just for the rmw. - Fix function name in doc comments for axienet_update_coalesce_rx/tx - Adjust axienet_local doc comment order to match the members - Rebase onto net-next/master Changes in v2: - Add some symbolic constants for IRQ delay timer - Report an error for bad coalesce settings - Don't use spin_lock_irqsave when we know the context - Split the CR calculation refactor from runtime coalesce settings adjustment support for easier review. - Have axienet_update_coalesce_rx/tx take the cr value/mask instead of calculating it with axienet_calc_cr. This will make it easier to add partial updates in the next few commits. - Get coalesce parameters from driver state - Don't take the RTNL in axienet_rx_dim_work to avoid deadlock. Instead, calculate a partial cr update that axienet_update_coalesce_rx can perform under a spin lock. - Use READ/WRITE_ONCE when accessing/modifying rx_irqs Sean Anderson (6): net: xilinx: axienet: Add some symbolic constants for IRQ delay timer net: xilinx: axienet: Report an error for bad coalesce settings net: xilinx: axienet: Combine CR calculation net: xilinx: axienet: Support adjusting coalesce settings while running net: xilinx: axienet: Get coalesce parameters from driver state net: xilinx: axienet: Enable adaptive IRQ coalescing with DIM drivers/net/ethernet/xilinx/Kconfig | 1 + drivers/net/ethernet/xilinx/xilinx_axienet.h | 32 +- .../net/ethernet/xilinx/xilinx_axienet_main.c | 330 ++++++++++++++---- 3 files changed, 280 insertions(+), 83 deletions(-)