bnx2x: [Debug] change verbosity of some prints
authorYuval Mintz <yuvalmin@broadcom.com>
Wed, 12 Feb 2014 16:19:49 +0000 (18:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2014 00:15:41 +0000 (19:15 -0500)
There are some debug prints (mostly iov/statistics related) which clobber
system logs whenever their verbosity level is set for an interface.
This patch puts harsher verbosity requirements for such debug prints to be
printed.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c

index 391f29ef6d2e172849c61140b7c88f99eff365fb..ae91e8f436224a8d6a74587630bf4902d1ab93d1 100644 (file)
@@ -75,13 +75,22 @@ enum bnx2x_int_mode {
 #define BNX2X_MSG_DCB                  0x8000000
 
 /* regular debug print */
+#define DP_INNER(fmt, ...)                                     \
+       pr_notice("[%s:%d(%s)]" fmt,                            \
+                 __func__, __LINE__,                           \
+                 bp->dev ? (bp->dev->name) : "?",              \
+                 ##__VA_ARGS__);
+
 #define DP(__mask, fmt, ...)                                   \
 do {                                                           \
        if (unlikely(bp->msg_enable & (__mask)))                \
-               pr_notice("[%s:%d(%s)]" fmt,                    \
-                         __func__, __LINE__,                   \
-                         bp->dev ? (bp->dev->name) : "?",      \
-                         ##__VA_ARGS__);                       \
+               DP_INNER(fmt, ##__VA_ARGS__);                   \
+} while (0)
+
+#define DP_AND(__mask, fmt, ...)                               \
+do {                                                           \
+       if (unlikely((bp->msg_enable & (__mask)) == __mask))    \
+               DP_INNER(fmt, ##__VA_ARGS__);                   \
 } while (0)
 
 #define DP_CONT(__mask, fmt, ...)                              \
index 7d4382286457e6f0bf1b9ba87a981dd758fc874b..1b3dda49590a28f2db3f5263587db2f7978d587f 100644 (file)
@@ -5221,9 +5221,9 @@ static void bnx2x_eq_int(struct bnx2x *bp)
                        continue;
 
                case EVENT_RING_OPCODE_STAT_QUERY:
-                       DP(BNX2X_MSG_SP | BNX2X_MSG_STATS,
-                          "got statistics comp event %d\n",
-                          bp->stats_comp++);
+                       DP_AND((BNX2X_MSG_SP | BNX2X_MSG_STATS),
+                              "got statistics comp event %d\n",
+                              bp->stats_comp++);
                        /* nothing to do with stats comp */
                        goto next_spqe;
 
index e42f48df6e943e9ab21a34a5e3a7a49c43a726c8..37a9357ea1478cc3b10ad1dead840276d19cee11 100644 (file)
@@ -2527,10 +2527,10 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
        first_queue_query_index = BNX2X_FIRST_QUEUE_QUERY_IDX -
                (is_fcoe ? 0 : 1);
 
-       DP(BNX2X_MSG_IOV,
-          "BNX2X_NUM_ETH_QUEUES %d, is_fcoe %d, first_queue_query_index %d => determined the last non virtual statistics query index is %d. Will add queries on top of that\n",
-          BNX2X_NUM_ETH_QUEUES(bp), is_fcoe, first_queue_query_index,
-          first_queue_query_index + num_queues_req);
+       DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_STATS),
+              "BNX2X_NUM_ETH_QUEUES %d, is_fcoe %d, first_queue_query_index %d => determined the last non virtual statistics query index is %d. Will add queries on top of that\n",
+              BNX2X_NUM_ETH_QUEUES(bp), is_fcoe, first_queue_query_index,
+              first_queue_query_index + num_queues_req);
 
        cur_data_offset = bp->fw_stats_data_mapping +
                offsetof(struct bnx2x_fw_stats_data, queue_stats) +
@@ -2544,9 +2544,9 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
                struct bnx2x_virtf *vf = BP_VF(bp, i);
 
                if (vf->state != VF_ENABLED) {
-                       DP(BNX2X_MSG_IOV,
-                          "vf %d not enabled so no stats for it\n",
-                          vf->abs_vfid);
+                       DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_STATS),
+                              "vf %d not enabled so no stats for it\n",
+                              vf->abs_vfid);
                        continue;
                }
 
@@ -2597,7 +2597,8 @@ void bnx2x_iov_sp_task(struct bnx2x *bp)
        /* Iterate over all VFs and invoke state transition for VFs with
         * 'in-progress' slow-path operations
         */
-       DP(BNX2X_MSG_IOV, "searching for pending vf operations\n");
+       DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_SP),
+              "searching for pending vf operations\n");
        for_each_vf(bp, i) {
                struct bnx2x_virtf *vf = BP_VF(bp, i);