lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181119161513.q76p2n4r7pnrbtyk@salvia>
Date:   Mon, 19 Nov 2018 17:15:13 +0100
From:   Pablo Neira Ayuso <pablo@...filter.org>
To:     Jiri Pirko <jiri@...nulli.us>
Cc:     netdev@...r.kernel.org, davem@...emloft.net,
        thomas.lendacky@....com, f.fainelli@...il.com,
        ariel.elior@...ium.com, michael.chan@...adcom.com,
        santosh@...lsio.com, madalin.bucur@....com,
        yisen.zhuang@...wei.com, salil.mehta@...wei.com,
        jeffrey.t.kirsher@...el.com, tariqt@...lanox.com,
        saeedm@...lanox.com, jiri@...lanox.com, idosch@...lanox.com,
        jakub.kicinski@...ronome.com, peppe.cavallaro@...com,
        grygorii.strashko@...com, andrew@...n.ch,
        vivien.didelot@...oirfairelinux.com, alexandre.torgue@...com,
        joabreu@...opsys.com, linux-net-drivers@...arflare.com,
        ganeshgr@...lsio.com, ogerlitz@...lanox.com
Subject: Re: [PATCH net-next,v2 05/12] cls_flower: add statistics retrieval
 infrastructure and use it

On Mon, Nov 19, 2018 at 04:04:16PM +0100, Jiri Pirko wrote:
> Mon, Nov 19, 2018 at 03:48:50PM CET, pablo@...filter.org wrote:
> >On Mon, Nov 19, 2018 at 02:57:05PM +0100, Jiri Pirko wrote:
> >> Mon, Nov 19, 2018 at 01:15:12AM CET, pablo@...filter.org wrote:
> >[...]
> >> >diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
> >> >index 7d7aefa5fcd2..7f9a8d5ca945 100644
> >> >--- a/include/net/pkt_cls.h
> >> >+++ b/include/net/pkt_cls.h
> >> >@@ -758,6 +758,12 @@ enum tc_fl_command {
> >> > 	TC_CLSFLOWER_TMPLT_DESTROY,
> >> > };
> >> > 
> >> >+struct tc_cls_flower_stats {
> >> >+	u64	pkts;
> >> >+	u64	bytes;
> >> >+	u64	lastused;
> >> >+};
> >> >+
> >> > struct tc_cls_flower_offload {
> >> > 	struct tc_cls_common_offload common;
> >> > 	enum tc_fl_command command;
> >> >@@ -765,6 +771,7 @@ struct tc_cls_flower_offload {
> >> > 	struct flow_rule rule;
> >> > 	struct tcf_exts *exts;
> >> > 	u32 classid;
> >> >+	struct tc_cls_flower_stats stats;
> >> > };
> >> > 
> >> > static inline struct flow_rule *
> >> >@@ -773,6 +780,14 @@ tc_cls_flower_offload_flow_rule(struct tc_cls_flower_offload *tc_flow_cmd)
> >> > 	return &tc_flow_cmd->rule;
> >> > }
> >> > 
> >> >+static inline void tc_cls_flower_stats_update(struct tc_cls_flower_offload *cls_flower,
> >> >+					      u64 pkts, u64 bytes, u64 lastused)
> >> >+{
> >> >+	cls_flower->stats.pkts		= pkts;
> >> >+	cls_flower->stats.bytes		= bytes;
> >> >+	cls_flower->stats.lastused	= lastused;
> >> 
> >> Why do you need to store the values here in struct tc_cls_flower_offload?
> >> Why don't you just call tcf_exts_stats_update()? Basically,
> >> tc_cls_flower_stats_update() should be just wrapper around
> >> tcf_exts_stats_update() so that drivers wouldn't use ->exts directly, as
> >> you will remove them in follow-up patches, no?
> >
> >Patch 07/12 stops exposing tc action exts to drivers, so we need a
> >structure (struct tc_cls_flower_stats) to convey this statistics back
> >to the cls_flower frontend.
> 
> Hmm, shouldn't these stats be rather flow_rule related than flower
> related?

I can rename tc_cls_flower_stats to struct flow_stats and place this
in include/net/flow.h, given flow_rule is unset / not present from the
TC_CLSFLOWER_STATS path.

Thanks for reviewing!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ