All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	nogahf@mellanox.com, Ido Schimmel <idosch@mellanox.com>,
	eladr@mellanox.com, yotamg@mellanox.com, ogerlitz@mellanox.com,
	Roopa Prabhu <roopa@cumulusnetworks.com>,
	linville@tuxdriver.com, tgraf@suug.ch,
	Andy Gospodarek <gospo@cumulusnetworks.com>,
	sfeldma@gmail.com, sd@queasysnail.net, eranbe@mellanox.com,
	ast@plumgrid.com, edumazet@google.com,
	hannes@stressinduktion.org, f.fainelli@gmail.com,
	dsa@cumulusnetworks.com
Subject: Re: [patch net-next v9 2/3] net: core: Add offload stats to if_stats_msg
Date: Fri, 16 Sep 2016 11:00:46 +0300	[thread overview]
Message-ID: <6226A529-D83B-4B77-8091-E6E8528B0063@cumulusnetworks.com> (raw)
In-Reply-To: <1473845322-16679-3-git-send-email-jiri@resnulli.us>


> On Sep 14, 2016, at 12:28 PM, Jiri Pirko <jiri@resnulli.us> wrote:
> 
> From: Nogah Frankel <nogahf@mellanox.com>
> 
> Add a nested attribute of offload stats to if_stats_msg
> named IFLA_STATS_LINK_OFFLOAD_XSTATS.
> Under it, add SW stats, meaning stats only per packets that went via
> slowpath to the cpu, named IFLA_OFFLOAD_XSTATS_CPU_HIT.
> 
> Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
> include/uapi/linux/if_link.h |   9 ++++
> net/core/rtnetlink.c         | 111 +++++++++++++++++++++++++++++++++++++++++--
> 2 files changed, 116 insertions(+), 4 deletions(-)
> 
[snip]
> @@ -3655,6 +3737,24 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
> 		}
> 	}
> 
> +	if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS,
> +			     *idxattr)) {
> +		*idxattr = IFLA_STATS_LINK_OFFLOAD_XSTATS;
> +		attr = nla_nest_start(skb, IFLA_STATS_LINK_OFFLOAD_XSTATS);
> +		if (!attr)
> +			goto nla_put_failure;
> +
> +		err = rtnl_get_offload_stats(skb, dev, prividx);
> +		if (err == -ENODATA)
> +			nla_nest_cancel(skb, attr);
> +		else
> +			nla_nest_end(skb, attr);
> +
> +		if ((err) && (err != -ENODATA))
                       ^^^^       ^^^^^^^^^^^^^^^^^^
The extra braces are still there. [1]
The rest looks good to me.

Thanks,
 Nik

[1] http://www.spinics.net/lists/netdev/msg394257.html

> +			goto nla_put_failure;
> +		*idxattr = 0;
> +	}
> +
> 	nlmsg_end(skb, nlh);
> 
> 	return 0;
> @@ -3708,6 +3808,9 @@ static size_t if_nlmsg_stats_size(const struct net_device *dev,
> 		}
> 	}
> 
> +	if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS, 0))
> +		size += rtnl_get_offload_stats_size(dev);
> +
> 	return size;
> }
> 
> -- 
> 2.5.5
> 

  reply	other threads:[~2016-09-16  8:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  9:28 [patch net-next v9 0/3] return offloaded stats as default and expose original sw stats Jiri Pirko
2016-09-14  9:28 ` [patch net-next v9 1/3] netdevice: Add offload statistics ndo Jiri Pirko
2016-09-14  9:28 ` [patch net-next v9 2/3] net: core: Add offload stats to if_stats_msg Jiri Pirko
2016-09-16  8:00   ` Nikolay Aleksandrov [this message]
2016-09-16  8:07     ` Jiri Pirko
2016-09-14  9:28 ` [patch net-next v9 3/3] mlxsw: spectrum: Implement offload stats ndo and expose HW stats by default Jiri Pirko

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=6226A529-D83B-4B77-8091-E6E8528B0063@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=edumazet@google.com \
    --cc=eladr@mellanox.com \
    --cc=eranbe@mellanox.com \
    --cc=f.fainelli@gmail.com \
    --cc=gospo@cumulusnetworks.com \
    --cc=hannes@stressinduktion.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=nogahf@mellanox.com \
    --cc=ogerlitz@mellanox.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=sd@queasysnail.net \
    --cc=sfeldma@gmail.com \
    --cc=tgraf@suug.ch \
    --cc=yotamg@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.