diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2017-01-24 03:57:36 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2017-01-24 03:57:36 +0000 |
commit | 38e410c3ec2b9ed68bafb194f1a842cc049bc486 (patch) | |
tree | 04130c870954194face9f3e0397be2ded92d2471 /sys/net/if_var.h | |
parent | d9fc778f44a5b33d674263219b50b7126e81c30c (diff) |
add support for multiple transmit ifqueues per network interface.
an ifq to transmit a packet is picked by the current traffic
conditioner (ie, priq or hfsc) by providing an index into an array
of ifqs. by default interfaces get a single ifq but can ask for
more using if_attach_queues().
the vast majority of our drivers still think there's a 1:1 mapping
between interfaces and transmit queues, so their if_start routines
take an ifnet pointer instead of a pointer to the ifqueue struct.
instead of changing all the drivers in the tree, drivers can opt
into using an if_qstart routine and setting the IFXF_MPSAFE flag.
the stack provides a compatability wrapper from the new if_qstart
handler to the previous if_start handlers if IFXF_MPSAFE isnt set.
enabling hfsc on an interface configures it to transmit everything
through the first ifq. any other ifqs are left configured as priq,
but unused, when hfsc is enabled.
getting this in now so everyone can kick the tyres.
ok mpi@ visa@ (who provided some tweaks for cnmac).
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r-- | sys/net/if_var.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 3059acef552..dab939a648c 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_var.h,v 1.79 2017/01/21 01:32:19 patrick Exp $ */ +/* $OpenBSD: if_var.h,v 1.80 2017/01/24 03:57:35 dlg Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -157,7 +157,12 @@ struct ifnet { /* and the entries */ /* timer routine */ void (*if_watchdog)(struct ifnet *); int (*if_wol)(struct ifnet *, int); - struct ifqueue if_snd; /* output queue */ + + struct ifqueue if_snd; /* transmit queue */ + struct ifqueue **if_ifqs; /* pointer to an array of sndqs */ + void (*if_qstart)(struct ifqueue *); + unsigned int if_nifqs; + struct sockaddr_dl *if_sadl; /* pointer to our sockaddr_dl */ void *if_afdata[AF_MAX]; |