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-18 13:44:40 +0200 |
commit | 82ecfad773dbce052e2b46a4712a88d2ac266b8a (patch) | |
tree | 61b675053cd2518d1cc287b3db03969f5fa43612 /drivers/net/mlx4/mlx4_rxq.c | |
parent | 547f5865f56b7a2277e00071d1c97d733140e418 (diff) |
New upstream version 17.11.3
Change-Id: Ic462f86fdc2d928727f49581036c19b7914c682b
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)); |