]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mlx4_core: Don't free special QPs in QP number bitmap
authorRoland Dreier <rolandd@cisco.com>
Wed, 10 Oct 2007 02:59:05 +0000 (19:59 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 10 Oct 2007 02:59:05 +0000 (19:59 -0700)
Special QPs are not allocated using the regular QP number bitmap, so
when they are destroyed, their QP number should not be freed in the
bitmap.

Found by Dotan Barak of Mellanox.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/net/mlx4/qp.c

index 19b48c71cf7f2e315eb31ba8a47af6b824c2d181..278414b2d01cc8f018edd67e28a3bd3b679e955b 100644 (file)
@@ -240,7 +240,8 @@ void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp)
        mlx4_table_put(dev, &qp_table->auxc_table, qp->qpn);
        mlx4_table_put(dev, &qp_table->qp_table, qp->qpn);
 
-       mlx4_bitmap_free(&qp_table->bitmap, qp->qpn);
+       if (qp->qpn < dev->caps.sqp_start + 8)
+               mlx4_bitmap_free(&qp_table->bitmap, qp->qpn);
 }
 EXPORT_SYMBOL_GPL(mlx4_qp_free);