From: David Miller <davem@davemloft.net>
To: nhorman@tuxdriver.com
Cc: netdev@vger.kernel.org, romieu@fr.zoreil.com
Subject: Re: [net PATCH v3] 8139cp: Add dma_mapping_error checking
Date: Tue, 30 Jul 2013 18:01:51 -0700 (PDT) [thread overview]
Message-ID: <20130730.180151.2062213596812240686.davem@davemloft.net> (raw)
In-Reply-To: <1375117535-12906-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 29 Jul 2013 13:05:35 -0400
> @@ -716,6 +722,22 @@ static inline u32 cp_tx_vlan_tag(struct sk_buff *skb)
> TxVlanTag | swab16(vlan_tx_tag_get(skb)) : 0x00;
> }
>
> +static void unwind_rx_frag_mapping(struct cp_private *cp, struct sk_buff *skb,
> + int first, int entry_last)
> +{
> + int frag, index;
> + struct cp_desc *txd;
> + skb_frag_t *this_frag;
> + for (frag = 0; frag+first < entry_last; frag++) {
> + index = first+frag;
> + cp->tx_skb[index] = NULL;
> + txd = &cp->tx_ring[index];
> + this_frag = &skb_shinfo(skb)->frags[frag];
> + dma_unmap_single(&cp->pdev->dev, le64_to_cpu(txd->addr),
> + skb_frag_size(this_frag), PCI_DMA_TODEVICE);
> + }
> +}
This is using PCI_DMA_TODEVICE, so seems to be dealing with TX mappings.
Yet the function is named "unwind_rx_frame_mapping()".
> @@ -799,6 +827,11 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
> mapping = dma_map_single(&cp->pdev->dev,
> skb_frag_address(this_frag),
> len, PCI_DMA_TODEVICE);
> + if (dma_mapping_error(&cp->pdev->dev, mapping)) {
> + unwind_rx_frag_mapping(cp, skb, first_entry, entry);
> + goto out_dma_error;
> + }
And you're invoking it from the cp_start_xmit() function, which further
confirms the incorrect function name :-)
Please fix this and resubmit, thanks.
next prev parent reply other threads:[~2013-07-31 1:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 18:14 [net PATCH] 8139cp: Add dma_mapping_error checking Neil Horman
2013-07-22 21:48 ` Francois Romieu
2013-07-23 13:00 ` Neil Horman
2013-07-26 14:28 ` [net PATCH v2] " Neil Horman
2013-07-26 20:06 ` Francois Romieu
2013-07-26 20:42 ` Neil Horman
2013-07-26 21:24 ` Francois Romieu
2013-07-28 10:40 ` Neil Horman
2013-07-28 21:34 ` Francois Romieu
2013-07-28 23:34 ` Neil Horman
2013-07-29 17:05 ` [net PATCH v3] " Neil Horman
2013-07-31 1:01 ` David Miller [this message]
2013-07-31 13:03 ` [net PATCH v4] " Neil Horman
2013-08-01 0:02 ` 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=20130730.180151.2062213596812240686.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=romieu@fr.zoreil.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).