From: Darek Marcinkiewicz <reksio@newterm.pl>
To: Tobias Klauser <tklauser@distanz.ch>
Cc: davem@davemloft.net, romieu@fr.zoreil.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 1/1] Driver for Beckhoff CX5020 EtherCAT master module.
Date: Tue, 6 May 2014 22:18:15 +0200 [thread overview]
Message-ID: <20140506201815.GL1156@newterm.pl> (raw)
In-Reply-To: <20140506145606.GH6455@distanz.ch>
On Tue, May 06, 2014 at 04:56:06PM +0200, Tobias Klauser wrote:
> > + if (skb) {
> > + memcpy(skb_put(skb, pkt_size), data, pkt_size);
> > + skb->protocol = eth_type_trans(skb, priv->net_dev);
> > + dev_dbg(dev, "Protocol type: %x\n", skb->protocol);
> > +
> > + netif_rx(skb);
> > + } else {
> > + dev_err_ratelimited(dev,
> > + "Couldn't allocate a skb_buff for a packet of size %u\n",
> > + pkt_size);
> > + }
> > +
> > + priv->stat_rx_bytes += pkt_size;
>
> This should only be incremented if the packet was actually passed to
> netif_rx(), no?
Yes, I guees it should.
>
> > +
> > +static struct rtnl_link_stats64 *
> > +ec_bhf_get_stats(struct net_device *net_dev,
> > + struct rtnl_link_stats64 *stats)
> > +{
> > + struct ec_bhf_priv *priv = netdev_priv(net_dev);
> > +
> > + memset(stats, 0, sizeof(*stats));
>
> No need to memset() here, this is already done in dev_get_stats()
>
Ok, thanks. Will send updated patch.
--
DM
prev parent reply other threads:[~2014-05-06 20:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 19:10 [PATCH v8 1/1] Driver for Beckhoff CX5020 EtherCAT master module Darek Marcinkiewicz
2014-05-06 14:56 ` Tobias Klauser
2014-05-06 15:12 ` Tobias Klauser
2014-05-06 20:18 ` Darek Marcinkiewicz [this message]
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=20140506201815.GL1156@newterm.pl \
--to=reksio@newterm.pl \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
--cc=tklauser@distanz.ch \
/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).