make the default values of q_maxlen build parameters.

This commit is contained in:
knakahara 2017-05-24 10:05:09 +00:00
parent 48886aaf2c
commit c7023dc150
2 changed files with 14 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: crypto.c,v 1.74 2017/05/24 09:57:36 knakahara Exp $ */
/* $NetBSD: crypto.c,v 1.75 2017/05/24 10:05:09 knakahara Exp $ */
/* $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $ */
/* $OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $ */
@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.74 2017/05/24 09:57:36 knakahara Exp $");
__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.75 2017/05/24 10:05:09 knakahara Exp $");
#include <sys/param.h>
#include <sys/reboot.h>
@ -131,9 +131,8 @@ static TAILQ_HEAD(krprethead, cryptkop) crp_ret_kq =
#define DEFINIT_CRYPTO_Q_DROPS(name) \
static int crypto_##name##_drops = 0
#define CRYPTO_Q_MAXLEN 0
#define DEFINIT_CRYPTO_Q_MAXLEN(name) \
static int crypto_##name##_maxlen = CRYPTO_Q_MAXLEN
#define DEFINIT_CRYPTO_Q_MAXLEN(name, defval) \
static int crypto_##name##_maxlen = defval
#define CRYPTO_Q_INC(name) \
do { \
@ -166,12 +165,18 @@ DEFINIT_CRYPTO_Q_LEN(crp_ret_kq);
DEFINIT_CRYPTO_Q_DROPS(crp_ret_q);
DEFINIT_CRYPTO_Q_DROPS(crp_ret_kq);
#ifndef CRYPTO_RET_Q_MAXLEN
#define CRYPTO_RET_Q_MAXLEN 0
#endif
#ifndef CRYPTO_RET_KQ_MAXLEN
#define CRYPTO_RET_KQ_MAXLEN 0
#endif
/*
* queue length limit.
* default value is 0. <=0 means unlimited.
*/
DEFINIT_CRYPTO_Q_MAXLEN(crp_ret_q);
DEFINIT_CRYPTO_Q_MAXLEN(crp_ret_kq);
DEFINIT_CRYPTO_Q_MAXLEN(crp_ret_q, CRYPTO_RET_Q_MAXLEN);
DEFINIT_CRYPTO_Q_MAXLEN(crp_ret_kq, CRYPTO_RET_KQ_MAXLEN);
/*
* TODO:

View File

@ -1,4 +1,4 @@
# $NetBSD: files.opencrypto,v 1.25 2011/11/19 22:51:30 tls Exp $
# $NetBSD: files.opencrypto,v 1.26 2017/05/24 10:05:09 knakahara Exp $
#
#
@ -28,3 +28,4 @@ file opencrypto/cryptodev.c crypto
file opencrypto/ocryptodev.c crypto & compat_50
defflag opt_ocf.h CRYPTO_DEBUG CRYPTO_TIMING
defparam opt_ocf.h CRYPTO_RET_Q_MAXLEN CRYPTO_RET_KQ_MAXLEN