DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeontx_ep: fixed format specifier
@ 2021-02-10 10:20 Nalla Pradeep
  2021-03-08 15:13 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Nalla Pradeep @ 2021-02-10 10:20 UTC (permalink / raw)
  To: Nalla Pradeep, Radha Mohan Chintakuntla, Veerasenareddy Burru; +Cc: jerinj, dev

Used PRIx64 format specifier where ever the variable getting printed
is of type uint64

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
---
 drivers/net/octeontx_ep/otx_ep_rxtx.c | 51 +++++++++++----------------
 1 file changed, 20 insertions(+), 31 deletions(-)

diff --git a/drivers/net/octeontx_ep/otx_ep_rxtx.c b/drivers/net/octeontx_ep/otx_ep_rxtx.c
index 28ff74d2d..4a7ddc264 100644
--- a/drivers/net/octeontx_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeontx_ep/otx_ep_rxtx.c
@@ -118,9 +118,8 @@ otx_ep_init_instr_queue(struct otx_ep_device *otx_ep, int iq_no, int num_descs,
 		goto iq_init_fail;
 	}
 
-	otx_ep_info("IQ[%d]: base: %p basedma: %lx count: %d\n",
-		     iq_no, iq->base_addr, (unsigned long)iq->base_addr_dma,
-		     iq->nb_desc);
+	otx_ep_info("IQ[%d]: base: %p basedma: %" PRIx64 "count: %d\n",
+		    iq_no, iq->base_addr, iq->base_addr_dma, iq->nb_desc);
 
 	iq->otx_ep_dev = otx_ep;
 	iq->q_no = iq_no;
@@ -298,8 +297,8 @@ otx_ep_init_droq(struct otx_ep_device *otx_ep, uint32_t q_no,
 	droq->desc_ring_dma = droq->desc_ring_mz->iova;
 	droq->desc_ring = (struct otx_ep_droq_desc *)droq->desc_ring_mz->addr;
 
-	otx_ep_dbg("OQ[%d]: desc_ring: virt: 0x%p, dma: %lx\n",
-		    q_no, droq->desc_ring, (unsigned long)droq->desc_ring_dma);
+	otx_ep_dbg("OQ[%d]: desc_ring: virt: 0x%p, dma: %" PRIx64 "\n",
+		    q_no, droq->desc_ring, droq->desc_ring_dma);
 	otx_ep_dbg("OQ[%d]: num_desc: %d\n", q_no, droq->nb_desc);
 
 	/* OQ buf_list set up */
@@ -621,16 +620,14 @@ otx_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
 
 #ifdef OTX_EP_IO_DEBUG
 		otx_ep_dbg("After swapping\n");
-		otx_ep_dbg("Word0 [dptr]: 0x%016lx\n",
-			   (unsigned long)iqcmd.dptr);
-		otx_ep_dbg("Word1 [ihtx]: 0x%016lx\n", (unsigned long)iqcmd.ih);
-		otx_ep_dbg("Word2 [pki_ih3]: 0x%016lx\n",
-			   (unsigned long)iqcmd.pki_ih3);
-		otx_ep_dbg("Word3 [rptr]: 0x%016lx\n",
-			   (unsigned long)iqcmd.rptr);
-		otx_ep_dbg("Word4 [irh]: 0x%016lx\n", (unsigned long)iqcmd.irh);
-		otx_ep_dbg("Word5 [exhdr[0]]: 0x%016lx\n",
-				(unsigned long)iqcmd.exhdr[0]);
+		otx_ep_dbg("Word0 [dptr]: 0x%016" PRIx64 "\n", iqcmd.dptr);
+		otx_ep_dbg("Word1 [ihtx]: 0x%016" PRIx64 "\n", iqcmd.ih.u64);
+		otx_ep_dbg("Word2 [pki_ih3]: 0x%016" PRIx64 "\n",
+			   iqcmd.pki_ih3.u64);
+		otx_ep_dbg("Word3 [rptr]: 0x%016" PRIx64 "\n", iqcmd.rptr);
+		otx_ep_dbg("Word4 [irh]: 0x%016" PRIx64 "\n", iqcmd.irh.u64);
+		otx_ep_dbg("Word5 [exhdr[0]]: 0x%016" PRIx64 "\n",
+			   iqcmd.exhdr[0]);
 		rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
 #endif
 		dbell = (i == (unsigned int)(nb_pkts - 1)) ? 1 : 0;
@@ -754,16 +751,12 @@ otx2_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
 
 #ifdef OTX_EP_IO_DEBUG
 		otx_ep_dbg("After swapping\n");
-		otx_ep_dbg("Word0 [dptr]: 0x%016lx\n",
-			   (unsigned long)iqcmd.dptr);
-		otx_ep_dbg("Word1 [ihtx]: 0x%016lx\n", (unsigned long)iqcmd.ih);
-		otx_ep_dbg("Word2 [pki_ih3]: 0x%016lx\n",
-			   (unsigned long)iqcmd.pki_ih3);
-		otx_ep_dbg("Word3 [rptr]: 0x%016lx\n",
-			   (unsigned long)iqcmd.rptr);
-		otx_ep_dbg("Word4 [irh]: 0x%016lx\n", (unsigned long)iqcmd.irh);
-		otx_ep_dbg("Word5 [exhdr[0]]: 0x%016lx\n",
-			   (unsigned long)iqcmd.exhdr[0]);
+		otx_ep_dbg("Word0 [dptr]: 0x%016" PRIx64 "\n", iqcmd2.dptr);
+		otx_ep_dbg("Word1 [ihtx]: 0x%016" PRIx64 "\n", iqcmd2.ih.u64);
+		otx_ep_dbg("Word2 [rptr]: 0x%016" PRIx64 "\n", iqcmd2.rptr);
+		otx_ep_dbg("Word3 [irh]: 0x%016" PRIx64 "\n", iqcmd2.irh.u64);
+		otx_ep_dbg("Word4 [exhdr[0]]: 0x%016" PRIx64 "\n",
+			   iqcmd2.exhdr[0]);
 #endif
 		index = iq->host_write_index;
 		dbell = (i == (unsigned int)(nb_pkts - 1)) ? 1 : 0;
@@ -837,7 +830,7 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
 	struct otx_ep_droq_info *info2;
 	uint64_t total_pkt_len;
 	uint32_t pkt_len = 0;
-	int next_idx;
+	int next_idx, retry;
 
 	droq_pkt  = droq->recv_buf_list[droq->read_idx];
 	droq_pkt2  = droq->recv_buf_list[droq->read_idx];
@@ -845,11 +838,7 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
 	/* make sure info is available */
 	rte_rmb();
 	if (unlikely(!info->length)) {
-		int retry = OTX_EP_MAX_DELAYED_PKT_RETRIES;
-		/* otx_ep_dbg("OCTEON DROQ[%d]: read_idx: %d; Data not ready "
-		 * "yet, Retry; pending=%lu\n", droq->q_no, droq->read_idx,
-		 * droq->pkts_pending);
-		 */
+		retry = OTX_EP_MAX_DELAYED_PKT_RETRIES;
 		droq->stats.pkts_delayed_data++;
 		while (retry && !info->length)
 			retry--;
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/octeontx_ep: fixed format specifier
  2021-02-10 10:20 [dpdk-dev] [PATCH] net/octeontx_ep: fixed format specifier Nalla Pradeep
@ 2021-03-08 15:13 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2021-03-08 15:13 UTC (permalink / raw)
  To: Nalla Pradeep
  Cc: Radha Mohan Chintakuntla, Veerasenareddy Burru, Jerin Jacob, dpdk-dev

On Wed, Feb 10, 2021 at 3:52 PM Nalla Pradeep <pnalla@marvell.com> wrote:
>
> Used PRIx64 format specifier where ever the variable getting printed
> is of type uint64

Fixes: tag is missing. Please send an updated version. rest looks good to me.




>
> Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
> ---
>  drivers/net/octeontx_ep/otx_ep_rxtx.c | 51 +++++++++++----------------
>  1 file changed, 20 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/net/octeontx_ep/otx_ep_rxtx.c b/drivers/net/octeontx_ep/otx_ep_rxtx.c
> index 28ff74d2d..4a7ddc264 100644
> --- a/drivers/net/octeontx_ep/otx_ep_rxtx.c
> +++ b/drivers/net/octeontx_ep/otx_ep_rxtx.c
> @@ -118,9 +118,8 @@ otx_ep_init_instr_queue(struct otx_ep_device *otx_ep, int iq_no, int num_descs,
>                 goto iq_init_fail;
>         }
>
> -       otx_ep_info("IQ[%d]: base: %p basedma: %lx count: %d\n",
> -                    iq_no, iq->base_addr, (unsigned long)iq->base_addr_dma,
> -                    iq->nb_desc);
> +       otx_ep_info("IQ[%d]: base: %p basedma: %" PRIx64 "count: %d\n",
> +                   iq_no, iq->base_addr, iq->base_addr_dma, iq->nb_desc);
>
>         iq->otx_ep_dev = otx_ep;
>         iq->q_no = iq_no;
> @@ -298,8 +297,8 @@ otx_ep_init_droq(struct otx_ep_device *otx_ep, uint32_t q_no,
>         droq->desc_ring_dma = droq->desc_ring_mz->iova;
>         droq->desc_ring = (struct otx_ep_droq_desc *)droq->desc_ring_mz->addr;
>
> -       otx_ep_dbg("OQ[%d]: desc_ring: virt: 0x%p, dma: %lx\n",
> -                   q_no, droq->desc_ring, (unsigned long)droq->desc_ring_dma);
> +       otx_ep_dbg("OQ[%d]: desc_ring: virt: 0x%p, dma: %" PRIx64 "\n",
> +                   q_no, droq->desc_ring, droq->desc_ring_dma);
>         otx_ep_dbg("OQ[%d]: num_desc: %d\n", q_no, droq->nb_desc);
>
>         /* OQ buf_list set up */
> @@ -621,16 +620,14 @@ otx_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
>
>  #ifdef OTX_EP_IO_DEBUG
>                 otx_ep_dbg("After swapping\n");
> -               otx_ep_dbg("Word0 [dptr]: 0x%016lx\n",
> -                          (unsigned long)iqcmd.dptr);
> -               otx_ep_dbg("Word1 [ihtx]: 0x%016lx\n", (unsigned long)iqcmd.ih);
> -               otx_ep_dbg("Word2 [pki_ih3]: 0x%016lx\n",
> -                          (unsigned long)iqcmd.pki_ih3);
> -               otx_ep_dbg("Word3 [rptr]: 0x%016lx\n",
> -                          (unsigned long)iqcmd.rptr);
> -               otx_ep_dbg("Word4 [irh]: 0x%016lx\n", (unsigned long)iqcmd.irh);
> -               otx_ep_dbg("Word5 [exhdr[0]]: 0x%016lx\n",
> -                               (unsigned long)iqcmd.exhdr[0]);
> +               otx_ep_dbg("Word0 [dptr]: 0x%016" PRIx64 "\n", iqcmd.dptr);
> +               otx_ep_dbg("Word1 [ihtx]: 0x%016" PRIx64 "\n", iqcmd.ih.u64);
> +               otx_ep_dbg("Word2 [pki_ih3]: 0x%016" PRIx64 "\n",
> +                          iqcmd.pki_ih3.u64);
> +               otx_ep_dbg("Word3 [rptr]: 0x%016" PRIx64 "\n", iqcmd.rptr);
> +               otx_ep_dbg("Word4 [irh]: 0x%016" PRIx64 "\n", iqcmd.irh.u64);
> +               otx_ep_dbg("Word5 [exhdr[0]]: 0x%016" PRIx64 "\n",
> +                          iqcmd.exhdr[0]);
>                 rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
>  #endif
>                 dbell = (i == (unsigned int)(nb_pkts - 1)) ? 1 : 0;
> @@ -754,16 +751,12 @@ otx2_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
>
>  #ifdef OTX_EP_IO_DEBUG
>                 otx_ep_dbg("After swapping\n");
> -               otx_ep_dbg("Word0 [dptr]: 0x%016lx\n",
> -                          (unsigned long)iqcmd.dptr);
> -               otx_ep_dbg("Word1 [ihtx]: 0x%016lx\n", (unsigned long)iqcmd.ih);
> -               otx_ep_dbg("Word2 [pki_ih3]: 0x%016lx\n",
> -                          (unsigned long)iqcmd.pki_ih3);
> -               otx_ep_dbg("Word3 [rptr]: 0x%016lx\n",
> -                          (unsigned long)iqcmd.rptr);
> -               otx_ep_dbg("Word4 [irh]: 0x%016lx\n", (unsigned long)iqcmd.irh);
> -               otx_ep_dbg("Word5 [exhdr[0]]: 0x%016lx\n",
> -                          (unsigned long)iqcmd.exhdr[0]);
> +               otx_ep_dbg("Word0 [dptr]: 0x%016" PRIx64 "\n", iqcmd2.dptr);
> +               otx_ep_dbg("Word1 [ihtx]: 0x%016" PRIx64 "\n", iqcmd2.ih.u64);
> +               otx_ep_dbg("Word2 [rptr]: 0x%016" PRIx64 "\n", iqcmd2.rptr);
> +               otx_ep_dbg("Word3 [irh]: 0x%016" PRIx64 "\n", iqcmd2.irh.u64);
> +               otx_ep_dbg("Word4 [exhdr[0]]: 0x%016" PRIx64 "\n",
> +                          iqcmd2.exhdr[0]);
>  #endif
>                 index = iq->host_write_index;
>                 dbell = (i == (unsigned int)(nb_pkts - 1)) ? 1 : 0;
> @@ -837,7 +830,7 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
>         struct otx_ep_droq_info *info2;
>         uint64_t total_pkt_len;
>         uint32_t pkt_len = 0;
> -       int next_idx;
> +       int next_idx, retry;
>
>         droq_pkt  = droq->recv_buf_list[droq->read_idx];
>         droq_pkt2  = droq->recv_buf_list[droq->read_idx];
> @@ -845,11 +838,7 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
>         /* make sure info is available */
>         rte_rmb();
>         if (unlikely(!info->length)) {
> -               int retry = OTX_EP_MAX_DELAYED_PKT_RETRIES;
> -               /* otx_ep_dbg("OCTEON DROQ[%d]: read_idx: %d; Data not ready "
> -                * "yet, Retry; pending=%lu\n", droq->q_no, droq->read_idx,
> -                * droq->pkts_pending);
> -                */
> +               retry = OTX_EP_MAX_DELAYED_PKT_RETRIES;
>                 droq->stats.pkts_delayed_data++;
>                 while (retry && !info->length)
>                         retry--;
> --
> 2.17.1
>

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

end of thread, other threads:[~2021-03-08 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 10:20 [dpdk-dev] [PATCH] net/octeontx_ep: fixed format specifier Nalla Pradeep
2021-03-08 15:13 ` Jerin Jacob

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).