All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 net-next 0/3] flow_offload: Re-add per-action statistics
@ 2019-05-22 21:37 Edward Cree
  2019-05-22 21:38 ` [PATCH v3 net-next 1/3] flow_offload: add a cookie to flow_action_entry Edward Cree
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Edward Cree @ 2019-05-22 21:37 UTC (permalink / raw)
  To: Jamal Hadi Salim, Jiri Pirko, Pablo Neira Ayuso, David Miller
  Cc: netdev, Cong Wang, Andy Gospodarek, Jakub Kicinski, Michael Chan,
	Vishal Kulkarni

When the flow_offload infrastructure was added, per-action statistics,
 which were previously possible for drivers to support in TC offload,
 were not plumbed through, perhaps because the drivers in the tree did
 not implement them.
In TC (and in the previous offload API) statistics are per-action,
 though generally only on 'delivery' actions like mirred, ok and shot.
 Actions also have an index, which may be supplied by the user, which
 allows the sharing of entities such as counters between multiple rules.
 (These indices are per action type, so 'drop index 1' and 'mirred index
 1' are different actions.  However, this means that a mirror and a
 redirect action are in the same index namespace, since they're both
 mirred actions.)  The existing driver implementations did not support
 this, however, instead allocating a single counter per rule.  The
 flow_offload API did not support this either, as (a) the information
 that two actions were actually the same action never reached the
 driver, and (b) the TC_CLSFLOWER_STATS callback was only able to return
 a single set of stats which were added to all counters for actions on
 the rule.  Patch #1 of this series fixes (a) by adding a cookie member
 to struct flow_action_entry, while patch #2 fixes (b) by changing the
 .stats member of struct tc_cls_flower_offload from a single set of
 stats to an array.  Existing drivers are changed to retain their
 current behaviour, by adding their one set of stats to every element of
 this array (note however that this will behave oddly if an action
 appears more than once on a rule; I'm not sure whether that's a
 problem).  I have not tested these driver changes on corresponding
 hardware.
Patch #3 ensures that flow_offload.h is buildable in isolation, rather
 than relying on linux/kernel.h having already been included elsewhere;
 this is logically separable from the rest of the series.

Changed in v3:
* replaced action_index with cookie, so drivers don't have to look at
  flow_action_id to distinguish shared actions
* removed RFC tags

Changed in v2:
* use array instead of new callback for getting stats
* remove CVLAN patch (posted separately for net)
* add header inclusion fix

Edward Cree (3):
  flow_offload: add a cookie to flow_action_entry
  flow_offload: restore ability to collect separate stats per action
  flow_offload: include linux/kernel.h from flow_offload.h

 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c     |  6 ++++--
 .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 10 ++++++----
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c  |  4 +++-
 .../ethernet/mellanox/mlxsw/spectrum_flower.c    |  5 +++--
 .../net/ethernet/netronome/nfp/flower/offload.c  |  8 ++++++--
 .../net/ethernet/netronome/nfp/flower/qos_conf.c |  6 ++++--
 include/net/flow_offload.h                       | 13 +++++++++++--
 include/net/pkt_cls.h                            | 13 +++++++++----
 net/core/flow_offload.c                          | 16 ++++++++++++++++
 net/sched/cls_api.c                              |  1 +
 net/sched/cls_flower.c                           |  9 ++++++---
 net/sched/cls_matchall.c                         |  7 +++++--
 12 files changed, 74 insertions(+), 24 deletions(-)


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-05-29 20:11 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 21:37 [PATCH v3 net-next 0/3] flow_offload: Re-add per-action statistics Edward Cree
2019-05-22 21:38 ` [PATCH v3 net-next 1/3] flow_offload: add a cookie to flow_action_entry Edward Cree
2019-05-22 21:38 ` [PATCH v3 net-next 2/3] flow_offload: restore ability to collect separate stats per action Edward Cree
2019-05-22 21:38 ` [PATCH v3 net-next 3/3] flow_offload: include linux/kernel.h from flow_offload.h Edward Cree
2019-05-22 22:20 ` [PATCH v3 net-next 0/3] flow_offload: Re-add per-action statistics Jakub Kicinski
2019-05-23 13:19   ` Jamal Hadi Salim
2019-05-23 16:11     ` Jakub Kicinski
2019-05-23 16:40       ` Edward Cree
2019-05-23 17:25         ` Jakub Kicinski
2019-05-24 13:09           ` Edward Cree
2019-05-24 13:57             ` Edward Cree
2019-05-24 14:44               ` Jamal Hadi Salim
2019-05-24 15:09                 ` Edward Cree
2019-05-24 17:59                   ` Jamal Hadi Salim
2019-05-24 17:03               ` Jakub Kicinski
2019-05-24 17:27                 ` Edward Cree
2019-05-24 17:44                   ` Jakub Kicinski
2019-05-28 16:27                     ` Edward Cree
2019-05-29 20:07             ` [RFC PATCH net-next 0/2] RTM_GETACTION stats offload Edward Cree
2019-05-29 20:10               ` [RFC PATCH net-next 1/2] net/sched: add callback to get stats on an action from clsflower offload Edward Cree
2019-05-29 20:11               ` [RFC PATCH net-next 2/2] net/sched: add action block binding to other classifiers Edward Cree
2019-05-23 16:21   ` [PATCH v3 net-next 0/3] flow_offload: Re-add per-action statistics Edward Cree
2019-05-23 16:33     ` Jakub Kicinski
2019-05-23 17:09       ` Edward Cree

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.