hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/infiniband/core/mr_pool.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2016 HGST, a Western Digital Company.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
124 */
135 #include <rdma/ib_verbs.h>
146 #include <rdma/mr_pool.h>
....@@ -42,14 +34,18 @@
4234 EXPORT_SYMBOL(ib_mr_pool_put);
4335
4436 int ib_mr_pool_init(struct ib_qp *qp, struct list_head *list, int nr,
45
- enum ib_mr_type type, u32 max_num_sg)
37
+ enum ib_mr_type type, u32 max_num_sg, u32 max_num_meta_sg)
4638 {
4739 struct ib_mr *mr;
4840 unsigned long flags;
4941 int ret, i;
5042
5143 for (i = 0; i < nr; i++) {
52
- mr = ib_alloc_mr(qp->pd, type, max_num_sg);
44
+ if (type == IB_MR_TYPE_INTEGRITY)
45
+ mr = ib_alloc_mr_integrity(qp->pd, max_num_sg,
46
+ max_num_meta_sg);
47
+ else
48
+ mr = ib_alloc_mr(qp->pd, type, max_num_sg);
5349 if (IS_ERR(mr)) {
5450 ret = PTR_ERR(mr);
5551 goto out;