From: Jakub Kicinski <kuba@kernel.org>
To: Md Danish Anwar <a0501179@ti.com>
Cc: MD Danish Anwar <danishanwar@ti.com>,
Randy Dunlap <rdunlap@infradead.org>,
Roger Quadros <rogerq@kernel.org>,
Simon Horman <simon.horman@corigine.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Andrew Lunn <andrew@lunn.ch>,
Richard Cochran <richardcochran@gmail.com>,
Conor Dooley <conor+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Rob Herring <robh+dt@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>, <nm@ti.com>,
<srk@ti.com>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-omap@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v12 06/10] net: ti: icssg-prueth: Add ICSSG ethernet driver
Date: Mon, 31 Jul 2023 09:51:59 -0700 [thread overview]
Message-ID: <20230731095159.3b7e3b75@kernel.org> (raw)
In-Reply-To: <8790da4f-1378-410c-f637-f85ca4d34604@ti.com>
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;
next prev parent reply other threads:[~2023-07-31 16:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 11:28 [PATCH v12 00/10] Introduce ICSSG based ethernet Driver MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 01/10] net: ti: icssg-prueth: Add Firmware Interface for ICSSG Ethernet driver MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 02/10] net: ti: icssg-prueth: Add mii helper apis and macros MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 03/10] net: ti: icssg-prueth: Add Firmware config and classification APIs MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 04/10] net: ti: icssg-prueth: Add icssg queues APIs and macros MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 05/10] dt-bindings: net: Add ICSSG Ethernet MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 06/10] net: ti: icssg-prueth: Add ICSSG ethernet driver MD Danish Anwar
2023-07-29 0:24 ` Jakub Kicinski
2023-07-31 4:57 ` [EXTERNAL] " Md Danish Anwar
2023-07-31 11:19 ` Md Danish Anwar
2023-07-31 16:51 ` Jakub Kicinski [this message]
2023-07-29 0:25 ` Jakub Kicinski
2023-07-31 9:43 ` [EXTERNAL] " Md Danish Anwar
2023-07-27 11:28 ` [PATCH v12 07/10] net: ti: icssg-prueth: Add ICSSG Stats MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 08/10] net: ti: icssg-prueth: Add Standard network staticstics MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 09/10] net: ti: icssg-prueth: Add ethtool ops for ICSSG Ethernet driver MD Danish Anwar
2023-07-27 11:28 ` [PATCH v12 10/10] net: ti: icssg-prueth: Add Power management support MD Danish Anwar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230731095159.3b7e3b75@kernel.org \
--to=kuba@kernel.org \
--cc=a0501179@ti.com \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nm@ti.com \
--cc=pabeni@redhat.com \
--cc=rdunlap@infradead.org \
--cc=richardcochran@gmail.com \
--cc=robh+dt@kernel.org \
--cc=rogerq@kernel.org \
--cc=simon.horman@corigine.com \
--cc=srk@ti.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).