diff options
Diffstat (limited to 'samples/bpf/xdp_tx_iptunnel_user.c')
-rw-r--r-- | samples/bpf/xdp_tx_iptunnel_user.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/samples/bpf/xdp_tx_iptunnel_user.c b/samples/bpf/xdp_tx_iptunnel_user.c index 92b8bde9337c..715cd12eaca5 100644 --- a/samples/bpf/xdp_tx_iptunnel_user.c +++ b/samples/bpf/xdp_tx_iptunnel_user.c | |||
@@ -79,6 +79,8 @@ static void usage(const char *cmd) | |||
79 | printf(" -m <dest-MAC> Used in sending the IP Tunneled pkt\n"); | 79 | printf(" -m <dest-MAC> Used in sending the IP Tunneled pkt\n"); |
80 | printf(" -T <stop-after-X-seconds> Default: 0 (forever)\n"); | 80 | printf(" -T <stop-after-X-seconds> Default: 0 (forever)\n"); |
81 | printf(" -P <IP-Protocol> Default is TCP\n"); | 81 | printf(" -P <IP-Protocol> Default is TCP\n"); |
82 | printf(" -S use skb-mode\n"); | ||
83 | printf(" -N enforce native mode\n"); | ||
82 | printf(" -h Display this help\n"); | 84 | printf(" -h Display this help\n"); |
83 | } | 85 | } |
84 | 86 | ||
@@ -138,7 +140,7 @@ int main(int argc, char **argv) | |||
138 | { | 140 | { |
139 | unsigned char opt_flags[256] = {}; | 141 | unsigned char opt_flags[256] = {}; |
140 | unsigned int kill_after_s = 0; | 142 | unsigned int kill_after_s = 0; |
141 | const char *optstr = "i:a:p:s:d:m:T:P:Sh"; | 143 | const char *optstr = "i:a:p:s:d:m:T:P:SNh"; |
142 | int min_port = 0, max_port = 0; | 144 | int min_port = 0, max_port = 0; |
143 | struct iptnl_info tnl = {}; | 145 | struct iptnl_info tnl = {}; |
144 | struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY}; | 146 | struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY}; |
@@ -206,6 +208,9 @@ int main(int argc, char **argv) | |||
206 | case 'S': | 208 | case 'S': |
207 | xdp_flags |= XDP_FLAGS_SKB_MODE; | 209 | xdp_flags |= XDP_FLAGS_SKB_MODE; |
208 | break; | 210 | break; |
211 | case 'N': | ||
212 | xdp_flags |= XDP_FLAGS_DRV_MODE; | ||
213 | break; | ||
209 | default: | 214 | default: |
210 | usage(argv[0]); | 215 | usage(argv[0]); |
211 | return 1; | 216 | return 1; |
@@ -239,6 +244,7 @@ int main(int argc, char **argv) | |||
239 | } | 244 | } |
240 | 245 | ||
241 | signal(SIGINT, int_exit); | 246 | signal(SIGINT, int_exit); |
247 | signal(SIGTERM, int_exit); | ||
242 | 248 | ||
243 | while (min_port <= max_port) { | 249 | while (min_port <= max_port) { |
244 | vip.dport = htons(min_port++); | 250 | vip.dport = htons(min_port++); |