Skip to contentSkip to conversation

Remove uses of PMD logtype

PATCH Superseded Stephen Hemminger 3 participants 20 messages Mar 31, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

cover Remove uses of PMD logtype

While working on netvsc driver, noticed that there are still some places in some drivers using the old PMD static logtype. Would like to eradicate all of these and even mark it as deprecated in a future release.

Stephen Hemminger (7):
net/mvneta: do not use PMD logtype
net/virtio: do not use PMD logtype
net/tap: do not use PMD logtype
net/pfe: do not use PMD logtype
net/bnxt: don't use PMD logtype
net/dpaa: use dynamic logtype
net/thunderx: use dynamic logtype

 drivers/net/bnxt/bnxt_ring.c            |  2 +-
 drivers/net/dpaa/dpaa_ethdev.c          | 24 +++++++++---------------
 drivers/net/mvneta/mvneta_ethdev.c      |  2 +-
 drivers/net/pfe/pfe_ethdev.c            |  4 ++--
 drivers/net/tap/rte_eth_tap.c           |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c     | 17 +++++++++--------
 drivers/net/virtio/virtio_rxtx.c        |  6 +++---
 drivers/net/virtio/virtio_user_ethdev.c |  2 +-
 8 files changed, 30 insertions(+), 33 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/7 net/mvneta: do not use PMD logtype

The PMD logtype is legacy and should not be used.

Fixes 3378383dceab ("net/mvneta: support statistics reset")
---
 drivers/net/mvneta/mvneta_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mvneta/mvneta_ethdev.c +1 -1
index 865ad61aed1c..4aea87648814 100644
@@ -751,7 +751,7 @@ mvneta_stats_reset(struct rte_eth_dev *dev)
 
 	ret = mvneta_stats_get(dev, &priv->prev_stats);
 	if (unlikely(ret))
-		RTE_LOG(ERR, PMD, "Failed to reset port statistics");
+		MVNETA_LOG(ERR, "Failed to reset port statistics");
 
 	return ret;
 }
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/7 net/virtio: do not use PMD logtype

In reply to Stephen Hemminger

Virtio driver has its own logtype adn should not use legacy PMD logtype.

---
 drivers/net/virtio/virtio_rxtx.c        | 6 +++---
 drivers/net/virtio/virtio_user_ethdev.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/virtio/virtio_rxtx.c +3 -3
index 752faa0f6e7e..060410577af4 100644
@@ -1085,7 +1085,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			RTE_MIN(vq->vq_nentries / 4, DEFAULT_TX_FREE_THRESH);
 
 	if (tx_free_thresh >= (vq->vq_nentries - 3)) {
-		RTE_LOG(ERR, PMD, "tx_free_thresh must be less than the "
+		PMD_DRV_LOG(ERR, "tx_free_thresh must be less than the "
 			"number of TX entries minus 3 (%u)."
 			" (tx_free_thresh=%u port=%u queue=%u)\n",
 			vq->vq_nentries - 3,
@@ -1133,7 +1133,7 @@ virtio_discard_rxbuf(struct virtqueue *vq, struct rte_mbuf *m)
 		error = virtqueue_enqueue_recv_refill(vq, &m, 1);
 
 	if (unlikely(error)) {
-		RTE_LOG(ERR, PMD, "cannot requeue discarded mbuf");
+		PMD_DRV_LOG(ERR, "cannot requeue discarded mbuf");
 		rte_pktmbuf_free(m);
 	}
 }
@@ -1145,7 +1145,7 @@ virtio_discard_rxbuf_inorder(struct virtqueue *vq, struct rte_mbuf *m)
 
 	error = virtqueue_enqueue_refill_inorder(vq, &m, 1);
 	if (unlikely(error)) {
-		RTE_LOG(ERR, PMD, "cannot requeue discarded mbuf");
+		PMD_DRV_LOG(ERR, "cannot requeue discarded mbuf");
 		rte_pktmbuf_free(m);
 	}
 }
drivers/net/virtio/virtio_user_ethdev.c +1 -1
index e61af4068322..4f565f913bf2 100644
@@ -561,7 +561,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
 		const char *name = rte_vdev_device_name(dev);
 		eth_dev = rte_eth_dev_attach_secondary(name);
 		if (!eth_dev) {
-			RTE_LOG(ERR, PMD, "Failed to probe %s\n", name);
+			PMD_INIT_LOG(ERR,"Failed to probe %s", name);
 			return -1;
 		}
 
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/7 net/tap: do not use PMD logtype

In reply to Stephen Hemminger

The PMD logtype is legacy and drivers should use their own logtype.

Fixes 050316a88313 ("net/tap: support TSO (TCP Segment Offload)")
---
 drivers/net/tap/rte_eth_tap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/tap/rte_eth_tap.c +4 -2
index 05470a211588..2c9fb76b63de 100644
@@ -778,7 +778,7 @@ tap_ioctl(struct pmd_internals *pmd, unsigned long request,
 	case SIOCSIFMTU:
 		break;
 	default:
-		RTE_LOG(WARNING, PMD, "%s: ioctl() called with wrong arg\n",
+		TAP_LOG(WARNING, "%s: ioctl() called with wrong arg",
 			pmd->name);
 		return -EINVAL;
 	}
@@ -1301,7 +1301,9 @@ tap_gso_ctx_setup(struct rte_gso_ctx *gso_ctx, struct rte_eth_dev *dev)
 			SOCKET_ID_ANY);
 		if (!mp) {
 			struct pmd_internals *pmd = dev->data->dev_private;
-			RTE_LOG(DEBUG, PMD, "%s: failed to create mbuf pool for device %s\n",
+
+			TAP_LOG(ERR,
+				"%s: failed to create mbuf pool for device %s\n",
 				pmd->name, dev->device->name);
 			return -1;
 		}
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/7 net/pfe: do not use PMD logtype

In reply to Stephen Hemminger

The PMD logtype is a legacy from original DPDK logging. All drivers must use their own dynamic log type.

Fixes b1bc1afa4a0e ("net/pfe: support dynamic logging")
---
 drivers/net/pfe/pfe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/pfe/pfe_ethdev.c +2 -2
index 940347819875..59b5b8387b9d 100644
@@ -990,7 +990,7 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)
 	if (rc < 0)
 		return -EINVAL;
 
-	RTE_LOG(INFO, PMD, "Initializing pmd_pfe for %s Given gem-id %d\n",
+	PFE_PMD_LOG(INFO, "Initializing pmd_pfe for %s Given gem-id %d",
 		name, init_params.gem_id);
 
 	if (g_pfe) {
@@ -1118,7 +1118,7 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)
 	else
 		gem_id = init_params.gem_id;
 
-	RTE_LOG(INFO, PMD, "Init pmd_pfe for %s gem-id %d(given =%d)\n",
+	PFE_PMD_LOG(INFO, "Init pmd_pfe for %s gem-id %d(given =%d)",
 		name, gem_id, init_params.gem_id);
 
 	rc = pfe_eth_init(vdev, g_pfe, gem_id);
Signature · 1 line
2.20.1
#5 lore raw

PATCH 5/7 net/bnxt: don't use PMD logtype

In reply to Stephen Hemminger

Accidental use of PMD logtype rather than per-driver logtype.

Fixes 14255b351537 ("net/bnxt: fix queue start/stop operations")
---
 drivers/net/bnxt/bnxt_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ring.c +1 -1
index d6e4e8a28138..1999cd7861b8 100644
@@ -598,7 +598,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 
 	if (rxq->rx_started) {
 		if (bnxt_init_one_rx_ring(rxq)) {
-			RTE_LOG(ERR, PMD,
+			PMD_DRV_LOG(ERR,
 				"bnxt_init_one_rx_ring failed!\n");
 			bnxt_rx_queue_release_op(rxq);
 			rc = -ENOMEM;
Signature · 1 line
2.20.1
Acked-by on v1 5/7
#6 lore raw

Re: [dpdk-dev] [PATCH 5/7] net/bnxt: don't use PMD logtype

Quoted 24 lines · Stephen Hemminger

Accidental use of PMD logtype rather than per-driver logtype.

Fixes 14255b351537 ("net/bnxt: fix queue start/stop operations")
---
 drivers/net/bnxt/bnxt_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ring.c +1 -2
index d6e4e8a28138..1999cd7861b8 100644
@@ -598,7 +598,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 
        if (rxq->rx_started) {
                if (bnxt_init_one_rx_ring(rxq)) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "bnxt_init_one_rx_ring failed!\n");
                        bnxt_rx_queue_release_op(rxq);
                        rc = -ENOMEM;
--
Quoted 2 lines

2.20.1

#7 lore raw

PATCH 6/7 net/dpaa: use dynamic logtype

In reply to Stephen Hemminger

The static PMD logtype should not be used by drivers. Instead, use existing log macros in this driver.

Also use standard rte_ether routine to format ether address.

Fixes 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup")
---
 drivers/net/dpaa/dpaa_ethdev.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +9 -15
index fce9ce2feb9d..f59c2631a56c 100644
@@ -881,8 +881,8 @@ dpaa_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	PMD_INIT_FUNC_TRACE();
 
 	if (qman_query_fq_frm_cnt(rxq, &frm_cnt) == 0) {
-		RTE_LOG(DEBUG, PMD, "RX frame count for q(%d) is %u\n",
-			rx_queue_id, frm_cnt);
+		DPAA_PMD_DEBUG("RX frame count for q(%d) is %u",
+			       rx_queue_id, frm_cnt);
 	}
 	return frm_cnt;
 }
@@ -996,8 +996,7 @@ dpaa_dev_add_mac_addr(struct rte_eth_dev *dev,
 	ret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, index);
 
 	if (ret)
-		RTE_LOG(ERR, PMD, "error: Adding the MAC ADDR failed:"
-			" err = %d", ret);
+		DPAA_PMD_ERR("Adding the MAC ADDR failed: err = %d", ret);
 	return 0;
 }
 
@@ -1023,7 +1022,7 @@ dpaa_dev_set_mac_addr(struct rte_eth_dev *dev,
 
 	ret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, 0);
 	if (ret)
-		RTE_LOG(ERR, PMD, "error: Setting the MAC ADDR failed %d", ret);
+		DPAA_PMD_ERR("Setting the MAC ADDR failed %d", ret);
 
 	return ret;
 }
@@ -1306,6 +1305,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	struct fman_if *fman_intf;
 	struct fman_if_bpool *bp, *tmp_bp;
 	uint32_t cgrid[DPAA_MAX_NUM_PCD_QUEUES];
+	char eth_buf[RTE_ETHER_ADDR_FMT_SIZE];
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1457,15 +1457,9 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
+	rte_ether_format_addr(eth_buf, sizeof(eth_buf), &fman_intf->mac_addr);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: %02x:%02x:%02x:%02x:%02x:%02x\n",
-		dpaa_device->name,
-		fman_intf->mac_addr.addr_bytes[0],
-		fman_intf->mac_addr.addr_bytes[1],
-		fman_intf->mac_addr.addr_bytes[2],
-		fman_intf->mac_addr.addr_bytes[3],
-		fman_intf->mac_addr.addr_bytes[4],
-		fman_intf->mac_addr.addr_bytes[5]);
+	DPAA_PMD_INFO("net: dpaa: %s: %s", dpaa_device->name, eth_buf);
 
 	/* Disable RX mode */
 	fman_if_discard_rx_errors(fman_intf);
@@ -1578,8 +1572,8 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 
 	if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) {
 		if (access("/tmp/fmc.bin", F_OK) == -1) {
-			RTE_LOG(INFO, PMD,
-				"* FMC not configured.Enabling default mode\n");
+			DPAA_PMD_INFO(
+				"* FMC not configured.Enabling default mode");
 			default_q = 1;
 		}
 
Signature · 1 line
2.20.1
#8 lore raw

PATCH 7/7 net/thunderx: use dynamic logtype

In reply to Stephen Hemminger

The PMD static logtype is original DPDK legacy and should not be used.

Fixes 43362c6a7647 ("net/thunderx: support RSS and RETA query and update")
---
 drivers/net/thunderx/nicvf_ethdev.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/net/thunderx/nicvf_ethdev.c +9 -8
index 6f43541a5d42..00e8287fac38 100644
@@ -496,9 +496,10 @@ nicvf_dev_reta_query(struct rte_eth_dev *dev,
 	int ret, i, j;
 
 	if (reta_size != NIC_MAX_RSS_IDR_TBL_SIZE) {
-		RTE_LOG(ERR, PMD, "The size of hash lookup table configured "
-			"(%d) doesn't match the number hardware can supported "
-			"(%d)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
+		PMD_DRV_LOG(ERR,
+			    "The size of hash lookup table configured "
+			    "(%u) doesn't match the number hardware can supported "
+			    "(%u)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
 		return -EINVAL;
 	}
 
@@ -526,9 +527,9 @@ nicvf_dev_reta_update(struct rte_eth_dev *dev,
 	int ret, i, j;
 
 	if (reta_size != NIC_MAX_RSS_IDR_TBL_SIZE) {
-		RTE_LOG(ERR, PMD, "The size of hash lookup table configured "
-			"(%d) doesn't match the number hardware can supported "
-			"(%d)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
+		PMD_DRV_LOG(ERR,"The size of hash lookup table configured "
+			"(%u) doesn't match the number hardware can supported "
+			"(%u)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
 		return -EINVAL;
 	}
 
@@ -569,8 +570,8 @@ nicvf_dev_rss_hash_update(struct rte_eth_dev *dev,
 
 	if (rss_conf->rss_key &&
 		rss_conf->rss_key_len != RSS_HASH_KEY_BYTE_SIZE) {
-		RTE_LOG(ERR, PMD, "Hash key size mismatch %d",
-				rss_conf->rss_key_len);
+		PMD_DRV_LOG(ERR, "Hash key size mismatch %u",
+			    rss_conf->rss_key_len);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.20.1
#9 lore raw

v2 cover Remove some uses of PMD logtype

In reply to Stephen Hemminger

While working on netvsc driver, noticed that there are still some places in some drivers using the old PMD static logtype. Would like to eradicate all of these and even mark it as deprecated in a future release.

v2 - fix checkpatch whitespace complaints

Stephen Hemminger (7):
net/mvneta: do not use PMD logtype
net/virtio: do not use PMD logtype
net/tap: do not use PMD logtype
net/pfe: do not use PMD logtype
net/bnxt: don't use PMD logtype
net/dpaa: use dynamic logtype
net/thunderx: use dynamic logtype

 drivers/net/bnxt/bnxt_ring.c            |  2 +-
 drivers/net/dpaa/dpaa_ethdev.c          | 23 ++++++++---------------
 drivers/net/mvneta/mvneta_ethdev.c      |  2 +-
 drivers/net/pfe/pfe_ethdev.c            |  4 ++--
 drivers/net/tap/rte_eth_tap.c           |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c     | 17 +++++++++--------
 drivers/net/virtio/virtio_rxtx.c        |  6 +++---
 drivers/net/virtio/virtio_user_ethdev.c |  2 +-
 8 files changed, 29 insertions(+), 33 deletions(-)
Signature · 1 line
2.20.1
#10 lore raw

PATCH v2 1/7 net/mvneta: do not use PMD logtype

The PMD logtype is legacy and should not be used.

Fixes 3378383dceab ("net/mvneta: support statistics reset")
---
 drivers/net/mvneta/mvneta_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mvneta/mvneta_ethdev.c +1 -1
index 865ad61aed1c..4aea87648814 100644
@@ -751,7 +751,7 @@ mvneta_stats_reset(struct rte_eth_dev *dev)
 
 	ret = mvneta_stats_get(dev, &priv->prev_stats);
 	if (unlikely(ret))
-		RTE_LOG(ERR, PMD, "Failed to reset port statistics");
+		MVNETA_LOG(ERR, "Failed to reset port statistics");
 
 	return ret;
 }
Signature · 1 line
2.20.1
#11 lore raw

PATCH v2 2/7 net/virtio: do not use PMD logtype

In reply to Stephen Hemminger

Virtio driver has its own logtype adn should not use legacy PMD logtype.

---
 drivers/net/virtio/virtio_rxtx.c        | 6 +++---
 drivers/net/virtio/virtio_user_ethdev.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/virtio/virtio_rxtx.c +3 -3
index 752faa0f6e7e..060410577af4 100644
@@ -1085,7 +1085,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			RTE_MIN(vq->vq_nentries / 4, DEFAULT_TX_FREE_THRESH);
 
 	if (tx_free_thresh >= (vq->vq_nentries - 3)) {
-		RTE_LOG(ERR, PMD, "tx_free_thresh must be less than the "
+		PMD_DRV_LOG(ERR, "tx_free_thresh must be less than the "
 			"number of TX entries minus 3 (%u)."
 			" (tx_free_thresh=%u port=%u queue=%u)\n",
 			vq->vq_nentries - 3,
@@ -1133,7 +1133,7 @@ virtio_discard_rxbuf(struct virtqueue *vq, struct rte_mbuf *m)
 		error = virtqueue_enqueue_recv_refill(vq, &m, 1);
 
 	if (unlikely(error)) {
-		RTE_LOG(ERR, PMD, "cannot requeue discarded mbuf");
+		PMD_DRV_LOG(ERR, "cannot requeue discarded mbuf");
 		rte_pktmbuf_free(m);
 	}
 }
@@ -1145,7 +1145,7 @@ virtio_discard_rxbuf_inorder(struct virtqueue *vq, struct rte_mbuf *m)
 
 	error = virtqueue_enqueue_refill_inorder(vq, &m, 1);
 	if (unlikely(error)) {
-		RTE_LOG(ERR, PMD, "cannot requeue discarded mbuf");
+		PMD_DRV_LOG(ERR, "cannot requeue discarded mbuf");
 		rte_pktmbuf_free(m);
 	}
 }
drivers/net/virtio/virtio_user_ethdev.c +1 -1
index e61af4068322..5637001dfccb 100644
@@ -561,7 +561,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
 		const char *name = rte_vdev_device_name(dev);
 		eth_dev = rte_eth_dev_attach_secondary(name);
 		if (!eth_dev) {
-			RTE_LOG(ERR, PMD, "Failed to probe %s\n", name);
+			PMD_INIT_LOG(ERR, "Failed to probe %s", name);
 			return -1;
 		}
 
Signature · 1 line
2.20.1
#12 lore raw

PATCH v2 3/7 net/tap: do not use PMD logtype

In reply to Stephen Hemminger

The PMD logtype is legacy and drivers should use their own logtype.

Fixes 050316a88313 ("net/tap: support TSO (TCP Segment Offload)")
---
 drivers/net/tap/rte_eth_tap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/tap/rte_eth_tap.c +4 -2
index 05470a211588..2c9fb76b63de 100644
@@ -778,7 +778,7 @@ tap_ioctl(struct pmd_internals *pmd, unsigned long request,
 	case SIOCSIFMTU:
 		break;
 	default:
-		RTE_LOG(WARNING, PMD, "%s: ioctl() called with wrong arg\n",
+		TAP_LOG(WARNING, "%s: ioctl() called with wrong arg",
 			pmd->name);
 		return -EINVAL;
 	}
@@ -1301,7 +1301,9 @@ tap_gso_ctx_setup(struct rte_gso_ctx *gso_ctx, struct rte_eth_dev *dev)
 			SOCKET_ID_ANY);
 		if (!mp) {
 			struct pmd_internals *pmd = dev->data->dev_private;
-			RTE_LOG(DEBUG, PMD, "%s: failed to create mbuf pool for device %s\n",
+
+			TAP_LOG(ERR,
+				"%s: failed to create mbuf pool for device %s\n",
 				pmd->name, dev->device->name);
 			return -1;
 		}
Signature · 1 line
2.20.1
#13 lore raw

PATCH v2 4/7 net/pfe: do not use PMD logtype

In reply to Stephen Hemminger

The PMD logtype is a legacy from original DPDK logging. All drivers must use their own dynamic log type.

Fixes b1bc1afa4a0e ("net/pfe: support dynamic logging")
---
 drivers/net/pfe/pfe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/pfe/pfe_ethdev.c +2 -2
index 940347819875..59b5b8387b9d 100644
@@ -990,7 +990,7 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)
 	if (rc < 0)
 		return -EINVAL;
 
-	RTE_LOG(INFO, PMD, "Initializing pmd_pfe for %s Given gem-id %d\n",
+	PFE_PMD_LOG(INFO, "Initializing pmd_pfe for %s Given gem-id %d",
 		name, init_params.gem_id);
 
 	if (g_pfe) {
@@ -1118,7 +1118,7 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)
 	else
 		gem_id = init_params.gem_id;
 
-	RTE_LOG(INFO, PMD, "Init pmd_pfe for %s gem-id %d(given =%d)\n",
+	PFE_PMD_LOG(INFO, "Init pmd_pfe for %s gem-id %d(given =%d)",
 		name, gem_id, init_params.gem_id);
 
 	rc = pfe_eth_init(vdev, g_pfe, gem_id);
Signature · 1 line
2.20.1
#14 lore raw

PATCH v2 5/7 net/bnxt: don't use PMD logtype

In reply to Stephen Hemminger

Accidental use of PMD logtype rather than per-driver logtype.

Fixes 14255b351537 ("net/bnxt: fix queue start/stop operations")
---
 drivers/net/bnxt/bnxt_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ring.c +1 -1
index d6e4e8a28138..1999cd7861b8 100644
@@ -598,7 +598,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)
 
 	if (rxq->rx_started) {
 		if (bnxt_init_one_rx_ring(rxq)) {
-			RTE_LOG(ERR, PMD,
+			PMD_DRV_LOG(ERR,
 				"bnxt_init_one_rx_ring failed!\n");
 			bnxt_rx_queue_release_op(rxq);
 			rc = -ENOMEM;
Signature · 1 line
2.20.1
#15 lore raw

PATCH v2 6/7 net/dpaa: use dynamic logtype

In reply to Stephen Hemminger

The static PMD logtype should not be used by drivers. Instead, use existing log macros in this driver.

Also use standard rte_ether routine to format ether address.

Fixes 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup")
---
 drivers/net/dpaa/dpaa_ethdev.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +8 -15
index fce9ce2feb9d..5f81968d80e1 100644
@@ -881,8 +881,8 @@ dpaa_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	PMD_INIT_FUNC_TRACE();
 
 	if (qman_query_fq_frm_cnt(rxq, &frm_cnt) == 0) {
-		RTE_LOG(DEBUG, PMD, "RX frame count for q(%d) is %u\n",
-			rx_queue_id, frm_cnt);
+		DPAA_PMD_DEBUG("RX frame count for q(%d) is %u",
+			       rx_queue_id, frm_cnt);
 	}
 	return frm_cnt;
 }
@@ -996,8 +996,7 @@ dpaa_dev_add_mac_addr(struct rte_eth_dev *dev,
 	ret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, index);
 
 	if (ret)
-		RTE_LOG(ERR, PMD, "error: Adding the MAC ADDR failed:"
-			" err = %d", ret);
+		DPAA_PMD_ERR("Adding the MAC ADDR failed: err = %d", ret);
 	return 0;
 }
 
@@ -1023,7 +1022,7 @@ dpaa_dev_set_mac_addr(struct rte_eth_dev *dev,
 
 	ret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, 0);
 	if (ret)
-		RTE_LOG(ERR, PMD, "error: Setting the MAC ADDR failed %d", ret);
+		DPAA_PMD_ERR("Setting the MAC ADDR failed %d", ret);
 
 	return ret;
 }
@@ -1306,6 +1305,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 	struct fman_if *fman_intf;
 	struct fman_if_bpool *bp, *tmp_bp;
 	uint32_t cgrid[DPAA_MAX_NUM_PCD_QUEUES];
+	char eth_buf[RTE_ETHER_ADDR_FMT_SIZE];
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1457,15 +1457,9 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 
 	/* copy the primary mac address */
 	rte_ether_addr_copy(&fman_intf->mac_addr, &eth_dev->data->mac_addrs[0]);
+	rte_ether_format_addr(eth_buf, sizeof(eth_buf), &fman_intf->mac_addr);
 
-	RTE_LOG(INFO, PMD, "net: dpaa: %s: %02x:%02x:%02x:%02x:%02x:%02x\n",
-		dpaa_device->name,
-		fman_intf->mac_addr.addr_bytes[0],
-		fman_intf->mac_addr.addr_bytes[1],
-		fman_intf->mac_addr.addr_bytes[2],
-		fman_intf->mac_addr.addr_bytes[3],
-		fman_intf->mac_addr.addr_bytes[4],
-		fman_intf->mac_addr.addr_bytes[5]);
+	DPAA_PMD_INFO("net: dpaa: %s: %s", dpaa_device->name, eth_buf);
 
 	/* Disable RX mode */
 	fman_if_discard_rx_errors(fman_intf);
@@ -1578,8 +1572,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 
 	if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) {
 		if (access("/tmp/fmc.bin", F_OK) == -1) {
-			RTE_LOG(INFO, PMD,
-				"* FMC not configured.Enabling default mode\n");
+			DPAA_PMD_INFO("* FMC not configured.Enabling default mode");
 			default_q = 1;
 		}
 
Signature · 1 line
2.20.1
#16 lore raw

PATCH v2 7/7 net/thunderx: use dynamic logtype

In reply to Stephen Hemminger

The PMD static logtype is original DPDK legacy and should not be used.

Fixes 43362c6a7647 ("net/thunderx: support RSS and RETA query and update")
---
 drivers/net/thunderx/nicvf_ethdev.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/net/thunderx/nicvf_ethdev.c +9 -8
index 6f43541a5d42..bfda0ab0ede8 100644
@@ -496,9 +496,10 @@ nicvf_dev_reta_query(struct rte_eth_dev *dev,
 	int ret, i, j;
 
 	if (reta_size != NIC_MAX_RSS_IDR_TBL_SIZE) {
-		RTE_LOG(ERR, PMD, "The size of hash lookup table configured "
-			"(%d) doesn't match the number hardware can supported "
-			"(%d)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
+		PMD_DRV_LOG(ERR,
+			    "The size of hash lookup table configured "
+			    "(%u) doesn't match the number hardware can supported "
+			    "(%u)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
 		return -EINVAL;
 	}
 
@@ -526,9 +527,9 @@ nicvf_dev_reta_update(struct rte_eth_dev *dev,
 	int ret, i, j;
 
 	if (reta_size != NIC_MAX_RSS_IDR_TBL_SIZE) {
-		RTE_LOG(ERR, PMD, "The size of hash lookup table configured "
-			"(%d) doesn't match the number hardware can supported "
-			"(%d)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
+		PMD_DRV_LOG(ERR, "The size of hash lookup table configured "
+			"(%u) doesn't match the number hardware can supported "
+			"(%u)", reta_size, NIC_MAX_RSS_IDR_TBL_SIZE);
 		return -EINVAL;
 	}
 
@@ -569,8 +570,8 @@ nicvf_dev_rss_hash_update(struct rte_eth_dev *dev,
 
 	if (rss_conf->rss_key &&
 		rss_conf->rss_key_len != RSS_HASH_KEY_BYTE_SIZE) {
-		RTE_LOG(ERR, PMD, "Hash key size mismatch %d",
-				rss_conf->rss_key_len);
+		PMD_DRV_LOG(ERR, "Hash key size mismatch %u",
+			    rss_conf->rss_key_len);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.20.1
#17 lore raw

Re: [dpdk-dev] [PATCH v2 0/7] Remove some uses of PMD logtype

In reply to Stephen Hemminger
Quoted 6 lines · Stephen Hemminger

While working on netvsc driver, noticed that there are still some places in some drivers using the old PMD static logtype. Would like to eradicate all of these and even mark it as deprecated in a future release.

v2 - fix checkpatch whitespace complaints

Hi Stephen,

I have applied the v1 and fixed the whitespace complaints while merging, is there anything else changed in v2?

Quoted 20 lines

Stephen Hemminger (7):
net/mvneta: do not use PMD logtype
net/virtio: do not use PMD logtype
net/tap: do not use PMD logtype
net/pfe: do not use PMD logtype
net/bnxt: don't use PMD logtype
net/dpaa: use dynamic logtype
net/thunderx: use dynamic logtype

 drivers/net/bnxt/bnxt_ring.c            |  2 +-
 drivers/net/dpaa/dpaa_ethdev.c          | 23 ++++++++---------------
 drivers/net/mvneta/mvneta_ethdev.c      |  2 +-
 drivers/net/pfe/pfe_ethdev.c            |  4 ++--
 drivers/net/tap/rte_eth_tap.c           |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c     | 17 +++++++++--------
 drivers/net/virtio/virtio_rxtx.c        |  6 +++---
 drivers/net/virtio/virtio_user_ethdev.c |  2 +-
 8 files changed, 29 insertions(+), 33 deletions(-)
#18 lore raw

Re: [dpdk-dev] [PATCH v2 0/7] Remove some uses of PMD logtype

Quoted 6 lines · Ferruh Yigit
Quoted 5 lines · Stephen Hemminger

While working on netvsc driver, noticed that there are still some places in some drivers using the old PMD static logtype. Would like to eradicate all of these and even mark it as deprecated in a future release.

Quoted 6 lines
Quoted 1 line

v2 - fix checkpatch whitespace complaints

Hi Stephen,

I have applied the v1 and fixed the whitespace complaints while merging, is there anything else changed in v2?

I double checked, there was only one line merging diff in dpaa and applied that too, so practically v2 has been merged.

Quoted 22 lines
Quoted 21 lines

Stephen Hemminger (7):
net/mvneta: do not use PMD logtype
net/virtio: do not use PMD logtype
net/tap: do not use PMD logtype
net/pfe: do not use PMD logtype
net/bnxt: don't use PMD logtype
net/dpaa: use dynamic logtype
net/thunderx: use dynamic logtype

 drivers/net/bnxt/bnxt_ring.c            |  2 +-
 drivers/net/dpaa/dpaa_ethdev.c          | 23 ++++++++---------------
 drivers/net/mvneta/mvneta_ethdev.c      |  2 +-
 drivers/net/pfe/pfe_ethdev.c            |  4 ++--
 drivers/net/tap/rte_eth_tap.c           |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c     | 17 +++++++++--------
 drivers/net/virtio/virtio_rxtx.c        |  6 +++---
 drivers/net/virtio/virtio_user_ethdev.c |  2 +-
 8 files changed, 29 insertions(+), 33 deletions(-)
Reviewed-by on the v1 series
#19 lore raw
In reply to Stephen Hemminger
Quoted 5 lines · Stephen Hemminger

While working on netvsc driver, noticed that there are still some places in some drivers using the old PMD static logtype. Would like to eradicate all of these and even mark it as deprecated in a future release.

Quoted 9 lines

Stephen Hemminger (7):
net/mvneta: do not use PMD logtype
net/virtio: do not use PMD logtype
net/tap: do not use PMD logtype
net/pfe: do not use PMD logtype
net/bnxt: don't use PMD logtype
net/dpaa: use dynamic logtype
net/thunderx: use dynamic logtype

For series,

Series applied to dpdk-next-net/master, thanks.