/* Copyright (c) 2016 PLUMgrid * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ #include #include #include #include #include #include #include #include #include "bpf_load.h" #include "bpf_util.h" #include "libbpf.h" static int ifindex; static void int_exit(int sig) { set_link_xdp_fd(ifindex, -1); exit(0); } /* simple per-protocol drop counter */ static void poll_stats(int interval) { unsigned int nr_cpus = bpf_num_possible_cpus(); const unsigned int nr_keys = 256; __u64 values[nr_cpus], prev[nr_keys][nr_cpus]; __u32 key; int i; memset(prev, 0, sizeof(prev)); while (1) { sleep(interval); for (key = 0; key < nr_keys; key++) { __u64 sum = 0; assert(bpf_map_lookup_elem(map_fd[0], &key, values) == 0); for (i = 0; i < nr_cpus; i++) sum += (values[i] - prev[key][i]); if (sum) printf("proto %u: %10llu pkt/s\n", key, sum / interval); memcpy(prev[key], values, sizeof(values)); } } } int main(int ac, char **argv) { char filename[256]; snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); if (ac != 2) { printf("usage: %s IFINDEX\n", argv[0]); return 1; } ifindex = strtoul(argv[1], NULL, 0); if (load_bpf_file(filename)) { printf("%s", bpf_log_buf); return 1; } if (!prog_fd[0]) { printf("load_bpf_file: %s\n", strerror(errno)); return 1; } signal(SIGINT, int_exit); if (set_link_xdp_fd(ifindex, prog_fd[0]) < 0) { printf("link set xdp fd failed\n"); return 1; } poll_stats(2); return 0; } nux/net-next.git/log/sound/oss?h=nds-private-remove'>logtreecommitdiff
path: root/sound/oss
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-01-18 21:31:31 +0100
committerJohan Hovold <johan@kernel.org>2017-01-19 09:08:37 +0100
commit24d615a694d649aa2e167c3f97f62bdad07e3f84 (patch)
tree2fe33c115bdec6bf4b01e27afd90bb16fa668e22 /sound/oss
parent49def1853334396f948dcb4cedb9347abb318df5 (diff)
USB: serial: qcserial: add Dell DW5570 QDL
The Dell DW5570 is a re-branded Sierra Wireless MC8805 which will by default boot with vid 0x413c and pid 0x81a3. When triggered QDL download mode, the device switches to pid 0x81a6 and provides the standard TTY used for firmware upgrade. Cc: <stable@vger.kernel.org> Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'sound/oss')