[v2,7/7] net/tap: don't print pointer in info message
diff mbox series

Message ID 20190111203520.19944-8-stephen@networkplumber.org
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/tap: fixes and cleanups
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Stephen Hemminger Jan. 11, 2019, 8:35 p.m. UTC
Printing pointer in log is uninformative (unless in a debugger),
instead print the assigned kernel device name which correlates
well with what TAP is doing.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/tap/rte_eth_tap.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Ferruh Yigit Jan. 14, 2019, 2:10 p.m. UTC | #1
On 1/11/2019 8:35 PM, Stephen Hemminger wrote:
> Printing pointer in log is uninformative (unless in a debugger),
> instead print the assigned kernel device name which correlates
> well with what TAP is doing.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Wiles, Keith Jan. 14, 2019, 3:07 p.m. UTC | #2
> On Jan 11, 2019, at 2:35 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> Printing pointer in log is uninformative (unless in a debugger),
> instead print the assigned kernel device name which correlates
> well with what TAP is doing.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/net/tap/rte_eth_tap.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index 705c90dadee5..586c8a952df9 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -853,6 +853,8 @@ tap_dev_stop(struct rte_eth_dev *dev)
> static int
> tap_dev_configure(struct rte_eth_dev *dev)
> {
> +	struct pmd_internals *pmd = dev->data->dev_private;
> +
> 	if (dev->data->nb_rx_queues > RTE_PMD_TAP_MAX_QUEUES) {
> 		TAP_LOG(ERR,
> 			"%s: number of rx queues %d exceeds max num of queues %d",
> @@ -870,11 +872,11 @@ tap_dev_configure(struct rte_eth_dev *dev)
> 		return -1;
> 	}
> 
> -	TAP_LOG(INFO, "%s: %p: TX configured queues number: %u",
> -		dev->device->name, (void *)dev, dev->data->nb_tx_queues);
> +	TAP_LOG(INFO, "%s: %s: TX configured queues number: %u",
> +		dev->device->name, pmd->name, dev->data->nb_tx_queues);
> 
> -	TAP_LOG(INFO, "%s: %p: RX configured queues number: %u",
> -		dev->device->name, (void *)dev, dev->data->nb_rx_queues);
> +	TAP_LOG(INFO, "%s: %s: RX configured queues number: %u",
> +		dev->device->name, pmd->name, dev->data->nb_rx_queues);

Acked-by: Keith Wiles <keith.wiles@intel.com>
> 
> 	return 0;
> }
> -- 
> 2.20.1
> 

Regards,
Keith

Patch
diff mbox series

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 705c90dadee5..586c8a952df9 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -853,6 +853,8 @@  tap_dev_stop(struct rte_eth_dev *dev)
 static int
 tap_dev_configure(struct rte_eth_dev *dev)
 {
+	struct pmd_internals *pmd = dev->data->dev_private;
+
 	if (dev->data->nb_rx_queues > RTE_PMD_TAP_MAX_QUEUES) {
 		TAP_LOG(ERR,
 			"%s: number of rx queues %d exceeds max num of queues %d",
@@ -870,11 +872,11 @@  tap_dev_configure(struct rte_eth_dev *dev)
 		return -1;
 	}
 
-	TAP_LOG(INFO, "%s: %p: TX configured queues number: %u",
-		dev->device->name, (void *)dev, dev->data->nb_tx_queues);
+	TAP_LOG(INFO, "%s: %s: TX configured queues number: %u",
+		dev->device->name, pmd->name, dev->data->nb_tx_queues);
 
-	TAP_LOG(INFO, "%s: %p: RX configured queues number: %u",
-		dev->device->name, (void *)dev, dev->data->nb_rx_queues);
+	TAP_LOG(INFO, "%s: %s: RX configured queues number: %u",
+		dev->device->name, pmd->name, dev->data->nb_rx_queues);
 
 	return 0;
 }