Mercurial > illumos > illumos-gate
changeset 4969:c2f7b3041d72
6551956 aac: fibctx->ctx_idx initialization problem
6551959 aac: close of first context by FSACTL_CLOSE_GETADAPTER_FIB closes all contexts
6584506 "-- AIF queue overrun" is displayed inaccurately
author | xc211169 |
---|---|
date | Thu, 30 Aug 2007 20:04:30 -0700 |
parents | e19af3ad3eea |
children | 1cbc767b641b |
files | usr/src/uts/intel/io/aac/aac.c usr/src/uts/intel/io/aac/aac.h usr/src/uts/intel/io/aac/aac_ioctl.c |
diffstat | 3 files changed, 26 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/intel/io/aac/aac.c Thu Aug 30 18:57:10 2007 -0700 +++ b/usr/src/uts/intel/io/aac/aac.c Thu Aug 30 20:04:30 2007 -0700 @@ -4626,21 +4626,22 @@ mutex_enter(&softs->aifq_mutex); current = softs->aifq_idx; next = (current + 1) % AAC_AIFQ_LENGTH; - if (next == 0) { - softs->aifq_filled = 1; - AACDB_PRINT(softs, CE_NOTE, "-- AIF queue overrun"); - } + if (next == 0) + softs->aifq_wrap = 1; bcopy(fibp, &softs->aifq[current], sizeof (struct aac_fib)); /* Modify AIF contexts */ - if (softs->aifq_filled) { + if (softs->aifq_wrap) { struct aac_fib_context *ctx; for (ctx = softs->fibctx; ctx; ctx = ctx->next) { - if (next == ctx->ctx_idx) - ctx->ctx_wrap = 1; - else if (current == ctx->ctx_idx && ctx->ctx_wrap) + if (next == ctx->ctx_idx) { + ctx->ctx_filled = 1; + } else if (current == ctx->ctx_idx && ctx->ctx_filled) { ctx->ctx_idx = next; + AACDB_PRINT(softs, CE_NOTE, + "-- AIF queue(%x) overrun", ctx->unique); + } } } softs->aifq_idx = next;
--- a/usr/src/uts/intel/io/aac/aac.h Thu Aug 30 18:57:10 2007 -0700 +++ b/usr/src/uts/intel/io/aac/aac.h Thu Aug 30 20:04:30 2007 -0700 @@ -57,7 +57,7 @@ #define AAC_DRIVER_MAJOR_VERSION 2 #define AAC_DRIVER_MINOR_VERSION 1 -#define AAC_DRIVER_BUGFIX_LEVEL 15 +#define AAC_DRIVER_BUGFIX_LEVEL 16 #define AAC_DRIVER_TYPE AAC_TYPE_RELEASE #define STR(s) # s @@ -198,7 +198,7 @@ struct aac_fib_context { uint32_t unique; int ctx_idx; - int ctx_wrap; + int ctx_filled; /* aifq is full for this fib context */ struct aac_fib_context *next, *prev; }; @@ -292,8 +292,8 @@ kmutex_t aifq_mutex; /* for AIF queue aifq */ kcondvar_t aifv; struct aac_fib aifq[AAC_AIFQ_LENGTH]; - int aifq_idx; - int aifq_filled; + int aifq_idx; /* slot for next new AIF */ + int aifq_wrap; /* AIF queue has ever been wrapped */ struct aac_fib_context *fibctx; int devcfg_wait_on; /* AIF event waited for rescan */
--- a/usr/src/uts/intel/io/aac/aac_ioctl.c Thu Aug 30 18:57:10 2007 -0700 +++ b/usr/src/uts/intel/io/aac/aac_ioctl.c Thu Aug 30 20:04:30 2007 -0700 @@ -291,6 +291,12 @@ ctx = ctx->next; } } + + /* Set ctx_idx to the oldest AIF */ + if (softs->aifq_wrap) { + fibctx->ctx_idx = softs->aifq_idx; + fibctx->ctx_filled = 1; + } mutex_exit(&softs->aifq_mutex); if (ddi_copyout(&fibctx->unique, (void *)arg, @@ -357,13 +363,12 @@ if (ctx->unique != (uint32_t)arg) continue; - if (ctx == softs->fibctx) { - softs->fibctx = NULL; - } else { + if (ctx == softs->fibctx) + softs->fibctx = ctx->next; + else ctx->prev->next = ctx->next; - if (ctx->next) - ctx->next->prev = ctx->prev; - } + if (ctx->next) + ctx->next->prev = ctx->prev; break; } mutex_exit(&softs->aifq_mutex); @@ -717,7 +722,7 @@ mutex_enter(&softs->aifq_mutex); current = ctx->ctx_idx; - if (current == softs->aifq_idx && !ctx->ctx_wrap) { + if (current == softs->aifq_idx && !ctx->ctx_filled) { /* Empty */ mutex_exit(&softs->aifq_mutex); return (EAGAIN); @@ -728,7 +733,7 @@ return (EFAULT); } - ctx->ctx_wrap = 0; + ctx->ctx_filled = 0; ctx->ctx_idx = (current + 1) % AAC_AIFQ_LENGTH; mutex_exit(&softs->aifq_mutex);