Logo
Explore Help
Register Sign In
leandrof/linux
1
0
Fork 0
You've already forked linux
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
22db095d57b51ff71aaa8ddba515180399f54334
linux/tools/testing/selftests/bpf/test_tcpnotify.h

20 lines
273 B
C
Raw Normal View History

selftests/bpf: add a test case for sock_ops perf-event notification This patch provides a tcp_bpf based eBPF sample. The test - ncat(1) as the TCP client program to connect() to a port with the intention of triggerring SYN retransmissions: we first install an iptables DROP rule to make sure ncat SYNs are resent (instead of aborting instantly after a TCP RST) - has a bpf kernel module that sends a perf-event notification for each TCP retransmit, and also tracks the number of such notifications sent in the global_map The test passes when the number of event notifications intercepted in user-space matches the value in the global_map. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-11-07 16:12:02 -08:00
// SPDX-License-Identifier: GPL-2.0
#ifndef _TEST_TCPBPF_H
#define _TEST_TCPBPF_H
struct tcpnotify_globals {
__u32 total_retrans;
__u32 ncalls;
};
struct tcp_notifier {
__u8 type;
__u8 subtype;
__u8 source;
__u8 hash;
};
#define TESTPORT 12877
#endif
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.1 Page: 519ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API