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 230E2C001DC for ; Mon, 31 Jul 2023 16:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hmbOwo2Pd7Yp3Tdj6Rrvs7NQ9qgBzE9BMiQjcgf563U=; b=ZEhAJR+EOIXOch GkG1EN9XaRQ51k2EjmqNvIVvgD8gv07asH41X7XdFO+Ig0jchGwfbqDUgwenMDeiCODHlSgEWC1vS MMaLOSIPnjvfnLIPL5Qv0ebKfqZwEWexW6j9Ewzd1kAQxonbLlOK1ntD3PL6201t3wRMMpQ7koKUN VzV0e8YRHfuj47IM4HgtzWzHONms0ns2sZ4iiJziIZEKDsqXEl4EJEUhxqeN12UKDSiKTzy3u3laF Z55IvFLPnVy31HUZ4Bssugl/WGL0DSmtDWaytCRFhdY3iH/pLaPh5sHpB/L65DAl8Rk3Z80i90/vZ dm+HCjtXtQ+wZWeg7jGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQW7p-00GbqC-38; Mon, 31 Jul 2023 16:52:05 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQW7m-00GbpW-1s for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 16:52:03 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 139F46120B; Mon, 31 Jul 2023 16:52:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E0D0C433C8; Mon, 31 Jul 2023 16:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690822321; bh=CGzW4Z4n87oXkmDgD3NYNy1uk7m9r4O9fbpQ0K4fcrw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JwP2f6UiI/vu1DP9is9j8UII+ounDJXNS96unDEUTuoypnss/KVF645UcDhKT1oX+ MxD72lxig3/MfG2acIqu6QYXzcHTRD5Gu2QeJ6BWlTu+W14gikM9dg20Pvkl4iGC+G Wb3fiR6p4u6l0Lw05mRLbxTf3rRvNlY/kN5F1TO9wnosooHIRdQdF2wn+c9Fk0QW8T sEteJiW0DkcJXo8tJiRf+5rIuQbj1/OEKValoXbf/8RXyTqb50vvXO7t4kezgIE4mw /TrUY9WAxRAxGCdWYmP88TLvkiq7acc2xKsWUdoHC2bewk8jBZdMPE/Ua1P2QOVY4t L2Af9fI3xDQMw== Date: Mon, 31 Jul 2023 09:51:59 -0700 From: Jakub Kicinski To: Md Danish Anwar Cc: MD Danish Anwar , Randy Dunlap , Roger Quadros , Simon Horman , Vignesh Raghavendra , Andrew Lunn , Richard Cochran , Conor Dooley , Krzysztof Kozlowski , Rob Herring , Paolo Abeni , Eric Dumazet , "David S. Miller" , , , , , , , Subject: Re: [PATCH v12 06/10] net: ti: icssg-prueth: Add ICSSG ethernet driver Message-ID: <20230731095159.3b7e3b75@kernel.org> In-Reply-To: <8790da4f-1378-410c-f637-f85ca4d34604@ti.com> References: <20230727112827.3977534-1-danishanwar@ti.com> <20230727112827.3977534-7-danishanwar@ti.com> <20230728172419.702b4ac0@kernel.org> <8790da4f-1378-410c-f637-f85ca4d34604@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_095202_705740_12BC7A0A X-CRM114-Status: GOOD ( 16.11 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 31 Jul 2023 16:49:59 +0530 Md Danish Anwar wrote: > There are five error handling cases in xmit(). > > 1. DMA Mapping the linear buffer -- If we fail to map dma, we will return > NETDEV_TX_OK and goto drop_free_skb which will free the skb and drop the packet. > > 2. Allocating descriptor for linear buffer -- If we fail to allocate descriptor > this means it is a occupancy issue and we will goto drop_stop_q_busy which will > stop queue and return NETDEV_TX_BUSY. > > 3. Allocating descriptor when skb is fragmented. -- If we fail to allocate > descriptor when skb is fragmented, we will goto drop_stop_q which will stop the > queue, free the descriptor, free the skb, drop the packet and return NETDEV_TX_OK. This one should be BUSY, right? goto free_desc_stop_q_busy > 4. DMA mapping for fragment. -- If DMA mapping for fragment fails, we will go > to drop_free_descs which will free the descriptor, free the skb, drop the > packet and return NETDEV_TX_OK. > > 5. Tx push failed. -- If tx push fails we will goto drop_free_descs which will > free the descriptor, free the skb, drop the packet and return. > > We will only stop queue in case 2 and 3 where we failed to allocate descriptor. > In case 1, 4 and 5 we are encountering dma mapping error, so for these cases we > will not stop the queue. > > Below will be my goto labels. > > drop_stop_q: > netif_tx_stop_queue(netif_txq); > > drop_free_descs: > prueth_xmit_free(tx_chn, first_desc); > > drop_free_skb: > dev_kfree_skb_any(skb); > > /* error */ > ndev->stats.tx_dropped++; > netdev_err(ndev, "tx: error: %d\n", ret); > > return ret; free_desc_stop_q_busy: prueth_xmit_free(tx_chn, first_desc); > drop_stop_q_busy: > netif_tx_stop_queue(netif_txq); > return NETDEV_TX_BUSY; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel