From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B107CD5BC9 for ; Thu, 5 Sep 2024 14:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XfjIyfKExbojvg4OqW0T1atlcXrmiOV6/uFDjaE/LIA=; b=upo4b2O4RaMh5uvYR7TsEGBS9d vbuGVlMSsBD8OFNQ7x2bCiWhKGdW+c7h4yBEILOWQAg8nssW9rE2Tl++yI+bDeh1lM6k2pQf3Nl/u 5XTrbYD7l7ZISPDMjRvHGBlGZKclSCNqAht9cun+uKdsry5FRyNOBW2IUHWrxqotI747qewxJFLC4 u8JCbAMke7Je7oPbunMtmsPFClF8VSbP6ershBw/X5aMwEOwXK+H/0Ra4AHBFjsGd0/S3G0b4sNEe HSA5qB+AMWWbI+WzPCfV6XPXBYIj/wpx7UCkfB8dPM1juWAeRJ7fWofnr+AmlkMDfGZWJE4Uv2kqP epP3WB9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDXb-00000008jDy-2JYh; Thu, 05 Sep 2024 14:32:55 +0000 Received: from out-176.mta1.migadu.com ([2001:41d0:203:375::b0]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDSc-00000008iDz-3k3e for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:27:48 +0000 Message-ID: <9f74395f-55f6-46f3-8a84-bbf033e0f2d9@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1725546464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XfjIyfKExbojvg4OqW0T1atlcXrmiOV6/uFDjaE/LIA=; b=T9yrkk6Ct/0LGScShWGpb5aamMC5ZhXBKN+WcickoCJCGoUskP5BpaTsMLphv8LOQx+p/N hTWM5MbQ+k3MGQDkhUxhpYXJv1qYWV2SZBSkiX0GwQYLKSME6a/hgrn+Bl7IRmNcB4pscJ qM1MVTYiv7ThzrYaGkjooGNKNPhq11E= Date: Thu, 5 Sep 2024 10:27:41 -0400 MIME-Version: 1.0 Subject: Re: [PATCH net-next 2/2] net: xilinx: axienet: Enable adaptive IRQ coalescing with DIM To: Eric Dumazet Cc: "David S . Miller" , Jakub Kicinski , Paolo Abeni , Radhey Shyam Pandey , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Heng Qi References: <20240903192524.4158713-1-sean.anderson@linux.dev> <20240903192524.4158713-3-sean.anderson@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sean Anderson In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_072747_133086_085A4E44 X-CRM114-Status: GOOD ( 10.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/4/24 13:04, Eric Dumazet wrote: > On Tue, Sep 3, 2024 at 9:25 PM Sean Anderson wrote: >> > >> + >> +/** >> + * axienet_rx_dim_work() - Adjust RX DIM settings >> + * @work: The work struct >> + */ >> +static void axienet_rx_dim_work(struct work_struct *work) >> +{ >> + struct axienet_local *lp = >> + container_of(work, struct axienet_local, rx_dim.work); >> + >> + rtnl_lock(); > > Why do you need rtnl ? To protect against concurrent modification in axienet_ethtools_set_coalesce. > This is very dangerous, because cancel_work_sync(&lp->rx_dim.work) > might deadlock. Ah, you're right. So maybe I should add a separate mutex for this. --Sean >> + axienet_dim_coalesce_rx(lp); >> + axienet_update_coalesce_rx(lp); >> + rtnl_unlock(); >> + >> + lp->rx_dim.state = DIM_START_MEASURE; >> +} >>