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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3337CC4332F for ; Thu, 8 Dec 2022 16:48:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230060AbiLHQsA (ORCPT ); Thu, 8 Dec 2022 11:48:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbiLHQr7 (ORCPT ); Thu, 8 Dec 2022 11:47:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E70C338A0 for ; Thu, 8 Dec 2022 08:47:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 390FEB82511 for ; Thu, 8 Dec 2022 16:47:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E56BC433D2; Thu, 8 Dec 2022 16:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670518074; bh=6r4jJjUrky13iXNiDH8xNc4743RLEstwLqZMAaakrpc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oRk5+m5Xbq+JeNOW31QoWsQVeHerhzhTVQQc08r/T3QMoGde360ut9oLCDbJG+baB ChyhHMbP2cj8nQB5xEX3TlAr0KqWXqiGdPi5PECv1DPpoAfyKewrHP3S9tGHFNeH/f Rc8HnxRk7Hx+55j27BBkvM4rXP9WMpAZRkClF6bD3fOEn2XOFR1a72KaIvHEuKcvf4 AUw7O9BA8WrYBSLCkjVLVFxev1bXkl8pozRVjzLgkEvvZD6nVuaPbVlOKjNxpNRrlU h2BUVGdi9h0rQI7B5qlpLSx46Xj0hOvClWwcdkm7Pvb7zp2KkzM0W021W9S0b8x5Hw 2XGnO+Cjh2VsA== Date: Thu, 8 Dec 2022 08:47:53 -0800 From: Jakub Kicinski To: Yang Yingliang Cc: , , , , , Subject: Re: [PATCH net v4] ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave() Message-ID: <20221208084753.6523ff23@kernel.org> In-Reply-To: <20221208120121.2076486-1-yangyingliang@huawei.com> References: <20221208120121.2076486-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 8 Dec 2022 20:01:21 +0800 Yang Yingliang wrote: > It is not allowed to call kfree_skb() or consume_skb() from hardware > interrupt context or with hardware interrupts being disabled. > > It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead. > The difference between them is free reason, dev_kfree_skb_irq() means > the SKB is dropped in error and dev_consume_skb_irq() means the SKB > is consumed in normal. > > In this case, dev_kfree_skb() is called in free_tx_buffers() to drop > the SKBs in tx buffers, when the card is down, so replace it with > dev_kfree_skb_irq() here. Make sure you read this: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html