summaryrefslogtreecommitdiff
path: root/bpf.h
blob: bbd05c17c173425fee6914339f22dab91e5552c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef BPF_I_H
#define BPF_I_H

#include <linux/filter.h>
#include <stdint.h>
#include <stdlib.h>

#include "bpf_insns.h"
#include "bpf_ext.h"
#include "config.h"
#include "die.h"

extern void bpf_dump_op_table(void);
extern void bpf_dump_all(struct sock_fprog *bpf);
extern int __bpf_validate(const struct sock_fprog *bpf);
extern uint32_t bpf_run_filter(const struct sock_fprog *bpf, uint8_t *packet,
			       size_t plen);
extern void bpf_attach_to_sock(int sock, struct sock_fprog *bpf);
extern void bpf_detach_from_sock(int sock);
extern int enable_kernel_bpf_jit_compiler(void);
extern void bpf_parse_rules(char *rulefile, struct sock_fprog *bpf, uint32_t link_type);
#if defined(HAVE_TCPDUMP_LIKE_FILTER) && defined(NEED_TCPDUMP_LIKE_FILTER)
extern void bpf_try_compile(const char *rulefile, struct sock_fprog *bpf,
			    uint32_t link_type);
#else
static inline void bpf_try_compile(const char *rulefile,
				   struct sock_fprog *bpf __maybe_unused,
				   uint32_t link_type __maybe_unused)
{
	panic("Cannot open file %s!\n", rulefile);
}
#endif
static inline void bpf_release(struct sock_fprog *bpf)
{
	free(bpf->filter);
}

#endif /* BPF_I_H */
mple, any time the guest is suspended (and | thus cannot poll) does count as stolen time. This patch fixes it by reducing steal time from idle time accounting when the noirqtime parameter is true. The average idle time drops from 56.8% to 54.75% for nohz idle kvm guest(noirqtime, idle=poll, four vCPUs running on one pCPU). Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Radim <rkrcmar@redhat.com> Cc: Rik van Riel <riel@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1470893795-3527-1-git-send-email-wanpeng.li@hotmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat