PERFORCE change 1202973 for review

John-Mark Gurney jmg at FreeBSD.org
Wed Nov 19 01:10:02 UTC 2014


http://p4web.freebsd.org/@@1202973?ac=10

Change 1202973 by jmg at jmg_carbon2 on 2014/11/19 01:09:42

	drop the mtx lock..  We need to fix this another way, that is
	better...  adding the lock makes geli slower, and people have
	already lived w/ a broken IPsec...
	
	It won't be much longer to a better fix is ready...  They can
	wait for a bit longer..
	
	Sponsored by:	FreeBSD Foundation
	Sponsored by:	Netgate

Affected files ...

.. //depot/projects/opencrypto/sys/crypto/aesni/aesni.c#17 edit
.. //depot/projects/opencrypto/sys/crypto/aesni/aesni.h#5 edit

Differences ...

==== //depot/projects/opencrypto/sys/crypto/aesni/aesni.c#17 (text+ko) ====

@@ -39,7 +39,6 @@
 #include <sys/kobj.h>
 #include <sys/libkern.h>
 #include <sys/lock.h>
-#include <sys/mutex.h>
 #include <sys/module.h>
 #include <sys/malloc.h>
 #include <sys/rwlock.h>
@@ -141,7 +140,6 @@
 	while ((ses = TAILQ_FIRST(&sc->sessions)) != NULL) {
 		TAILQ_REMOVE(&sc->sessions, ses, next);
 		fpu_kern_free_ctx(ses->fpu_ctx);
-		mtx_destroy(&ses->lck);
 		free(ses, M_AESNI);
 	}
 	rw_wunlock(&sc->lock);
@@ -215,7 +213,6 @@
 			rw_wunlock(&sc->lock);
 			return (ENOMEM);
 		}
-		mtx_init(&ses->lck, "aesni session", NULL, MTX_DEF);
 		ses->id = sc->sid++;
 	} else {
 		TAILQ_REMOVE(&sc->sessions, ses, next);
@@ -243,16 +240,13 @@
 {
 	struct fpu_kern_ctx *ctx;
 	uint32_t sid;
-	struct mtx lck;
 
 	sid = ses->id;
-	lck = ses->lck;
 	TAILQ_REMOVE(&sc->sessions, ses, next);
 	ctx = ses->fpu_ctx;
 	*ses = (struct aesni_session){};
 	ses->id = sid;
 	ses->fpu_ctx = ctx;
-	ses->lck = lck;
 	TAILQ_INSERT_HEAD(&sc->sessions, ses, next);
 }
 
@@ -440,17 +434,13 @@
 	int error;
 
 	td = curthread;
-	mtx_lock(&ses->lck);
 	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
 	    FPU_KERN_KTHR);
-	if (error != 0) {
-		mtx_unlock(&ses->lck);
+	if (error != 0)
 		return (error);
-	}
 	error = aesni_cipher_setup_common(ses, encini->cri_key,
 	    encini->cri_klen);
 	fpu_kern_leave(td, ses->fpu_ctx);
-	mtx_unlock(&ses->lck);
 	return (error);
 }
 
@@ -489,7 +479,6 @@
 	}
 
 	td = curthread;
-	mtx_lock(&ses->lck);
 	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
 	    FPU_KERN_KTHR);
 	if (error != 0)
@@ -589,7 +578,6 @@
 
 out:
 	fpu_kern_leave(td, ses->fpu_ctx);
-	mtx_unlock(&ses->lck);
 out1:
 	if (allocated) {
 		bzero(buf, enccrd->crd_len);

==== //depot/projects/opencrypto/sys/crypto/aesni/aesni.h#5 (text+ko) ====

@@ -66,7 +66,6 @@
 	uint32_t id;
 	TAILQ_ENTRY(aesni_session) next;
 	struct fpu_kern_ctx *fpu_ctx;
-	struct mtx	lck;
 };
 
 /*


More information about the p4-projects mailing list