[MLX4] added debug prints in case of errors. [mlnx: 4664]
[mirror/winof/.git] / hw / mlx4 / kernel / bus / net / mr.c
index 1036e70..93c1399 100644 (file)
@@ -376,8 +376,10 @@ static int mlx4_write_mtt_chunk(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
 
        mtts = mlx4_table_find(&priv->mr_table.mtt_table, mtt->first_seg +
                                s / dev->caps.mtt_entry_sz, &dma_handle);
-       if (!mtts)
+       if (!mtts) {
+               printk(KERN_ERR "mlx4_write_mtt_chunk: mlx4_table_find failed with -ENOMEM \n");
                return -ENOMEM;
+       }
 
        for (i = 0; i < npages; ++i)
                mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT);
@@ -419,8 +421,10 @@ int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
        int i;
 
        page_list = kmalloc(buf->npages * sizeof *page_list, GFP_KERNEL);
-       if (!page_list)
+       if (!page_list) {
+               printk(KERN_ERR "mlx4_buf_write_mtt: kmalloc failed with -ENOMEM \n");
                return -ENOMEM;
+       }
 
        for (i = 0; i < buf->npages; ++i)
                if (buf->nbufs == 1)