This would allow for separate control of datapath-related logs vs
non-datapath logs.

Signed-off-by: Joshua Washington <joshw...@google.com>
Reviewed-by: Ankit Garg <nkt...@google.com>
---
 drivers/net/gve/gve_logs.h   |  3 +++
 drivers/net/gve/gve_rx_dqo.c |  5 +++--
 drivers/net/gve/gve_tx_dqo.c | 11 ++++++-----
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/gve/gve_logs.h b/drivers/net/gve/gve_logs.h
index a3d50fa45c..beada20e02 100644
--- a/drivers/net/gve/gve_logs.h
+++ b/drivers/net/gve/gve_logs.h
@@ -11,4 +11,7 @@ extern int gve_logtype_driver;
 #define PMD_DRV_LOG(level, ...) \
        RTE_LOG_LINE_PREFIX(level, GVE_DRIVER, "%s(): ", __func__, __VA_ARGS__)
 
+#define PMD_DRV_DP_LOG(level, ...) \
+       RTE_LOG_DP_LINE_PREFIX(level, GVE_DRIVER, "%s(): ", __func__,  
__VA_ARGS__)
+
 #endif
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index cd85d90bb6..ccaca1b0ea 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -27,8 +27,9 @@ gve_rx_refill_dqo(struct gve_rx_queue *rxq)
                rxq->stats.no_mbufs += nb_refill;
                dev = &rte_eth_devices[rxq->port_id];
                dev->data->rx_mbuf_alloc_failed += nb_refill;
-               PMD_DRV_LOG(DEBUG, "RX mbuf alloc failed port_id=%u 
queue_id=%u",
-                           rxq->port_id, rxq->queue_id);
+               PMD_DRV_DP_LOG(DEBUG,
+                              "RX mbuf alloc failed port_id=%u queue_id=%u",
+                              rxq->port_id, rxq->queue_id);
                return;
        }
 
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index c36c215b94..10ef645802 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -42,7 +42,7 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq)
                aim_txq->last_desc_cleaned = compl_tag;
                break;
        case GVE_COMPL_TYPE_DQO_REINJECTION:
-               PMD_DRV_LOG(DEBUG, "GVE_COMPL_TYPE_DQO_REINJECTION !!!");
+               PMD_DRV_DP_LOG(DEBUG, "GVE_COMPL_TYPE_DQO_REINJECTION !!!");
                /* FALLTHROUGH */
        case GVE_COMPL_TYPE_DQO_PKT:
                /* free all segments. */
@@ -58,10 +58,10 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq)
                break;
        case GVE_COMPL_TYPE_DQO_MISS:
                rte_delay_us_sleep(1);
-               PMD_DRV_LOG(DEBUG, "GVE_COMPL_TYPE_DQO_MISS ignored !!!");
+               PMD_DRV_DP_LOG(DEBUG, "GVE_COMPL_TYPE_DQO_MISS ignored !!!");
                break;
        default:
-               PMD_DRV_LOG(ERR, "unknown completion type.");
+               PMD_DRV_DP_LOG(ERR, "unknown completion type.");
                return;
        }
 
@@ -206,7 +206,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, 
uint16_t nb_pkts)
 
 
                if (rte_mbuf_check(tx_pkt, true, &reason)) {
-                       PMD_DRV_LOG(DEBUG, "Invalid mbuf: %s", reason);
+                       PMD_DRV_DP_LOG(DEBUG, "Invalid mbuf: %s", reason);
                        break;
                }
 
@@ -243,7 +243,8 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, 
uint16_t nb_pkts)
 
                do {
                        if (sw_ring[sw_id] != NULL)
-                               PMD_DRV_LOG(DEBUG, "Overwriting an entry in 
sw_ring");
+                               PMD_DRV_DP_LOG(DEBUG,
+                                              "Overwriting an entry in 
sw_ring");
 
                        /* Skip writing descriptor if mbuf has no data. */
                        if (!tx_pkt->data_len)
-- 
2.51.0.rc1.167.g924127e9c0-goog

Reply via email to