public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: roopa <roopa@cumulusnetworks•com>
To: "Rosen, Rami" <rami.rosen@intel•com>
Cc: "netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	"jhs@mojatatu•com" <jhs@mojatatu•com>
Subject: Re: [PATCH net-next RFC] rtnetlink: add new RTM_GETSTATS to dump link stats
Date: Wed, 24 Feb 2016 20:59:33 -0800	[thread overview]
Message-ID: <56CE8A35.4090503@cumulusnetworks.com> (raw)
In-Reply-To: <9B0331B6EBBD0E4684FBFAEDA55776F92CB7E894@HASMSX110.ger.corp.intel.com>

On 2/23/16, 1:26 AM, Rosen, Rami wrote:
> Hi,
>
> +	if (!dev)
> +		return -ENODEV;
> +
> +	nskb = nlmsg_new(if_nlmsg_stats_size(dev), GFP_KERNEL);
> +	if (!nskb)
> +		return -ENOBUFS;
> +
> +	err = rtnl_fill_statsinfo(nskb, dev, RTM_NEWSTATS,
> +				  NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0, 0);
> +	if (err < 0) {
>
> It should be here:  -EMSGSIZE implies BUG in if_nlmsg_stats_size  (instead of if_nlmsg_size)
>
> +		/* -EMSGSIZE implies BUG in if_nlmsg_size */
> +		WARN_ON(err == -EMSGSIZE);
> +		kfree_skb(nskb);
> +	} else {
> +		err = rtnl_unicast(nskb, net, NETLINK_CB(skb).portid);
> +	}
>
>
> Other than that, it seems ok, thanks for this patch!
>
>
will fix it, thanks for the review.

  reply	other threads:[~2016-02-25  4:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  6:01 [PATCH net-next RFC] rtnetlink: add new RTM_GETSTATS to dump link stats Roopa Prabhu
2016-02-23  9:26 ` Rosen, Rami
2016-02-25  4:59   ` roopa [this message]
2016-02-24 21:40 ` David Miller
2016-02-25  5:25   ` roopa
2016-02-25 16:26     ` David Miller
2016-02-26  5:01       ` roopa

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=56CE8A35.4090503@cumulusnetworks.com \
    --to=roopa@cumulusnetworks$(echo .)com \
    --cc=jhs@mojatatu$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=rami.rosen@intel$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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