From daa06a78b6389b276f2d2e1283273ef8f4f623d5 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 15 Oct 2004 00:36:07 +0000 Subject: 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 --- sys/dev/hifn/hifn7751var.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sys/dev/hifn/hifn7751var.h') 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) -- cgit v1.1