public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] RDMA/rxe: Add function name to the logs
@ 2023-04-18 12:26 Zhu Yanjun
  2023-04-21 15:27 ` Jason Gunthorpe
  0 siblings, 1 reply; 8+ messages in thread
From: Zhu Yanjun @ 2023-04-18 12:26 UTC (permalink / raw)
  To: zyjzyj2000, jgg, leon, linux-rdma; +Cc: Zhu Yanjun

From: Zhu Yanjun <yanjun.zhu@linux.dev>

Add the function names to the pr_ logs. As such, if some bugs occur,
with function names, it is easy to locate the bugs.

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
 drivers/infiniband/sw/rxe/rxe.h       |  2 +-
 drivers/infiniband/sw/rxe/rxe_queue.h | 16 ++++------------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe.h b/drivers/infiniband/sw/rxe/rxe.h
index d33dd6cf83d3..f897d0ac1216 100644
--- a/drivers/infiniband/sw/rxe/rxe.h
+++ b/drivers/infiniband/sw/rxe/rxe.h
@@ -10,7 +10,7 @@
 #ifdef pr_fmt
 #undef pr_fmt
 #endif
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
 
 #include <linux/skbuff.h>
 
diff --git a/drivers/infiniband/sw/rxe/rxe_queue.h b/drivers/infiniband/sw/rxe/rxe_queue.h
index c711cb98b949..11bba08ca5f9 100644
--- a/drivers/infiniband/sw/rxe/rxe_queue.h
+++ b/drivers/infiniband/sw/rxe/rxe_queue.h
@@ -184,9 +184,7 @@ static inline void queue_advance_producer(struct rxe_queue *q,
 	switch (type) {
 	case QUEUE_TYPE_FROM_CLIENT:
 		/* used by rxe, client owns the index */
-		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance client index\n",
-				__func__);
+		WARN_ON(1);
 		break;
 	case QUEUE_TYPE_TO_CLIENT:
 		/* used by rxe which owns the index */
@@ -205,9 +203,7 @@ static inline void queue_advance_producer(struct rxe_queue *q,
 		break;
 	case QUEUE_TYPE_TO_ULP:
 		/* used by ulp, rxe owns the index */
-		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance driver index\n",
-				__func__);
+		WARN_ON(1);
 		break;
 	}
 }
@@ -227,15 +223,11 @@ static inline void queue_advance_consumer(struct rxe_queue *q,
 		break;
 	case QUEUE_TYPE_TO_CLIENT:
 		/* used by rxe, client owns the index */
-		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance client index\n",
-				__func__);
+		WARN_ON(1);
 		break;
 	case QUEUE_TYPE_FROM_ULP:
 		/* used by ulp, rxe owns the index */
-		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance driver index\n",
-				__func__);
+		WARN_ON(1);
 		break;
 	case QUEUE_TYPE_TO_ULP:
 		/* used by ulp which owns the index */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH 1/1] RDMA/rxe: Add function name to the logs
@ 2023-04-10 10:21 Zhu Yanjun
  2023-04-16 14:43 ` Zhu Yanjun
  2023-04-18  8:08 ` Leon Romanovsky
  0 siblings, 2 replies; 8+ messages in thread
From: Zhu Yanjun @ 2023-04-10 10:21 UTC (permalink / raw)
  To: zyjzyj2000, jgg, leon, linux-rdma; +Cc: Zhu Yanjun

From: Zhu Yanjun <yanjun.zhu@linux.dev>

Add the function names to the pr_ logs. As such, if some bugs occur,
with function names, it is easy to locate the bugs.

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
 drivers/infiniband/sw/rxe/rxe.h       |  2 +-
 drivers/infiniband/sw/rxe/rxe_queue.h | 12 ++++--------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe.h b/drivers/infiniband/sw/rxe/rxe.h
index 2415f3704f57..43742d2f32de 100644
--- a/drivers/infiniband/sw/rxe/rxe.h
+++ b/drivers/infiniband/sw/rxe/rxe.h
@@ -10,7 +10,7 @@
 #ifdef pr_fmt
 #undef pr_fmt
 #endif
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
 
 #include <linux/skbuff.h>
 
diff --git a/drivers/infiniband/sw/rxe/rxe_queue.h b/drivers/infiniband/sw/rxe/rxe_queue.h
index c711cb98b949..5d6e17b00e60 100644
--- a/drivers/infiniband/sw/rxe/rxe_queue.h
+++ b/drivers/infiniband/sw/rxe/rxe_queue.h
@@ -185,8 +185,7 @@ static inline void queue_advance_producer(struct rxe_queue *q,
 	case QUEUE_TYPE_FROM_CLIENT:
 		/* used by rxe, client owns the index */
 		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance client index\n",
-				__func__);
+			pr_warn("attempt to advance client index\n");
 		break;
 	case QUEUE_TYPE_TO_CLIENT:
 		/* used by rxe which owns the index */
@@ -206,8 +205,7 @@ static inline void queue_advance_producer(struct rxe_queue *q,
 	case QUEUE_TYPE_TO_ULP:
 		/* used by ulp, rxe owns the index */
 		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance driver index\n",
-				__func__);
+			pr_warn("attempt to advance driver index\n");
 		break;
 	}
 }
@@ -228,14 +226,12 @@ static inline void queue_advance_consumer(struct rxe_queue *q,
 	case QUEUE_TYPE_TO_CLIENT:
 		/* used by rxe, client owns the index */
 		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance client index\n",
-				__func__);
+			pr_warn("attempt to advance client index\n");
 		break;
 	case QUEUE_TYPE_FROM_ULP:
 		/* used by ulp, rxe owns the index */
 		if (WARN_ON(1))
-			pr_warn("%s: attempt to advance driver index\n",
-				__func__);
+			pr_warn("attempt to advance driver index\n");
 		break;
 	case QUEUE_TYPE_TO_ULP:
 		/* used by ulp which owns the index */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-28 13:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 12:26 [PATCH 1/1] RDMA/rxe: Add function name to the logs Zhu Yanjun
2023-04-21 15:27 ` Jason Gunthorpe
2023-04-21 15:51   ` Zhu Yanjun
2023-04-28 13:24     ` Jason Gunthorpe
  -- strict thread matches above, loose matches on Subject: below --
2023-04-10 10:21 Zhu Yanjun
2023-04-16 14:43 ` Zhu Yanjun
2023-04-18  8:08 ` Leon Romanovsky
2023-04-18 10:36   ` Zhu Yanjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox