diff options
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
| -rwxr-xr-x | scripts/bpf_helpers_doc.py | 21 | 
1 files changed, 20 insertions, 1 deletions
diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py index 91fa668fa860..5bfa448b4704 100755 --- a/scripts/bpf_helpers_doc.py +++ b/scripts/bpf_helpers_doc.py @@ -404,6 +404,7 @@ class PrinterHelpers(Printer):      type_fwds = [              'struct bpf_fib_lookup', +            'struct bpf_sk_lookup',              'struct bpf_perf_event_data',              'struct bpf_perf_event_value',              'struct bpf_pidns_info', @@ -421,6 +422,12 @@ class PrinterHelpers(Printer):              'struct sockaddr',              'struct tcphdr',              'struct seq_file', +            'struct tcp6_sock', +            'struct tcp_sock', +            'struct tcp_timewait_sock', +            'struct tcp_request_sock', +            'struct udp6_sock', +            'struct task_struct',              'struct __sk_buff',              'struct sk_msg_md', @@ -444,6 +451,7 @@ class PrinterHelpers(Printer):              'struct bpf_perf_event_data',              'struct bpf_perf_event_value',              'struct bpf_pidns_info', +            'struct bpf_sk_lookup',              'struct bpf_sock',              'struct bpf_sock_addr',              'struct bpf_sock_ops', @@ -458,6 +466,12 @@ class PrinterHelpers(Printer):              'struct sockaddr',              'struct tcphdr',              'struct seq_file', +            'struct tcp6_sock', +            'struct tcp_sock', +            'struct tcp_timewait_sock', +            'struct tcp_request_sock', +            'struct udp6_sock', +            'struct task_struct',      }      mapped_types = {              'u8': '__u8', @@ -475,6 +489,11 @@ class PrinterHelpers(Printer):              'struct sk_msg_buff': 'struct sk_msg_md',              'struct xdp_buff': 'struct xdp_md',      } +    # Helpers overloaded for different context types. +    overloaded_helpers = [ +        'bpf_get_socket_cookie', +        'bpf_sk_assign', +    ]      def print_header(self):          header = '''\ @@ -531,7 +550,7 @@ class PrinterHelpers(Printer):          for i, a in enumerate(proto['args']):              t = a['type']              n = a['name'] -            if proto['name'] == 'bpf_get_socket_cookie' and i == 0: +            if proto['name'] in self.overloaded_helpers and i == 0:                      t = 'void'                      n = 'ctx'              one_arg = '{}{}'.format(comma, self.map_type(t))  | 
