On Tue, Mar 19, 2013 at 16:10 +0100, Martin Pelikan wrote:
> Hi!
>
> Yesterday I got sick and tired of guessing what the enormous traffic in our
> default queue was, and filled an item from my wishlist since OpenBSD 4.7.
>
> It works like this:
>
> # tcpdump -Q queuename -ni em0
> tcpdump: listening on vic0, queue a, link-type EN10MB
> ... usual output ...
>
> This mail contains changes required to the kernel, subsequent ones have the
> (most complicated) tcpdump(8) bit and (untested) pcap(3) bit.
>
> Any thoughts? I find it extremely useful and very small change. Will test it
> on a system with thousands of queues, but don't expect anything bad with it.
> --
> Martin Pelikan
>
i think it makes sense, especially since qid field already exists in
the packet header.
> Index: net/bpf.h
> ===================================================================
> RCS file: /cvs/src/sys/net/bpf.h,v
> retrieving revision 1.43
> diff -u -p -r1.43 bpf.h
> --- net/bpf.h 26 Mar 2012 19:37:42 -0000 1.43
> +++ net/bpf.h 19 Mar 2013 14:54:48 -0000
> @@ -119,6 +119,8 @@ struct bpf_version {
> #define BIOCGDLTLIST _IOWR('B',123, struct bpf_dltlist)
> #define BIOCGDIRFILT _IOR('B',124, u_int)
> #define BIOCSDIRFILT _IOW('B',125, u_int)
> +#define BIOCGQUEUE _IOR('B',126, u_int32_t)
> +#define BIOCSQUEUE _IOW('B',127, u_int32_t)
>
these ioctls can take u_int to be consistent with how you're using
them.