netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [net PATCH v2] 8139cp: Add dma_mapping_error checking
Date: Fri, 26 Jul 2013 23:24:03 +0200	[thread overview]
Message-ID: <20130726212403.GA25674@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <20130726204245.GD11633@hmsreliant.think-freely.org>

Neil Horman <nhorman@tuxdriver.com> :
> On Fri, Jul 26, 2013 at 10:06:30PM +0200, Francois Romieu wrote:
> > Neil Horman <nhorman@tuxdriver.com> :
[...]
> > > @@ -533,6 +533,11 @@ rx_status_loop:
> > >  
> > >  		mapping = dma_map_single(&cp->pdev->dev, new_skb->data, buflen,
> > >  					 PCI_DMA_FROMDEVICE);
> > > +		if (dma_mapping_error(&cp->pdev->dev, mapping)) {
> > > +			kfree_skb(skb);
> > 
> > 			dev->stats.rx_dropped++;
> > 
> > Sorry, I did not notice that skb contained newly received data :o/
> > 
> Yeah, this isn't needed.  The skb being mapped in is newly allocated, and
> contains no data.  We haven't dropped anything here, so theres no need for the
> stats bump.

Huh ?

[...error path...]
		kfree(skb);
[...normal path...]
	cp_rx_skb(cp, skb, desc);

Afaiks it's the same skb. We drop data and a stats bump is needed.

[...]
> Thoughts?

Nevermind. cp_start_xmit is a piece of it and it isn't your work to
turn it into something sensible.

-- 
Ueimor

  reply	other threads:[~2013-07-26 21:24 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 [this message]
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
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=20130726212403.GA25674@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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).