On Thu, Jun 08, 2017 at 02:46:22PM +0300, Roi Dayan wrote: > Add tc helper functions to query and manipulate the flower classifier. > > Signed-off-by: Paul Blakey <pa...@mellanox.com> > Co-authored-by: Roi Dayan <r...@mellanox.com> > Signed-off-by: Roi Dayan <r...@mellanox.com>
Acked-by: Flavio Leitner <f...@sysclose.org> Not sure why SCTP wasn't implemented, but not a blocker either. > --- a/lib/tc.c > +++ b/lib/tc.c [...] > + > +#define JIFFIES_TO_MS(x) (x * 10) > +}; Thanks for fixing this > +static void > +nl_parse_tcf(const struct tcf_t *tm, struct tc_flower *flower) > +{ > + flower->lastused = time_msec() - JIFFIES_TO_MS(tm->lastuse); > +} > + And this, much better. > + bs = nl_attr_get_unspec(stats_attrs[TCA_STATS_BASIC], sizeof *bs); > + put_32aligned_u64(&stats->n_packets, bs->packets); > + put_32aligned_u64(&stats->n_bytes, bs->bytes); > +int > +tc_dump_flower_start(int ifindex, struct nl_dump *dump) > +{ > + struct ofpbuf request; > + struct tcmsg *tcmsg; > + > + tcmsg = tc_make_request(ifindex, RTM_GETTFILTER, NLM_F_DUMP, &request); > + tcmsg->tcm_parent = TC_H_MAKE(TC_H_CLSACT, TC_H_MIN_INGRESS); But that went in an opposite direction of the previous patch because it is used like 5 times and it could be a define in tc.h leaving the TC details hidden in there. -- Flavio _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev