Re: [RFC bpf-next 2/7] bpf: extend bpf_pcap support to tracing programs

2019-09-10 Thread Yonghong Song
On 9/9/19 11:25 PM, Alan Maguire wrote: > On Sun, 8 Sep 2019, Yonghong Song wrote: > >> For net side bpf_perf_event_output, we have >> static unsigned long bpf_skb_copy(void *dst_buff, const void *skb, >> unsigned long off, unsigned long len) >> { >>

Re: [RFC bpf-next 2/7] bpf: extend bpf_pcap support to tracing programs

2019-09-09 Thread Alan Maguire
On Sun, 8 Sep 2019, Yonghong Song wrote: > For net side bpf_perf_event_output, we have > static unsigned long bpf_skb_copy(void *dst_buff, const void *skb, >unsigned long off, unsigned long len) > { > void *ptr = skb_header_pointer(skb, off, len, dst_b

Re: [RFC bpf-next 2/7] bpf: extend bpf_pcap support to tracing programs

2019-09-08 Thread Yonghong Song
On 9/7/19 2:40 PM, Alan Maguire wrote: > packet capture is especially valuable in tracing contexts, so > extend bpf_pcap helper to take a tracing-derived skb pointer > as an argument. > > In the case of tracing programs, the starting protocol > (corresponding to libpcap DLT_* values; 1 for Ether

[RFC bpf-next 2/7] bpf: extend bpf_pcap support to tracing programs

2019-09-07 Thread Alan Maguire
packet capture is especially valuable in tracing contexts, so extend bpf_pcap helper to take a tracing-derived skb pointer as an argument. In the case of tracing programs, the starting protocol (corresponding to libpcap DLT_* values; 1 for Ethernet, 12 for IP, etc) needs to be specified and should