summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorHarsh Jain <harsh@chelsio.com>2018-12-11 13:51:41 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-12-23 06:52:43 +0300
commit6501ab5ed4d925cce4c2a1c49b63583c42e65bd8 (patch)
tree89f83f29b6de4f54c979eac6c0192a25281c2a36 /drivers/crypto
parentfef4912b66d6246d958d97382d20d0dd23bcf0bc (diff)
downloadlinux-6501ab5ed4d925cce4c2a1c49b63583c42e65bd8.tar.xz
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>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/chelsio/chcr_core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c
index f71a97939418..e04b3e8fa623 100644
--- a/drivers/crypto/chelsio/chcr_core.c
+++ b/drivers/crypto/chelsio/chcr_core.c
@@ -132,6 +132,8 @@ static void chcr_dev_init(struct uld_ctx *u_ctx)
static int chcr_dev_move(struct uld_ctx *u_ctx)
{
+ struct adapter *adap;
+
mutex_lock(&drv_data.drv_mutex);
if (drv_data.last_dev == u_ctx) {
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)
list_move(&u_ctx->entry, &drv_data.inact_dev);
if (list_empty(&drv_data.act_dev))
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);
mutex_unlock(&drv_data.drv_mutex);