Skip to content

Commit a9fb328

Browse files
Bob Pearsonjgunthorpe
authored andcommitted
RDMA/rxe: Change rxe_dbg to rxe_dbg_dev
Replace the name rxe_dbg with rxe_dbg_dev which better matches the remaining rxe_dbg_xxx macros for debug messages with a rxe device parameter. Reuse the name rxe_dbg for debug messages which do not have a rxe device parameter. Link: https://lore.kernel.org/r/20230303221623.8053-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 9168d12 commit a9fb328

File tree

9 files changed

+25
-24
lines changed

9 files changed

+25
-24
lines changed

drivers/infiniband/sw/rxe/rxe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static int rxe_newlink(const char *ibdev_name, struct net_device *ndev)
187187
rxe = rxe_get_dev_from_net(ndev);
188188
if (rxe) {
189189
ib_device_put(&rxe->ib_dev);
190-
rxe_dbg(rxe, "already configured on %s\n", ndev->name);
190+
rxe_dbg_dev(rxe, "already configured on %s\n", ndev->name);
191191
err = -EEXIST;
192192
goto err;
193193
}

drivers/infiniband/sw/rxe/rxe.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939
#define RXE_ROCE_V2_SPORT (0xc000)
4040

41-
#define rxe_dbg(rxe, fmt, ...) ibdev_dbg(&(rxe)->ib_dev, \
41+
#define rxe_dbg(fmt, ...) pr_debug("%s: " fmt "\n", __func__, ##__VA_ARGS__)
42+
#define rxe_dbg_dev(rxe, fmt, ...) ibdev_dbg(&(rxe)->ib_dev, \
4243
"%s: " fmt, __func__, ##__VA_ARGS__)
4344
#define rxe_dbg_uc(uc, fmt, ...) ibdev_dbg((uc)->ibuc.device, \
4445
"uc#%d %s: " fmt, (uc)->elem.index, __func__, ##__VA_ARGS__)

drivers/infiniband/sw/rxe/rxe_cq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ int rxe_cq_chk_attr(struct rxe_dev *rxe, struct rxe_cq *cq,
1414
int count;
1515

1616
if (cqe <= 0) {
17-
rxe_dbg(rxe, "cqe(%d) <= 0\n", cqe);
17+
rxe_dbg_dev(rxe, "cqe(%d) <= 0\n", cqe);
1818
goto err1;
1919
}
2020

2121
if (cqe > rxe->attr.max_cqe) {
22-
rxe_dbg(rxe, "cqe(%d) > max_cqe(%d)\n",
22+
rxe_dbg_dev(rxe, "cqe(%d) > max_cqe(%d)\n",
2323
cqe, rxe->attr.max_cqe);
2424
goto err1;
2525
}
@@ -65,7 +65,7 @@ int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe,
6565
cq->queue = rxe_queue_init(rxe, &cqe,
6666
sizeof(struct rxe_cqe), type);
6767
if (!cq->queue) {
68-
rxe_dbg(rxe, "unable to create cq\n");
68+
rxe_dbg_dev(rxe, "unable to create cq\n");
6969
return -ENOMEM;
7070
}
7171

drivers/infiniband/sw/rxe/rxe_icrc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int rxe_icrc_init(struct rxe_dev *rxe)
2121

2222
tfm = crypto_alloc_shash("crc32", 0, 0);
2323
if (IS_ERR(tfm)) {
24-
rxe_dbg(rxe, "failed to init crc32 algorithm err: %ld\n",
24+
rxe_dbg_dev(rxe, "failed to init crc32 algorithm err: %ld\n",
2525
PTR_ERR(tfm));
2626
return PTR_ERR(tfm);
2727
}
@@ -51,7 +51,7 @@ static __be32 rxe_crc32(struct rxe_dev *rxe, __be32 crc, void *next, size_t len)
5151
*(__be32 *)shash_desc_ctx(shash) = crc;
5252
err = crypto_shash_update(shash, next, len);
5353
if (unlikely(err)) {
54-
rxe_dbg(rxe, "failed crc calculation, err: %d\n", err);
54+
rxe_dbg_dev(rxe, "failed crc calculation, err: %d\n", err);
5555
return (__force __be32)crc32_le((__force u32)crc, next, len);
5656
}
5757

drivers/infiniband/sw/rxe/rxe_mmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ int rxe_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
7979

8080
/* Don't allow a mmap larger than the object. */
8181
if (size > ip->info.size) {
82-
rxe_dbg(rxe, "mmap region is larger than the object!\n");
82+
rxe_dbg_dev(rxe, "mmap region is larger than the object!\n");
8383
spin_unlock_bh(&rxe->pending_lock);
8484
ret = -EINVAL;
8585
goto done;
8686
}
8787

8888
goto found_it;
8989
}
90-
rxe_dbg(rxe, "unable to find pending mmap info\n");
90+
rxe_dbg_dev(rxe, "unable to find pending mmap info\n");
9191
spin_unlock_bh(&rxe->pending_lock);
9292
ret = -EINVAL;
9393
goto done;
@@ -98,7 +98,7 @@ int rxe_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
9898

9999
ret = remap_vmalloc_range(vma, ip->obj, 0);
100100
if (ret) {
101-
rxe_dbg(rxe, "err %d from remap_vmalloc_range\n", ret);
101+
rxe_dbg_dev(rxe, "err %d from remap_vmalloc_range\n", ret);
102102
goto done;
103103
}
104104

drivers/infiniband/sw/rxe/rxe_net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static int rxe_notify(struct notifier_block *not_blk,
596596
rxe_port_down(rxe);
597597
break;
598598
case NETDEV_CHANGEMTU:
599-
rxe_dbg(rxe, "%s changed mtu to %d\n", ndev->name, ndev->mtu);
599+
rxe_dbg_dev(rxe, "%s changed mtu to %d\n", ndev->name, ndev->mtu);
600600
rxe_set_mtu(rxe, ndev->mtu);
601601
break;
602602
case NETDEV_CHANGE:
@@ -608,7 +608,7 @@ static int rxe_notify(struct notifier_block *not_blk,
608608
case NETDEV_CHANGENAME:
609609
case NETDEV_FEAT_CHANGE:
610610
default:
611-
rxe_dbg(rxe, "ignoring netdev event = %ld for %s\n",
611+
rxe_dbg_dev(rxe, "ignoring netdev event = %ld for %s\n",
612612
event, ndev->name);
613613
break;
614614
}

drivers/infiniband/sw/rxe/rxe_qp.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@ static int rxe_qp_chk_cap(struct rxe_dev *rxe, struct ib_qp_cap *cap,
1919
int has_srq)
2020
{
2121
if (cap->max_send_wr > rxe->attr.max_qp_wr) {
22-
rxe_dbg(rxe, "invalid send wr = %u > %d\n",
22+
rxe_dbg_dev(rxe, "invalid send wr = %u > %d\n",
2323
cap->max_send_wr, rxe->attr.max_qp_wr);
2424
goto err1;
2525
}
2626

2727
if (cap->max_send_sge > rxe->attr.max_send_sge) {
28-
rxe_dbg(rxe, "invalid send sge = %u > %d\n",
28+
rxe_dbg_dev(rxe, "invalid send sge = %u > %d\n",
2929
cap->max_send_sge, rxe->attr.max_send_sge);
3030
goto err1;
3131
}
3232

3333
if (!has_srq) {
3434
if (cap->max_recv_wr > rxe->attr.max_qp_wr) {
35-
rxe_dbg(rxe, "invalid recv wr = %u > %d\n",
35+
rxe_dbg_dev(rxe, "invalid recv wr = %u > %d\n",
3636
cap->max_recv_wr, rxe->attr.max_qp_wr);
3737
goto err1;
3838
}
3939

4040
if (cap->max_recv_sge > rxe->attr.max_recv_sge) {
41-
rxe_dbg(rxe, "invalid recv sge = %u > %d\n",
41+
rxe_dbg_dev(rxe, "invalid recv sge = %u > %d\n",
4242
cap->max_recv_sge, rxe->attr.max_recv_sge);
4343
goto err1;
4444
}
4545
}
4646

4747
if (cap->max_inline_data > rxe->max_inline_data) {
48-
rxe_dbg(rxe, "invalid max inline data = %u > %d\n",
48+
rxe_dbg_dev(rxe, "invalid max inline data = %u > %d\n",
4949
cap->max_inline_data, rxe->max_inline_data);
5050
goto err1;
5151
}
@@ -73,7 +73,7 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)
7373
}
7474

7575
if (!init->recv_cq || !init->send_cq) {
76-
rxe_dbg(rxe, "missing cq\n");
76+
rxe_dbg_dev(rxe, "missing cq\n");
7777
goto err1;
7878
}
7979

@@ -82,14 +82,14 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)
8282

8383
if (init->qp_type == IB_QPT_GSI) {
8484
if (!rdma_is_port_valid(&rxe->ib_dev, port_num)) {
85-
rxe_dbg(rxe, "invalid port = %d\n", port_num);
85+
rxe_dbg_dev(rxe, "invalid port = %d\n", port_num);
8686
goto err1;
8787
}
8888

8989
port = &rxe->port;
9090

9191
if (init->qp_type == IB_QPT_GSI && port->qp_gsi_index) {
92-
rxe_dbg(rxe, "GSI QP exists for port %d\n", port_num);
92+
rxe_dbg_dev(rxe, "GSI QP exists for port %d\n", port_num);
9393
goto err1;
9494
}
9595
}

drivers/infiniband/sw/rxe/rxe_srq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ int rxe_srq_chk_init(struct rxe_dev *rxe, struct ib_srq_init_attr *init)
1313
struct ib_srq_attr *attr = &init->attr;
1414

1515
if (attr->max_wr > rxe->attr.max_srq_wr) {
16-
rxe_dbg(rxe, "max_wr(%d) > max_srq_wr(%d)\n",
16+
rxe_dbg_dev(rxe, "max_wr(%d) > max_srq_wr(%d)\n",
1717
attr->max_wr, rxe->attr.max_srq_wr);
1818
goto err1;
1919
}
2020

2121
if (attr->max_wr <= 0) {
22-
rxe_dbg(rxe, "max_wr(%d) <= 0\n", attr->max_wr);
22+
rxe_dbg_dev(rxe, "max_wr(%d) <= 0\n", attr->max_wr);
2323
goto err1;
2424
}
2525

2626
if (attr->max_wr < RXE_MIN_SRQ_WR)
2727
attr->max_wr = RXE_MIN_SRQ_WR;
2828

2929
if (attr->max_sge > rxe->attr.max_srq_sge) {
30-
rxe_dbg(rxe, "max_sge(%d) > max_srq_sge(%d)\n",
30+
rxe_dbg_dev(rxe, "max_sge(%d) > max_srq_sge(%d)\n",
3131
attr->max_sge, rxe->attr.max_srq_sge);
3232
goto err1;
3333
}

drivers/infiniband/sw/rxe/rxe_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name)
10951095

10961096
err = ib_register_device(dev, ibdev_name, NULL);
10971097
if (err)
1098-
rxe_dbg(rxe, "failed with error %d\n", err);
1098+
rxe_dbg_dev(rxe, "failed with error %d\n", err);
10991099

11001100
/*
11011101
* Note that rxe may be invalid at this point if another thread

0 commit comments

Comments
 (0)