Although matchall always matches packets, however, it still relies on a protocol match first. So it is still useful to have such a counter for matchall. Of course, unlike u32, every time we hit a matchall filter, it is always a success, so we don't have to distinguish them. Sample output: filter protocol 802.1Q pref 100 matchall chain 0 filter protocol 802.1Q pref 100 matchall chain 0 handle 0x1 not_in_hw (rule hit 10) action order 1: vlan pop continue index 1 ref 1 bind 1 installed 40 sec used 1 sec Action statistics: Sent 836 bytes 10 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -527,11 +527,17 @@ enum { · 526 unmodified lines | ||
| 527 | 527 | |
| 528 | 528 | /* Match-all classifier */ |
| 529 | 529 | |
| 530 | +struct tc_matchall_pcnt { | |
| 531 | + __u64 rhit; | |
| 532 | +}; | |
| 533 | + | |
| 530 | 534 | enum { |
| 531 | 535 | TCA_MATCHALL_UNSPEC, |
| 532 | 536 | TCA_MATCHALL_CLASSID, |
| 533 | 537 | TCA_MATCHALL_ACT, |
| 534 | 538 | TCA_MATCHALL_FLAGS, |
| 539 | + TCA_MATCHALL_PCNT, | |
| 540 | + TCA_MATCHALL_PAD, | |
| 535 | 541 | __TCA_MATCHALL_MAX, |
| 536 | 542 | }; |
| 537 | 543 | |