diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-06-18 13:36:41 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-06-19 08:22:47 +0200 |
commit | e4df4d55df003957fc5afd7440e3d3192d7ce218 (patch) | |
tree | 4d87da85a727b31f1a76de49f6c4d31cedda71b7 /drivers/net/mlx4/mlx4_rxq.c | |
parent | d038355bf358f713efbb182f174e2a8a09042e2b (diff) |
New upstream version 17.11.3
Change-Id: I2b901aaf362a2b94195665cc890d824b2c3a620e
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/mlx4/mlx4_rxq.c')
-rw-r--r-- | drivers/net/mlx4/mlx4_rxq.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index 53313c56..06030c2c 100644 --- a/drivers/net/mlx4/mlx4_rxq.c +++ b/drivers/net/mlx4/mlx4_rxq.c @@ -363,6 +363,8 @@ mlx4_rss_init(struct priv *priv) unsigned int i; int ret; + if (priv->rss_init) + return 0; /* Prepare range for RSS contexts before creating the first WQ. */ ret = mlx4dv_set_context_attr(priv->ctx, MLX4DV_SET_CTX_ATTR_LOG_WQS_RANGE_SZ, @@ -444,6 +446,7 @@ wq_num_check: } wq_num_prev = wq_num; } + priv->rss_init = 1; return 0; error: ERROR("cannot initialize common RSS resources (queue %u): %s: %s", @@ -472,6 +475,8 @@ mlx4_rss_deinit(struct priv *priv) { unsigned int i; + if (!priv->rss_init) + return; for (i = 0; i != priv->dev->data->nb_rx_queues; ++i) { struct rxq *rxq = priv->dev->data->rx_queues[i]; @@ -480,6 +485,7 @@ mlx4_rss_deinit(struct priv *priv) mlx4_rxq_detach(rxq); } } + priv->rss_init = 0; } /** @@ -622,6 +628,7 @@ error: claim_zero(ibv_destroy_wq(wq)); if (cq) claim_zero(ibv_destroy_cq(cq)); + --rxq->usecnt; rte_errno = ret; ERROR("error while attaching Rx queue %p: %s: %s", (void *)rxq, msg, strerror(ret)); |