FreeBSD Bugzilla – Attachment 216367 Details for
Bug 247163
ipsec / cesa memory issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
cesa session limit patch (untested)
diff (text/plain), 1.58 KB, created by
Mark Johnston
on 2020-07-10 19:22:36 UTC
(
hide
)
Description:
cesa session limit patch (untested)
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2020-07-10 19:22:36 UTC
Size:
1.58 KB
patch
obsolete
>Index: sys/dev/cesa/cesa.c >=================================================================== >--- sys/dev/cesa/cesa.c (revision 363001) >+++ sys/dev/cesa/cesa.c (working copy) >@@ -245,7 +245,7 @@ static struct cesa_session * > cesa_get_session(struct cesa_softc *sc, uint32_t sid) > { > >- if (sid >= CESA_SESSIONS) >+ if (sid >= sc->sc_nsessions) > return (NULL); > > return (&sc->sc_sessions[sid]); >@@ -1177,7 +1177,11 @@ cesa_attach(device_t dev) > > /* Initialize data structures: Sessions Pool */ > STAILQ_INIT(&sc->sc_free_sessions); >- for (i = 0; i < CESA_SESSIONS; i++) { >+ sc->sc_nsessions = CESA_SESSIONS; >+ TUNABLE_INT_FETCH("hw.cesa.nsessions", &sc->sc_nsessions); >+ sc->sc_sessions = malloc(sizeof(struct cesa_session) * sc->sc_nsessions, >+ M_DEVBUF, M_WAITOK | M_ZERO); >+ for (i = 0; i < sc->sc_nsessions; i++) { > sc->sc_sessions[i].cs_sid = i; > STAILQ_INSERT_TAIL(&sc->sc_free_sessions, &sc->sc_sessions[i], > cs_stq); >Index: sys/dev/cesa/cesa.h >=================================================================== >--- sys/dev/cesa/cesa.h (revision 363001) >+++ sys/dev/cesa/cesa.h (working copy) >@@ -30,7 +30,7 @@ > #define _DEV_CESA_H_ > > /* Maximum number of allocated sessions */ >-#define CESA_SESSIONS 64 >+#define CESA_SESSIONS 128 > > /* Maximum number of queued requests */ > #define CESA_REQUESTS 256 >@@ -262,7 +262,8 @@ struct cesa_softc { > > /* Sessions pool */ > struct mtx sc_sessions_lock; >- struct cesa_session sc_sessions[CESA_SESSIONS]; >+ struct cesa_session *sc_sessions; >+ int sc_nsessions; > STAILQ_HEAD(, cesa_session) sc_free_sessions; > > /* CESA SRAM Address */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247163
: 216367