summaryrefslogtreecommitdiff
path: root/sys/net/if.h
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2008-04-10 23:15:46 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2008-04-10 23:15:46 +0000
commitca31726a0b98ca5ca3caaf50a8f5ca284988eb81 (patch)
tree48f39439a52434c61ba8601f48b4342f835a7b75 /sys/net/if.h
parent809a2c5adf7ac3bbd6d750fd38725a635cd2a0c4 (diff)
introduce mitigation for the calling of an interfaces start routine.
decent drivers prefer to have a lot of packets on the send queue so they can queue a lot of them up on the tx ring and then post them all in one big chunk. unfortunately our stack queues one packet onto the send queue and then calls the start handler immediately. this mitigates against that queue, send, queue, send behaviour by trying to call the start routine only once per softnet. now its queue, queue, queue, send. this is the result of a lot of discussion with claudio@ tested by many.
Diffstat (limited to 'sys/net/if.h')
-rw-r--r--sys/net/if.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/if.h b/sys/net/if.h
index c2adb9e9a36..21dc8f31e4f 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.h,v 1.93 2007/11/18 12:51:48 mpf Exp $ */
+/* $OpenBSD: if.h,v 1.94 2008/04/10 23:15:45 dlg Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -178,6 +178,7 @@ TAILQ_HEAD(ifnet_head, ifnet); /* the actual queue head */
struct ifnet { /* and the entries */
void *if_softc; /* lower-level data for this if */
TAILQ_ENTRY(ifnet) if_list; /* all struct ifnets are chained */
+ TAILQ_ENTRY(ifnet) if_txlist; /* list of ifnets ready to tx */
TAILQ_HEAD(, ifaddr) if_addrlist; /* linked list of addresses per if */
TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */
struct hook_desc_head *if_addrhooks; /* address change callbacks */
@@ -198,6 +199,7 @@ struct ifnet { /* and the entries */
u_short if_index; /* numeric abbreviation for this if */
short if_timer; /* time 'til if_watchdog called */
short if_flags; /* up/down, broadcast, etc. */
+ int if_xflags; /* extra softnet flags */
struct if_data if_data; /* stats and other data about if */
u_int32_t if_hardmtu; /* maximum MTU device supports */
int if_capabilities; /* interface capabilities */
@@ -265,6 +267,8 @@ struct ifnet { /* and the entries */
(IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI)
+#define IFXF_TXREADY 0x1 /* interface is ready to tx */
+
/*
* Some convenience macros used for setting ifi_baudrate.
*/
@@ -775,6 +779,7 @@ int if_addgroup(struct ifnet *, const char *);
int if_delgroup(struct ifnet *, const char *);
void if_group_routechange(struct sockaddr *, struct sockaddr *);
struct ifnet *ifunit(const char *);
+void if_start(struct ifnet *);
struct ifaddr *ifa_ifwithaddr(struct sockaddr *);
struct ifaddr *ifa_ifwithaf(int);