Skip to content

Commit 6501ab5

Browse files
Harsh Jainherbertx
authored andcommitted
crypto: chelsio - Reset counters on cxgb4 Detach
Reset the counters on receiving detach from Cxgb4. Signed-off-by: Atul Gupta <atul.gupta@chelsio.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent fef4912 commit 6501ab5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/crypto/chelsio/chcr_core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ static void chcr_dev_init(struct uld_ctx *u_ctx)
132132

133133
static int chcr_dev_move(struct uld_ctx *u_ctx)
134134
{
135+
struct adapter *adap;
136+
135137
mutex_lock(&drv_data.drv_mutex);
136138
if (drv_data.last_dev == u_ctx) {
137139
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)
144146
list_move(&u_ctx->entry, &drv_data.inact_dev);
145147
if (list_empty(&drv_data.act_dev))
146148
drv_data.last_dev = NULL;
149+
adap = padap(&u_ctx->dev);
150+
memset(&adap->chcr_stats, 0, sizeof(adap->chcr_stats));
147151
atomic_dec(&drv_data.dev_count);
148152
mutex_unlock(&drv_data.drv_mutex);
149153

0 commit comments

Comments
 (0)