net: sched: implement action-specific terse dump
Subsystems (3)
PATCH v2 1/1 net: sched: implement action-specific terse dump
Allow user to request action terse dump with new flag value TCA_FLAG_TERSE_DUMP. Only output essential action info in terse dump (kind, stats, index and cookie, if set by the user when creating the action). This is different from filter terse dump where index is excluded (filter can be identified by its own handle).
Move tcf_action_dump_terse() function to the beginning of source file in order to call it from tcf_dump_walker().
---
Notes:
Changes V1 -> V2:
- Include cookie in action terse dump.
include/uapi/linux/rtnetlink.h | 4 ++ net/sched/act_api.c | 69 ++++++++++++++++++---------------- 2 files changed, 41 insertions(+), 32 deletions(-)
include/uapi/linux/rtnetlink.h +4 -0
@@ -770,8 +770,12 @@ enum {* actions in a dump. All dump responses will contain the number of actions * being dumped stored in for user app's consumption in TCA_ROOT_COUNT * +* TCA_FLAG_TERSE_DUMP user->kernel to request terse (brief) dump that only +* includes essential action info (kind, index, etc.) +* */ #define TCA_FLAG_LARGE_DUMP_ON (1 << 0) +#define TCA_FLAG_TERSE_DUMP (1 << 1)/* New extended info filters for IFLA_EXT_MASK */ #define RTEXT_FILTER_VF (1 << 0)
net/sched/act_api.c +37 -32
105 lines not on this page · raw message
Signature · 1 line
2.29.1
Jakub Kicinski
maintainerQuoted 11 lines · On Mon, 2 Nov 2020 22:12:43 +0200 Vlad Buslov wrote:
Allow user to request action terse dump with new flag value
TCA_FLAG_TERSE_DUMP. Only output essential action info in terse dump (kind, stats, index and cookie, if set by the user when creating the action). This is different from filter terse dump where index is excluded (filter can be identified by its own handle).Move
tcf_action_dump_terse()function to the beginning of source file in order to call it fromtcf_dump_walker().Signed-off-by Vlad Buslov <[email protected]>Suggested-by Jamal Hadi Salim <[email protected]>
Jiri, Cong, can I get an ack?
The previous terse dump made sense because it fulfilled the need of an important user (OvS). IDK if this is as clear-cut, and I haven't followed the iproute2 thread closely enough, so please weigh in.
Cong Wang
Acked-byQuoted 11 lines · Jakub Kicinski
Quoted 9 lines · On Mon, 2 Nov 2020 22:12:43 +0200 Vlad Buslov wrote:
Allow user to request action terse dump with new flag value
TCA_FLAG_TERSE_DUMP. Only output essential action info in terse dump (kind, stats, index and cookie, if set by the user when creating the action). This is different from filter terse dump where index is excluded (filter can be identified by its own handle).Move
tcf_action_dump_terse()function to the beginning of source file in order to call it fromtcf_dump_walker().
Quoted 8 lines
Quoted 2 lines
Signed-off-by Vlad Buslov <[email protected]>Suggested-by Jamal Hadi Salim <[email protected]>Jiri, Cong, can I get an ack?
The previous terse dump made sense because it fulfilled the need of an important user (OvS). IDK if this is as clear-cut, and I haven't followed the iproute2 thread closely enough, so please weigh in.
Like I said in the previous discussion, I am not a fan of terse dump, but before we have a better solution here, using this flag is probably the best we have on the table, so at least for a temporary solution:
Thanks.
Quoted 21 lines · On Wed, 4 Nov 2020 22:34:27 -0800 Cong Wang wrote:
Quoted 11 lines · Jakub Kicinski
Quoted 9 lines · On Mon, 2 Nov 2020 22:12:43 +0200 Vlad Buslov wrote:
Allow user to request action terse dump with new flag value
TCA_FLAG_TERSE_DUMP. Only output essential action info in terse dump (kind, stats, index and cookie, if set by the user when creating the action). This is different from filter terse dump where index is excluded (filter can be identified by its own handle).Move
tcf_action_dump_terse()function to the beginning of source file in order to call it fromtcf_dump_walker().Quoted 8 lines
Quoted 2 lines
Signed-off-by Vlad Buslov <[email protected]>Suggested-by Jamal Hadi Salim <[email protected]>Jiri, Cong, can I get an ack?
The previous terse dump made sense because it fulfilled the need of an important user (OvS). IDK if this is as clear-cut, and I haven't followed the iproute2 thread closely enough, so please weigh in.
Quoted 5 lines
Like I said in the previous discussion, I am not a fan of terse dump, but before we have a better solution here, using this flag is probably the best we have on the table, so at least for a temporary solution:
Acked-by Cong Wang <[email protected]>
Applied, thanks!
Jamal Hadi Salim
maintainerQuoted 10 lines · Jakub Kicinski
Quoted 9 lines · On Mon, 2 Nov 2020 22:12:43 +0200 Vlad Buslov wrote:
Allow user to request action terse dump with new flag value
TCA_FLAG_TERSE_DUMP. Only output essential action info in terse dump (kind, stats, index and cookie, if set by the user when creating the action). This is different from filter terse dump where index is excluded (filter can be identified by its own handle).Move
tcf_action_dump_terse()function to the beginning of source file in order to call it fromtcf_dump_walker().
Quoted 7 lines
Quoted 2 lines
Signed-off-by Vlad Buslov <[email protected]>Suggested-by Jamal Hadi Salim <[email protected]>Jiri, Cong, can I get an ack?
The previous terse dump made sense because it fulfilled the need of an important user (OvS).
The requirement is to save on how much data crosses between user space and the kernel. If you are polling the kernel every second for stats and you can shave say 32B per rule - it is not a big deal if you have a few rules. If you have 1M rules thats 32MB/s removed.
So how do you get the stats? You can poll the rules (which have actions that embed the stats). That approach is taken by Ovs and some others. Or you can poll the actions instead (approach we have taken to cut further on data crossing). Polling the actions has also got a lot of other features built in for this precise purpose (example time-of-use filtering).
Terse is useful in both cases because it cuts the amount of data further.
Hope that clarifies.
cheers,
jamal
Jakub Kicinski
maintainerQuoted 19 lines · On Thu, 5 Nov 2020 06:48:48 -0500 Jamal Hadi Salim wrote:
Quoted 10 lines · Jakub Kicinski
Quoted 9 lines · On Mon, 2 Nov 2020 22:12:43 +0200 Vlad Buslov wrote:
Allow user to request action terse dump with new flag value
TCA_FLAG_TERSE_DUMP. Only output essential action info in terse dump (kind, stats, index and cookie, if set by the user when creating the action). This is different from filter terse dump where index is excluded (filter can be identified by its own handle).Move
tcf_action_dump_terse()function to the beginning of source file in order to call it fromtcf_dump_walker().Quoted 7 lines
Quoted 2 lines
Signed-off-by Vlad Buslov <[email protected]>Suggested-by Jamal Hadi Salim <[email protected]>Jiri, Cong, can I get an ack?
The previous terse dump made sense because it fulfilled the need of an important user (OvS).
Quoted 13 lines
The requirement is to save on how much data crosses between user space and the kernel. If you are polling the kernel every second for stats and you can shave say 32B per rule - it is not a big deal if you have a few rules. If you have 1M rules thats 32MB/s removed.
So how do you get the stats? You can poll the rules (which have actions that embed the stats). That approach is taken by Ovs and some others. Or you can poll the actions instead (approach we have taken to cut further on data crossing). Polling the actions has also got a lot of other features built in for this precise purpose (example time-of-use filtering).
Terse is useful in both cases because it cuts the amount of data further.
Ack.