* Zero out the various packet counters associated with all of the bpf * descriptors. At some point, we will probably want to get a bit more * granular and allow the user to specify descriptors to be zeroed. */
| 2874 | * granular and allow the user to specify descriptors to be zeroed. |
| 2875 | */ |
| 2876 | static void |
| 2877 | bpf_zero_counters(void) |
| 2878 | { |
| 2879 | struct bpf_if *bp; |
| 2880 | struct bpf_d *bd; |
| 2881 | |
| 2882 | BPF_LOCK(); |
| 2883 | /* |
| 2884 | * We are protected by global lock here, interfaces and |
| 2885 | * descriptors can not be deleted while we hold it. |
| 2886 | */ |
| 2887 | CK_LIST_FOREACH(bp, &bpf_iflist, bif_next) { |
| 2888 | CK_LIST_FOREACH(bd, &bp->bif_dlist, bd_next) { |
| 2889 | counter_u64_zero(bd->bd_rcount); |
| 2890 | counter_u64_zero(bd->bd_dcount); |
| 2891 | counter_u64_zero(bd->bd_fcount); |
| 2892 | counter_u64_zero(bd->bd_wcount); |
| 2893 | counter_u64_zero(bd->bd_wfcount); |
| 2894 | counter_u64_zero(bd->bd_zcopy); |
| 2895 | } |
| 2896 | } |
| 2897 | BPF_UNLOCK(); |
| 2898 | } |
| 2899 | |
| 2900 | /* |
| 2901 | * Fill filter statistics |
no test coverage detected