summaryrefslogtreecommitdiffstats
path: root/sys/dev/hifn/hifn7751var.h
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2004-10-15 00:36:07 +0000
committersam <sam@FreeBSD.org>2004-10-15 00:36:07 +0000
commitdaa06a78b6389b276f2d2e1283273ef8f4f623d5 (patch)
tree7d0579fc73c46933cfc8c6090ea191128c59ef5c /sys/dev/hifn/hifn7751var.h
parenta76b21d1d4525da5833d6ee1cee37363bd8023eb (diff)
downloadFreeBSD-src-daa06a78b6389b276f2d2e1283273ef8f4f623d5.zip
FreeBSD-src-daa06a78b6389b276f2d2e1283273ef8f4f623d5.tar.gz
Move session state from on-card memory to host memory so we no longer are
constrained to a small number of sessions by the small on-card memories found in newer devices. This is really a stopgap solution as having session state in main memory incurs a (small but noticeable) performance penalty. The better solution is to manage session state so that it's cached on chip. Obtained from: openbsd
Diffstat (limited to 'sys/dev/hifn/hifn7751var.h')
-rw-r--r--sys/dev/hifn/hifn7751var.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/hifn/hifn7751var.h b/sys/dev/hifn/hifn7751var.h
index b40b819..e3bd2f6 100644
--- a/sys/dev/hifn/hifn7751var.h
+++ b/sys/dev/hifn/hifn7751var.h
@@ -111,8 +111,7 @@ struct hifn_dma {
};
struct hifn_session {
- int hs_state;
- int hs_prev_op; /* XXX collapse into hs_flags? */
+ int hs_used;
u_int8_t hs_iv[HIFN_MAX_IV_LENGTH];
};
@@ -130,11 +129,6 @@ struct hifn_session {
#define HIFN_RES_SYNC(sc, i, f) \
bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, (f))
-/* We use a state machine to on sessions */
-#define HS_STATE_FREE 0 /* unused session entry */
-#define HS_STATE_USED 1 /* allocated, but key not on card */
-#define HS_STATE_KEY 2 /* allocated and key is on card */
-
/*
* Holds data specific to a single HIFN board.
*/
@@ -164,6 +158,8 @@ struct hifn_softc {
int sc_dmansegs;
int32_t sc_cid;
int sc_maxses;
+ int sc_nsessions;
+ struct hifn_session *sc_sessions;
int sc_ramsize;
int sc_flags;
#define HIFN_HAS_RNG 0x1 /* includes random number generator */
@@ -186,7 +182,6 @@ struct hifn_softc {
int sc_needwakeup; /* ops q'd wating on resources */
int sc_curbatch; /* # ops submitted w/o int */
int sc_suspended;
- struct hifn_session sc_sessions[2048];
};
#define HIFN_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
OpenPOWER on IntegriCloud