summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_em.h
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-01-07 03:56:04 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-01-07 03:56:04 +0000
commit123675a59db858f699178da64e6d40ac20f4c13d (patch)
treed902c981baa73110899d28cf3ad87606631ceba6 /sys/dev/pci/if_em.h
parent018837064d616decd74228f706525e42a904641c (diff)
tweak em to make it mpsafe, both for interrupts and if_start.
this is mostly work by kettenis and claudio, with further work from me to make the transmit side from the stack mpsafe. there's a watchdog issue that will be worked on in tree after this change. tested by hrvoje popovski and gregor best ok mpi@ claudio@ deraadt@ jmatthew@
Diffstat (limited to 'sys/dev/pci/if_em.h')
-rw-r--r--sys/dev/pci/if_em.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index df25f36004c..40a8ef4d47f 100644
--- a/sys/dev/pci/if_em.h
+++ b/sys/dev/pci/if_em.h
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/* $FreeBSD: if_em.h,v 1.26 2004/09/01 23:22:41 pdeuskar Exp $ */
-/* $OpenBSD: if_em.h,v 1.61 2015/11/24 17:11:39 mpi Exp $ */
+/* $OpenBSD: if_em.h,v 1.62 2016/01/07 03:56:03 dlg Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -49,6 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <sys/device.h>
#include <sys/socket.h>
#include <sys/timeout.h>
+#include <sys/atomic.h>
#include <net/if.h>
#include <net/if_media.h>
@@ -181,10 +182,9 @@ typedef int boolean_t;
#define EM_TX_TIMEOUT 5 /* set to 5 seconds */
/*
- * These parameters control when the driver calls the routine to reclaim
- * transmit descriptors.
+ * Thise parameter controls the minimum number of available transmit
+ * descriptors needed before we attempt transmission of a packet.
*/
-#define EM_TX_CLEANUP_THRESHOLD (sc->num_tx_desc / 8)
#define EM_TX_OP_THRESHOLD (sc->num_tx_desc / 32)
/*
@@ -350,8 +350,8 @@ struct em_softc {
struct em_tx_desc *tx_desc_base;
u_int32_t next_avail_tx_desc;
u_int32_t next_tx_to_clean;
- volatile u_int16_t num_tx_desc_avail;
- u_int16_t num_tx_desc;
+ volatile u_int32_t num_tx_desc_avail;
+ u_int32_t num_tx_desc;
u_int32_t txd_cmd;
struct em_buffer *tx_buffer_area;
bus_dma_tag_t txtag; /* dma tag for tx */