Commit 6501ab5e authored by Harsh Jain's avatar Harsh Jain Committed by Herbert Xu

crypto: chelsio - Reset counters on cxgb4 Detach

Reset the counters on receiving detach from Cxgb4.
Signed-off-by: default avatarAtul Gupta <atul.gupta@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fef4912b
...@@ -132,6 +132,8 @@ static void chcr_dev_init(struct uld_ctx *u_ctx) ...@@ -132,6 +132,8 @@ static void chcr_dev_init(struct uld_ctx *u_ctx)
static int chcr_dev_move(struct uld_ctx *u_ctx) static int chcr_dev_move(struct uld_ctx *u_ctx)
{ {
struct adapter *adap;
mutex_lock(&drv_data.drv_mutex); mutex_lock(&drv_data.drv_mutex);
if (drv_data.last_dev == u_ctx) { if (drv_data.last_dev == u_ctx) {
if (list_is_last(&drv_data.last_dev->entry, &drv_data.act_dev)) if (list_is_last(&drv_data.last_dev->entry, &drv_data.act_dev))
...@@ -144,6 +146,8 @@ static int chcr_dev_move(struct uld_ctx *u_ctx) ...@@ -144,6 +146,8 @@ static int chcr_dev_move(struct uld_ctx *u_ctx)
list_move(&u_ctx->entry, &drv_data.inact_dev); list_move(&u_ctx->entry, &drv_data.inact_dev);
if (list_empty(&drv_data.act_dev)) if (list_empty(&drv_data.act_dev))
drv_data.last_dev = NULL; drv_data.last_dev = NULL;
adap = padap(&u_ctx->dev);
memset(&adap->chcr_stats, 0, sizeof(adap->chcr_stats));
atomic_dec(&drv_data.dev_count); atomic_dec(&drv_data.dev_count);
mutex_unlock(&drv_data.drv_mutex); mutex_unlock(&drv_data.drv_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment