netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Esben Haabendal <esben@geanix.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, andrew@lunn.ch,
	michal.simek@xilinx.com, ynezz@true.cz
Subject: Re: [PATCH net 2/4] net: ll_temac: Add more error handling of dma_map_single() calls
Date: Thu, 20 Feb 2020 09:32:58 +0100	[thread overview]
Message-ID: <87v9o18xqd.fsf@geanix.com> (raw)
In-Reply-To: <20200219.105954.1568022053134111448.davem@davemloft.net> (David Miller's message of "Wed, 19 Feb 2020 10:59:54 -0800 (PST)")

David Miller <davem@davemloft.net> writes:

> From: Esben Haabendal <esben@geanix.com>
> Date: Wed, 19 Feb 2020 11:54:00 +0100
>
>> @@ -863,12 +865,13 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>>  	skb_dma_addr = dma_map_single(ndev->dev.parent, skb->data,
>>  				      skb_headlen(skb), DMA_TO_DEVICE);
>>  	cur_p->len = cpu_to_be32(skb_headlen(skb));
>> +	if (WARN_ON_ONCE(dma_mapping_error(ndev->dev.parent, skb_dma_addr)))
>> +		return NETDEV_TX_BUSY;
>
> The appropriate behavior in this situation is to drop the packet and return
> NETDEV_TX_OK.

Ok, and I guess the same goes for the error handling of dma_map_single()
of one of the fragments later in same function.

/Esben

  reply	other threads:[~2020-02-20  8:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 10:53 [PATCH net 0/4] net: ll_temac: Bugfixes Esben Haabendal
2020-02-19 10:53 ` [PATCH net 1/4] net: ll_temac: Fix race condition causing TX hang Esben Haabendal
2020-02-19 10:54 ` [PATCH net 2/4] net: ll_temac: Add more error handling of dma_map_single() calls Esben Haabendal
2020-02-19 18:59   ` David Miller
2020-02-20  8:32     ` Esben Haabendal [this message]
2020-02-20 18:11       ` David Miller
2020-02-19 10:54 ` [PATCH net 3/4] net: ll_temac: Fix RX buffer descriptor handling on GFP_ATOMIC pressure Esben Haabendal
2020-02-19 10:54 ` [PATCH net 4/4] net: ll_temac: Handle DMA halt condition caused by buffer underrun Esben Haabendal
2020-02-21  6:47 ` [PATCH net v2 0/4] net: ll_temac: Bugfixes Esben Haabendal
2020-02-21  6:47   ` [PATCH net v2 1/4] net: ll_temac: Fix race condition causing TX hang Esben Haabendal
2020-02-21  6:47   ` [PATCH net v2 2/4] net: ll_temac: Add more error handling of dma_map_single() calls Esben Haabendal
2020-02-21  6:47   ` [PATCH net v2 3/4] net: ll_temac: Fix RX buffer descriptor handling on GFP_ATOMIC pressure Esben Haabendal
2020-02-21  6:47   ` [PATCH net v2 4/4] net: ll_temac: Handle DMA halt condition caused by buffer underrun Esben Haabendal
2020-02-22  0:05   ` [PATCH net v2 0/4] net: ll_temac: Bugfixes David Miller

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=87v9o18xqd.fsf@geanix.com \
    --to=esben@geanix.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=ynezz@true.cz \
    /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).