DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings
@ 2016-06-20 10:44 Simon Kagstrom
  2016-06-20 16:19 ` Stephen Hemminger
  2016-06-23 21:26 ` Thomas Monjalon
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Kagstrom @ 2016-06-20 10:44 UTC (permalink / raw)
  To: olivier.matz, dev

I.e., avoid dump messages with double 0x0x, e.g.,

  dump mbuf at 0x0x7fac7b17c800, phys=17b17c880, buf_len=2176
    pkt_len=2064, ol_flags=0, nb_segs=1, in_port=255
    segment at 0x0x7fac7b17c800, data=0x0x7fac7b17c8f0, data_len=2064

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
 lib/librte_mbuf/rte_mbuf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index dc0467c..523e219 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -218,7 +218,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
 
 	__rte_mbuf_sanity_check(m, 1);
 
-	fprintf(f, "dump mbuf at 0x%p, phys=%"PRIx64", buf_len=%u\n",
+	fprintf(f, "dump mbuf at %p, phys=%"PRIx64", buf_len=%u\n",
 	       m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);
 	fprintf(f, "  pkt_len=%"PRIu32", ol_flags=%"PRIx64", nb_segs=%u, "
 	       "in_port=%u\n", m->pkt_len, m->ol_flags,
@@ -228,7 +228,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
 	while (m && nb_segs != 0) {
 		__rte_mbuf_sanity_check(m, 0);
 
-		fprintf(f, "  segment at 0x%p, data=0x%p, data_len=%u\n",
+		fprintf(f, "  segment at %p, data=%p, data_len=%u\n",
 			m, rte_pktmbuf_mtod(m, void *), (unsigned)m->data_len);
 		len = dump_len;
 		if (len > m->data_len)
-- 
1.9.1

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

* Re: [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings
  2016-06-20 10:44 [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings Simon Kagstrom
@ 2016-06-20 16:19 ` Stephen Hemminger
  2016-06-21 13:11   ` Ferruh Yigit
  2016-06-23 21:26 ` Thomas Monjalon
  1 sibling, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2016-06-20 16:19 UTC (permalink / raw)
  To: Simon Kagstrom; +Cc: olivier.matz, dev

On Mon, 20 Jun 2016 12:44:35 +0200
Simon Kagstrom <simon.kagstrom@netinsight.net> wrote:

> I.e., avoid dump messages with double 0x0x, e.g.,
> 
>   dump mbuf at 0x0x7fac7b17c800, phys=17b17c880, buf_len=2176
>     pkt_len=2064, ol_flags=0, nb_segs=1, in_port=255
>     segment at 0x0x7fac7b17c800, data=0x0x7fac7b17c8f0, data_len=2064
> 
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>

Agreed. Many other places have same glitch.

$ git grep '0x%p'
drivers/net/vmxnet3/vmxnet3_rxtx.c:                "RXQ: cmd0 base : 0x%p cmd1 base : 0x%p comp ring base : 0x%p.",
drivers/net/vmxnet3/vmxnet3_rxtx.c:     PMD_TX_LOG(DEBUG, "TXQ: cmd base : 0x%p comp ring base : 0x%p data ring base : 0x%p.",
lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c:      printk(KERN_DEBUG "ixgbe_get_regs_2 0x%p\n", hw->hw_addr);
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("tx_phys:      0x%016llx, tx_q addr:      0x%p\n",
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("rx_phys:      0x%016llx, rx_q addr:      0x%p\n",
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("alloc_phys:   0x%016llx, alloc_q addr:   0x%p\n",
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("free_phys:    0x%016llx, free_q addr:    0x%p\n",
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("req_phys:     0x%016llx, req_q addr:     0x%p\n",
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("resp_phys:    0x%016llx, resp_q addr:    0x%p\n",
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("mbuf_phys:    0x%016llx, mbuf_kva:       0x%p\n",
lib/librte_eal/linuxapp/kni/kni_misc.c: KNI_PRINT("mbuf_va:      0x%p\n", dev_info.mbuf_va);
lib/librte_eal/linuxapp/kni/kni_misc.c:                 KNI_DBG("PCI found: pci=0x%p, lad_dev=0x%p\n",
lib/librte_mbuf/rte_mbuf.c:     fprintf(f, "dump mbuf at 0x%p, phys=%"PRIx64", buf_len=%u\n",
lib/librte_mbuf/rte_mbuf.c:             fprintf(f, "  segment at 0x%p, data=0x%p, data_len=%u\n",

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

* Re: [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings
  2016-06-20 16:19 ` Stephen Hemminger
@ 2016-06-21 13:11   ` Ferruh Yigit
  2016-06-22  7:08     ` Simon Kågström
  0 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2016-06-21 13:11 UTC (permalink / raw)
  To: Stephen Hemminger, Simon Kagstrom; +Cc: olivier.matz, dev

On 6/20/2016 5:19 PM, Stephen Hemminger wrote:
> On Mon, 20 Jun 2016 12:44:35 +0200
> Simon Kagstrom <simon.kagstrom@netinsight.net> wrote:
> 
>> I.e., avoid dump messages with double 0x0x, e.g.,
>>
>>   dump mbuf at 0x0x7fac7b17c800, phys=17b17c880, buf_len=2176
>>     pkt_len=2064, ol_flags=0, nb_segs=1, in_port=255
>>     segment at 0x0x7fac7b17c800, data=0x0x7fac7b17c8f0, data_len=2064
>>
>> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
> 
> Agreed. Many other places have same glitch.
> 

Hi Simon,

Are you planning to extend your patch to fix all, or I can send a patch
for kni and vmxnet3?

Thanks,
ferruh

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

* Re: [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings
  2016-06-21 13:11   ` Ferruh Yigit
@ 2016-06-22  7:08     ` Simon Kågström
  2016-06-23 10:52       ` [dpdk-dev] [PATCH] vmxnet3: remove 0x prefix for %p format Ferruh Yigit
  2016-06-23 10:58       ` [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings Ferruh Yigit
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Kågström @ 2016-06-22  7:08 UTC (permalink / raw)
  To: Ferruh Yigit, Stephen Hemminger; +Cc: olivier.matz, dev

On 2016-06-21 15:11, Ferruh Yigit wrote:
> On 6/20/2016 5:19 PM, Stephen Hemminger wrote:
>> On Mon, 20 Jun 2016 12:44:35 +0200
>> Simon Kagstrom <simon.kagstrom@netinsight.net> wrote:
>>
>>> I.e., avoid dump messages with double 0x0x, e.g.,
>>>
>>>   dump mbuf at 0x0x7fac7b17c800, phys=17b17c880, buf_len=2176
>>>     pkt_len=2064, ol_flags=0, nb_segs=1, in_port=255
>>>     segment at 0x0x7fac7b17c800, data=0x0x7fac7b17c8f0, data_len=2064
>>>
>>> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
>>
>> Agreed. Many other places have same glitch.
> 
> Are you planning to extend your patch to fix all, or I can send a patch
> for kni and vmxnet3?

I wasn't planning on that (this is something I just stumbled upon), so
please go ahead!

// Simon

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

* [dpdk-dev] [PATCH] vmxnet3: remove 0x prefix for %p format
  2016-06-22  7:08     ` Simon Kågström
@ 2016-06-23 10:52       ` Ferruh Yigit
  2016-06-23 20:45         ` Yong Wang
  2016-06-23 10:58       ` [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings Ferruh Yigit
  1 sibling, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2016-06-23 10:52 UTC (permalink / raw)
  To: dev; +Cc: Yong Wang

To prevent double 0x in logs

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index ccafc0c..1e0fde0 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -96,7 +96,7 @@ vmxnet3_rxq_dump(struct vmxnet3_rx_queue *rxq)
 		return;
 
 	PMD_RX_LOG(DEBUG,
-		   "RXQ: cmd0 base : 0x%p cmd1 base : 0x%p comp ring base : 0x%p.",
+		   "RXQ: cmd0 base : %p cmd1 base : %p comp ring base : %p.",
 		   rxq->cmd_ring[0].base, rxq->cmd_ring[1].base, rxq->comp_ring.base);
 	PMD_RX_LOG(DEBUG,
 		   "RXQ: cmd0 basePA : 0x%lx cmd1 basePA : 0x%lx comp ring basePA : 0x%lx.",
@@ -126,7 +126,7 @@ vmxnet3_txq_dump(struct vmxnet3_tx_queue *txq)
 	if (txq == NULL)
 		return;
 
-	PMD_TX_LOG(DEBUG, "TXQ: cmd base : 0x%p comp ring base : 0x%p data ring base : 0x%p.",
+	PMD_TX_LOG(DEBUG, "TXQ: cmd base : %p comp ring base : %p data ring base : %p.",
 		   txq->cmd_ring.base, txq->comp_ring.base, txq->data_ring.base);
 	PMD_TX_LOG(DEBUG, "TXQ: cmd basePA : 0x%lx comp ring basePA : 0x%lx data ring basePA : 0x%lx.",
 		   (unsigned long)txq->cmd_ring.basePA,
-- 
2.5.5

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

* Re: [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings
  2016-06-22  7:08     ` Simon Kågström
  2016-06-23 10:52       ` [dpdk-dev] [PATCH] vmxnet3: remove 0x prefix for %p format Ferruh Yigit
@ 2016-06-23 10:58       ` Ferruh Yigit
  1 sibling, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2016-06-23 10:58 UTC (permalink / raw)
  To: Simon Kågström, Stephen Hemminger; +Cc: olivier.matz, dev

On 6/22/2016 8:08 AM, Simon Kågström wrote:
> On 2016-06-21 15:11, Ferruh Yigit wrote:
>> On 6/20/2016 5:19 PM, Stephen Hemminger wrote:
>>> On Mon, 20 Jun 2016 12:44:35 +0200
>>> Simon Kagstrom <simon.kagstrom@netinsight.net> wrote:
>>>
>>>> I.e., avoid dump messages with double 0x0x, e.g.,
>>>>
>>>>   dump mbuf at 0x0x7fac7b17c800, phys=17b17c880, buf_len=2176
>>>>     pkt_len=2064, ol_flags=0, nb_segs=1, in_port=255
>>>>     segment at 0x0x7fac7b17c800, data=0x0x7fac7b17c8f0, data_len=2064
>>>>
>>>> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
>>>
>>> Agreed. Many other places have same glitch.
>>
>> Are you planning to extend your patch to fix all, or I can send a patch
>> for kni and vmxnet3?
> 
> I wasn't planning on that (this is something I just stumbled upon), so
> please go ahead!
> 

For KNI, 0x%p is valid usage for printk(), so only sending patch for
vmxnet3.

Thanks,
ferruh

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

* Re: [dpdk-dev] [PATCH] vmxnet3: remove 0x prefix for %p format
  2016-06-23 10:52       ` [dpdk-dev] [PATCH] vmxnet3: remove 0x prefix for %p format Ferruh Yigit
@ 2016-06-23 20:45         ` Yong Wang
  2016-06-24 16:44           ` Bruce Richardson
  0 siblings, 1 reply; 9+ messages in thread
From: Yong Wang @ 2016-06-23 20:45 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Yong Wang

> On Jun 23, 2016, at 3:52 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
> To prevent double 0x in logs
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> —

Acked-by: Yong Wang <yongwang@vmware.com>

> drivers/net/vmxnet3/vmxnet3_rxtx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> index ccafc0c..1e0fde0 100644
> --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> @@ -96,7 +96,7 @@ vmxnet3_rxq_dump(struct vmxnet3_rx_queue *rxq)
> 		return;
> 
> 	PMD_RX_LOG(DEBUG,
> -		   "RXQ: cmd0 base : 0x%p cmd1 base : 0x%p comp ring base : 0x%p.",
> +		   "RXQ: cmd0 base : %p cmd1 base : %p comp ring base : %p.",
> 		   rxq->cmd_ring[0].base, rxq->cmd_ring[1].base, rxq->comp_ring.base);
> 	PMD_RX_LOG(DEBUG,
> 		   "RXQ: cmd0 basePA : 0x%lx cmd1 basePA : 0x%lx comp ring basePA : 0x%lx.",
> @@ -126,7 +126,7 @@ vmxnet3_txq_dump(struct vmxnet3_tx_queue *txq)
> 	if (txq == NULL)
> 		return;
> 
> -	PMD_TX_LOG(DEBUG, "TXQ: cmd base : 0x%p comp ring base : 0x%p data ring base : 0x%p.",
> +	PMD_TX_LOG(DEBUG, "TXQ: cmd base : %p comp ring base : %p data ring base : %p.",
> 		   txq->cmd_ring.base, txq->comp_ring.base, txq->data_ring.base);
> 	PMD_TX_LOG(DEBUG, "TXQ: cmd basePA : 0x%lx comp ring basePA : 0x%lx data ring basePA : 0x%lx.",
> 		   (unsigned long)txq->cmd_ring.basePA,
> -- 
> 2.5.5
> 

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

* Re: [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings
  2016-06-20 10:44 [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings Simon Kagstrom
  2016-06-20 16:19 ` Stephen Hemminger
@ 2016-06-23 21:26 ` Thomas Monjalon
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2016-06-23 21:26 UTC (permalink / raw)
  To: Simon Kagstrom; +Cc: dev, olivier.matz

2016-06-20 12:44, Simon Kagstrom:
> I.e., avoid dump messages with double 0x0x, e.g.,
> 
>   dump mbuf at 0x0x7fac7b17c800, phys=17b17c880, buf_len=2176
>     pkt_len=2064, ol_flags=0, nb_segs=1, in_port=255
>     segment at 0x0x7fac7b17c800, data=0x0x7fac7b17c8f0, data_len=2064
> 
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>

Applied, thanks

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

* Re: [dpdk-dev] [PATCH] vmxnet3: remove 0x prefix for %p format
  2016-06-23 20:45         ` Yong Wang
@ 2016-06-24 16:44           ` Bruce Richardson
  0 siblings, 0 replies; 9+ messages in thread
From: Bruce Richardson @ 2016-06-24 16:44 UTC (permalink / raw)
  To: Yong Wang; +Cc: Ferruh Yigit, dev

On Thu, Jun 23, 2016 at 01:45:43PM -0700, Yong Wang wrote:
> > On Jun 23, 2016, at 3:52 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> > 
> > To prevent double 0x in logs

The commit message would be better as the title and vice versa, I think.

> > 
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > —
> 
> Acked-by: Yong Wang <yongwang@vmware.com>
> 

Applied to dpdk-next-net/rel_16_07 with updated title.

/Bruce

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

end of thread, other threads:[~2016-06-24 16:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 10:44 [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings Simon Kagstrom
2016-06-20 16:19 ` Stephen Hemminger
2016-06-21 13:11   ` Ferruh Yigit
2016-06-22  7:08     ` Simon Kågström
2016-06-23 10:52       ` [dpdk-dev] [PATCH] vmxnet3: remove 0x prefix for %p format Ferruh Yigit
2016-06-23 20:45         ` Yong Wang
2016-06-24 16:44           ` Bruce Richardson
2016-06-23 10:58       ` [dpdk-dev] PATCH] mbuf: rte_pktmbuf_dump: don't add 0x when using %p in format strings Ferruh Yigit
2016-06-23 21:26 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).