drivers: replace printf with log macros
Subsystems (2)
PATCH 1/2 drivers: replace printf with log macros
This patch replaces the printf with related log macros and functions at various places in NXP dpaaX drivers.
--- drivers/bus/dpaa/base/fman/fman.c | 8 +++---- drivers/bus/dpaa/base/qbman/process.c | 29 +++++++++++++------------- drivers/bus/dpaa/base/qbman/qman.c | 2 +- drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/qbman/qbman_portal.c | 2 +- drivers/crypto/caam_jr/caam_jr.c | 2 +- drivers/crypto/caam_jr/caam_jr_uio.c | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_flow.c | 8 +++---- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_tm.c | 10 ++++----- 12 files changed, 37 insertions(+), 38 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +3 -5
@@ -425,7 +425,7 @@ fman_if_init(const struct device_node *dpa_node) char_prop =of_get_property (mac_node,"phy-connection-type" ,NULL );if (!char_prop) { -printf ("memac: unknown MII type assuming 1G\n" ); +FMAN_ERR (-EINVAL ,"memac: unknown MII type assuming 1G\n" );/* Right now forcing memac to 1g in case of error*/ __if->__if.mac_type = fman_mac_1g; }else {
@@ -723,10 +723,8 @@ fman_finish(void)/* release the mapping */ _errno =munmap (__if->ccsr_map, __if->regs_size);if (unlikely (_errno <0 )) -fprintf (stderr,"%s:%d:%s(): munmap() = %d (%s)\n" , - __FILE__, __LINE__, __func__, - -errno,strerror (errno)); -printf ("Tearing down %s\n" , __if->node_path); +FMAN_ERR (_errno,"munmap() = (%s)\n" ,strerror (errno)); +DPAA_BUS_INFO ("Tearing down %s\n" , __if->node_path);list_del (&__if->__if.node);rte_free (__if); }
drivers/bus/dpaa/base/qbman/process.c +15 -14
@@ -13,6 +13,7 @@#include "process.h" #include <fsl_usd.h> +#include "rte_dpaa_logs.h" /* As higher-level drivers will be built on top of this (dma_mem, qbman, ...), * it's preferable that the process driver itself not provide any exported API.
@@ -99,12 +100,12 @@ void process_release(enum dpaa_id_type id_type, uint32_t base, uint32_t num)int ret =check_fd ();if (ret) { -fprintf (stderr,"Process FD failure\n" ); +DPAA_BUS_ERR ("Process FD failure\n" );return ; } ret =ioctl (fd,DPAA_IOCTL_ID_RELEASE , &id);if (ret) -fprintf (stderr,"Process FD ioctl failure type %d base 0x%x num %d\n" , +DPAA_BUS_ERR ("Process FD ioctl failure type %d base 0x%x num %d\n" , id_type, base, num); }
@@ -333,9 +334,9 @@ int dpaa_intr_disable(char *if_name) ret =ioctl (fd,DPAA_IOCTL_DISABLE_LINK_STATUS_INTERRUPT , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to disable interrupt: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt: Not Supported\n" );else -printf ("Failed to disable interrupt\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt\n" );return ret; }
@@ -357,7 +358,7 @@ int dpaa_get_ioctl_version_number(void)if (errno ==EINVAL ) { version_num =1 ; }else { -printf ("Failed to get ioctl version number\n" ); +DPAA_BUS_ERR ("Failed to get ioctl version number\n" ); version_num =-1 ; } }
@@ -388,7 +389,7 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS , &args);if (ret) { -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status\n" );return ret; }
@@ -404,9 +405,9 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS_OLD , &args);if (ret) {if (errno ==EINVAL ) -printf ("Get link status: Not Supported\n" ); +DPAA_BUS_ERR ("Get link status: Not Supported\n" );else -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status\n" );return ret; }
@@ -434,9 +435,9 @@ int dpaa_update_link_status(char *if_name, int link_status) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_STATUS , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link status: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link status: Not Supported\n" );else -printf ("Failed to set link status" ); +DPAA_BUS_ERR ("Failed to set link status" );return ret; }
@@ -462,9 +463,9 @@ int dpaa_update_link_speed(char *if_name, int link_speed, int link_duplex) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_SPEED , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link speed: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link speed: Not Supported\n" );else -printf ("Failed to set link speed\n" ); +DPAA_BUS_ERR ("Failed to set link speed\n" );return ret; }
@@ -484,9 +485,9 @@ int dpaa_restart_link_autoneg(char *if_name) ret =ioctl (fd,DPAA_IOCTL_RESTART_LINK_AUTONEG , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to restart autoneg: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg: Not Supported\n" );else -printf ("Failed to restart autoneg\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg\n" );return ret; }
drivers/bus/dpaa/base/qbman/qman.c +1 -1
@@ -818,7 +818,7 @@ qman_ern_poll_free(void) fd = &swapped_msg.ern.fd;if (unlikely (verb &0x20 )) { -printf ("HW ERN notification, Nothing to do\n" ); +pr_warn ("HW ERN notification, Nothing to do\n" ); }else {if ((fd->bpid &0xff ) !=0xff )qman_free_mbuf_cb (fd);
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -395,7 +395,7 @@ rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size) ret =ioctl (group->container->fd,VFIO_IOMMU_MAP_DMA , &dma_map);if (ret) { -printf ("Unable to map DMA address (errno = %d)\n" , +DPAA2_BUS_ERR ("Unable to map DMA address (errno = %d)\n" , errno);return ret; }
drivers/bus/fslmc/qbman/qbman_portal.c +1 -1
@@ -1879,7 +1879,7 @@ void qbman_pull_desc_set_rad(struct qbman_pull_desc *d, int rad)else d->pull.verb &= ~(1 <<QB_VDQCR_VERB_RAD_SHIFT ); }else { -printf ("The RAD feature is not valid when RLS = 0\n" ); +pr_warn ("The RAD feature is not valid when RLS = 0\n" ); } }
drivers/crypto/caam_jr/caam_jr.c +1 -1
@@ -587,7 +587,7 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring,/* todo check if it is false alarm no desc present */ if (!current_desc_addr) { false_alarm++; -printf ("false alarm %" PRIu64"real %" PRIu64 +CAAM_JR_ERR ("false alarm %" PRIu64"real %" PRIu64" sec_err =0x%x cidx Index =0%d\n" , false_alarm, real_poll, sec_error_code, job_ring->cidx);
drivers/crypto/caam_jr/caam_jr_uio.c +1 -1
@@ -418,7 +418,7 @@ sec_configure(void) d =opendir (SEC_UIO_DEVICE_SYS_ATTR_PATH );if (d ==NULL ) { -printf ("\nError opening directory '%s': %s\n" , +CAAM_JR_ERR ("Error opening directory '%s': %s\n" ,SEC_UIO_DEVICE_SYS_ATTR_PATH ,strerror (errno));return -1 ; }
drivers/net/dpaa/dpaa_ethdev.c +3 -3
@@ -282,9 +282,9 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_interrupt_handler, (void *)dev);if (ret ==EINVAL ) -printf ("Failed to enable interrupt: Not Supported\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt: Not Supported\n" );else -printf ("Failed to enable interrupt\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt\n" ); } dev->data->dev_conf.intr_conf.lsc =0 ; dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC ;
@@ -340,7 +340,7 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)dpaa_update_link_speed (__fif->node_name, speed, duplex); }else {/* Manual autoneg - custom advertisement speed. */ -printf ("Custom Advertisement speeds not supported\n" ); +DPAA_PMD_ERR ("Custom Advertisement speeds not supported\n" ); } }
drivers/net/dpaa/dpaa_flow.c +4 -4
@@ -68,7 +68,7 @@ static void fm_prev_cleanup(void) fm_info.fman_handle =fm_open (fman_id);if (!fm_info.fman_handle) { -printf ("\n%s- unable to open FMAN" , __func__); +DPAA_PMD_ERR ("unable to open FMAN" );return ; }
@@ -78,7 +78,7 @@ static void fm_prev_cleanup(void)/* FM PCD Open */ fm_info.pcd_handle =fm_pcd_open (&fm_pcd_params);if (!fm_info.pcd_handle) { -printf ("\n%s- unable to open PCD" , __func__); +DPAA_PMD_ERR ("unable to open PCD" );return ; }
@@ -108,11 +108,11 @@ static void fm_prev_cleanup(void)continue ;if (dpaa_fm_deconfig (&dpaa_intf,NULL )) -printf ("\nDPAA FM deconfig failed\n" ); +DPAA_PMD_ERR ("DPAA FM deconfig failed\n" ); }if (dpaa_fm_term ()) -printf ("\nDPAA FM term failed\n" ); +DPAA_PMD_ERR ("DPAA FM term failed\n" );memset (&fm_model,0 ,sizeof (struct dpaa_fm_model )); }
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -103,7 +103,7 @@ static void dpaa_display_frame_info(const struct qm_fd *fd,for (ii =0 ; ii < fd->length20; ii++) {DISPLAY_PRINT ("%02x " , ptr[ii]);if (((ii +1 ) %16 ) ==0 ) -printf ("\n" ); +DISPLAY_PRINT ("\n" ); }DISPLAY_PRINT ("\n" ); }
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2682,7 +2682,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->max_vlan_filters = attr.vlan_filter_entries; priv->flags =0 ;#if defined(RTE_LIBRTE_IEEE1588 ) -printf ("DPDK IEEE1588 is enabled\n" ); +DPAA2_PMD_INFO ("DPDK IEEE1588 is enabled\n" ); priv->flags |=DPAA2_TX_CONF_ENABLE ;#endif /* Used with ``fslmc:dpni.1,drv_tx_conf=1`` */
drivers/net/dpaa2/dpaa2_tm.c +5 -5
@@ -499,7 +499,7 @@ dpaa2_node_add(struct rte_eth_dev *dev, uint32_t node_id, node->channel_id = priv->channel_inuse; priv->channel_inuse++; }else { -printf ("error no channel id available\n" ); +DPAA2_PMD_ERR ("error no channel id available\n" ); } }
@@ -580,7 +580,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) flow_id =0 ;if (dpaa2_q ==NULL ) { -printf ("Queue is not configured for node = %d\n" , node->id); +DPAA2_PMD_ERR ("Queue is not configured for node = %d\n" , node->id);return -1 ; }
@@ -590,7 +590,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), flow_id, options, &tx_flow_cfg);if (ret) { - printf("Error in setting the tx flow: " + DPAA2_PMD_ERR("Error in setting the tx flow: " "channel id = %d tc_id= %d, param = 0x%x " "flow=%d err=%d\n", node->parent->channel_id, tc_id, ((node->parent->channel_id << 8) | tc_id), flow_id,
@@ -605,7 +605,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node)DPNI_QUEUE_TX , ((node->parent->channel_id <<8 ) | dpaa2_q->tc_index), dpaa2_q->flow_id, &tx_flow_cfg, &qid);if (ret) { -printf ("Error in getting LFQID err=%d" , ret); +DPAA2_PMD_ERR ("Error in getting LFQID err=%d" , ret);return -1 ; } dpaa2_q->fqid = qid.fqid;
@@ -636,7 +636,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), &cong_notif_cfg);if (ret) { -printf ("Error in setting tx congestion notification: " +DPAA2_PMD_ERR ("Error in setting tx congestion notification: " "err=%d" , ret);return -ret; }
Signature · 1 line
2.17.1
PATCH 2/2 drivers: replace printf with fprintf for debug functions
This patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
--- drivers/bus/dpaa/base/fman/netcfg_layer.c | 20 ++++---- drivers/crypto/caam_jr/caam_jr.c | 4 +- drivers/crypto/caam_jr/caam_jr_desc.h | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 20 ++++---- drivers/crypto/dpaa_sec/dpaa_sec.c | 52 ++++++++++----------- drivers/net/dpaa2/dpaa2_flow.c | 40 ++++++++-------- 6 files changed, 69 insertions(+), 69 deletions(-)
drivers/bus/dpaa/base/fman/netcfg_layer.c +10 -10
@@ -33,33 +33,33 @@ dump_netcfg(struct netcfg_info *cfg_ptr) {int i; -printf (".......... DPAA Configuration ..........\n\n" ); +fprintf (stdout,".......... DPAA Configuration ..........\n\n" );/* Network interfaces */ -printf ("Network interfaces: %d\n" , cfg_ptr->num_ethports); +fprintf (stdout,"Network interfaces: %d\n" , cfg_ptr->num_ethports);for (i =0 ; i < cfg_ptr->num_ethports; i++) {struct fman_if_bpool *bpool;struct fm_eth_port_cfg *p_cfg = &cfg_ptr->port_cfg[i];struct fman_if *__if = p_cfg->fman_if; -printf ("\n+ Fman %d, MAC %d (%s);\n" , +fprintf (stdout,"\n+ Fman %d, MAC %d (%s);\n" , __if->fman_idx, __if->mac_idx, (__if->mac_type == fman_mac_1g) ?"1G" : (__if->mac_type == fman_mac_2_5g) ?"2.5G" :"10G" ); -printf ("\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" , +fprintf (stdout,"\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" ,RTE_ETHER_ADDR_BYTES (&__if->mac_addr)); -printf ("\ttx_channel_id: 0x%02x\n" , +fprintf (stdout,"\ttx_channel_id: 0x%02x\n" , __if->tx_channel_id); -printf ("\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); -printf ("\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); +fprintf (stdout,"\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); +fprintf (stdout,"\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); -printf ("\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); -printf ("\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm); +fprintf (stdout,"\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); +fprintf (stdout,"\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm);fman_if_for_each_bpool (bpool, __if) -printf ("\tbuffer pool: (bpid=%d, count=%" PRId64 +fprintf (stdout,"\tbuffer pool: (bpid=%d, count=%" PRId64" size=%" PRId64", addr=0x%" PRIx64")\n" , bpool->bpid, bpool->count, bpool->size, bpool->addr);
drivers/crypto/caam_jr/caam_jr.c +2 -2
@@ -1410,9 +1410,9 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) rte_pktmbuf_mtod(op->sym->m_src, void *),rte_pktmbuf_data_len (op->sym->m_src)); -printf ("\n JD before conversion\n" ); +fprintf (stdout,"\n JD before conversion\n" );for (i =0 ; i <12 ; i++) -printf ("\n 0x%08x" , ctx->jobdes.desc[i]); +fprintf (stdout,"\n 0x%08x" , ctx->jobdes.desc[i]);#endif CAAM_JR_DP_DEBUG("Jr[%p] pi[%d] ci[%d].Before sending desc",
drivers/crypto/caam_jr/caam_jr_desc.h +1 -1
@@ -116,7 +116,7 @@for (__i =0 ; \ __i <SEC_GET_DESC_LEN (descriptor); \ __i++) { \ -printf ("0x%08x: 0x%08x\n" , \ +fprintf (stdout,"0x%08x: 0x%08x\n" , \ (uint32_t )(((uint32_t *)(descriptor)) + __i), \ *(((uint32_t *)(descriptor)) + __i)); \ } \
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +10 -10
@@ -1685,7 +1685,7 @@ dpaa2_sec_dump(struct rte_crypto_op *op) goto mbuf_dump; priv = (struct ctxt_priv *)sess->ctxt; - printf("\n****************************************\n" + fprintf(stdout, "\n****************************************\n" "session params:\n\tContext type:\t%d\n\tDirection:\t%s\n" "\tCipher alg:\t%d\n\tAuth alg:\t%d\n\tAead alg:\t%d\n" "\tCipher key len:\t%zd\n", sess->ctxt_type,
@@ -1696,7 +1696,7 @@ dpaa2_sec_dump(struct rte_crypto_op *op) sess->cipher_key.length);rte_hexdump (stdout,"auth key" , sess->auth_key.data, sess->auth_key.length); - printf("\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" + fprintf(stdout, "\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" "\tdigest length:\t%d\n\tstatus:\t\t%d\n\taead auth only" " len:\t%d\n\taead cipher text:\t%d\n", sess->auth_key.length, sess->iv.length, sess->iv.offset,
@@ -1704,7 +1704,7 @@ dpaa2_sec_dump(struct rte_crypto_op *op) sess->ext_params.aead_ctxt.auth_only_len, sess->ext_params.aead_ctxt.auth_cipher_text);#ifdef RTE_LIBRTE_SECURITY - printf("PDCP session params:\n" + fprintf(stdout, "PDCP session params:\n" "\tDomain:\t\t%d\n\tBearer:\t\t%d\n\tpkt_dir:\t%d\n\thfn_ovd:" "\t%d\n\tsn_size:\t%d\n\thfn_ovd_offset:\t%d\n\thfn:\t\t%d\n" "\thfn_threshold:\t0x%x\n", sess->pdcp.domain,
@@ -1714,29 +1714,29 @@ dpaa2_sec_dump(struct rte_crypto_op *op)#endif bufsize = (uint8_t )priv->flc_desc[0 ].flc.word1_sdl; -printf ("Descriptor Dump:\n" ); +fprintf (stdout,"Descriptor Dump:\n" );for (i =0 ; i < bufsize; i++) -printf ("\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); +fprintf (stdout,"\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); -printf ("\n" ); +fprintf (stdout,"\n" ); mbuf_dump: sym_op = op->sym;if (sym_op->m_src) { -printf ("Source mbuf:\n" ); +fprintf (stdout,"Source mbuf:\n" );rte_pktmbuf_dump (stdout, sym_op->m_src, sym_op->m_src->data_len); }if (sym_op->m_dst) { -printf ("Destination mbuf:\n" ); +fprintf (stdout,"Destination mbuf:\n" );rte_pktmbuf_dump (stdout, sym_op->m_dst, sym_op->m_dst->data_len); } -printf ("Session address = %p\ncipher offset: %d, length: %d\n" +fprintf (stdout,"Session address = %p\ncipher offset: %d, length: %d\n" "auth offset: %d, length: %d\n aead offset: %d, length: %d\n" , sym_op->session, sym_op->cipher.data.offset, sym_op->cipher.data.length, sym_op->auth.data.offset, sym_op->auth.data.length, sym_op->aead.data.offset, sym_op->aead.data.length); -printf ("\n" ); +fprintf (stdout,"\n" ); }
drivers/crypto/dpaa_sec/dpaa_sec.c +26 -26
119 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_flow.c +20 -20
@@ -244,7 +244,7 @@ static inline void dpaa2_flow_qos_table_extracts_log(if (!dpaa2_flow_control_log)return ; -printf ("Setup QoS table: number of extracts: %d\r\n" , +fprintf (stdout,"Setup QoS table: number of extracts: %d\r\n" , priv->extract.qos_key_extract.dpkg.num_extracts);for (idx =0 ; idx < priv->extract.qos_key_extract.dpkg.num_extracts; idx++) {
@@ -253,11 +253,11 @@ static inline void dpaa2_flow_qos_table_extracts_log( priv->extract.qos_key_extract.dpkg.extracts[idx] .extract.from_hdr.field, string); -printf ("%s" , string); +fprintf (stdout,"%s" , string);if ((idx +1 ) < priv->extract.qos_key_extract.dpkg.num_extracts) -printf (" / " ); +fprintf (stdout," / " ); } -printf ("\r\n" ); +fprintf (stdout,"\r\n" ); } static inline void dpaa2_flow_fs_table_extracts_log(
@@ -269,7 +269,7 @@ static inline void dpaa2_flow_fs_table_extracts_log(if (!dpaa2_flow_control_log)return ; -printf ("Setup FS table: number of extracts of TC[%d]: %d\r\n" , +fprintf (stdout,"Setup FS table: number of extracts of TC[%d]: %d\r\n" , tc_id, priv->extract.tc_key_extract[tc_id] .dpkg.num_extracts); for (idx = 0; idx < priv->extract.tc_key_extract[tc_id]
@@ -279,12 +279,12 @@ static inline void dpaa2_flow_fs_table_extracts_log( priv->extract.tc_key_extract[tc_id].dpkg.extracts[idx] .extract.from_hdr.field, string); -printf ("%s" , string); +fprintf (stdout,"%s" , string);if ((idx +1 ) < priv->extract.tc_key_extract[tc_id] .dpkg.num_extracts) -printf (" / " ); +fprintf (stdout," / " ); } -printf ("\r\n" ); +fprintf (stdout,"\r\n" ); } static inline void dpaa2_flow_qos_entry_log(
@@ -296,21 +296,21 @@ static inline void dpaa2_flow_qos_entry_log(if (!dpaa2_flow_control_log)return ; -printf ("\r\n%s QoS entry[%d] for TC[%d], extracts size is %d\r\n" , +fprintf (stdout,"\r\n%s QoS entry[%d] for TC[%d], extracts size is %d\r\n" , log_info, qos_index, flow->tc_id, flow->qos_real_key_size); key = (uint8_t *)(size_t )flow->qos_rule.key_iova; mask = (uint8_t *)(size_t )flow->qos_rule.mask_iova; -printf ("key:\r\n" ); +fprintf (stdout,"key:\r\n" );for (idx =0 ; idx < flow->qos_real_key_size; idx++) -printf ("%02x " , key[idx]); +fprintf (stdout,"%02x " , key[idx]); -printf ("\r\nmask:\r\n" ); +fprintf (stdout,"\r\nmask:\r\n" );for (idx =0 ; idx < flow->qos_real_key_size; idx++) -printf ("%02x " , mask[idx]); +fprintf (stdout,"%02x " , mask[idx]); -printf ("\r\n%s QoS ipsrc: %d, ipdst: %d\r\n" , log_info, +fprintf (stdout,"\r\n%s QoS ipsrc: %d, ipdst: %d\r\n" , log_info, flow->ipaddr_rule.qos_ipsrc_offset, flow->ipaddr_rule.qos_ipdst_offset); }
@@ -324,21 +324,21 @@ static inline void dpaa2_flow_fs_entry_log(if (!dpaa2_flow_control_log)return ; -printf ("\r\n%s FS/TC entry[%d] of TC[%d], extracts size is %d\r\n" , +fprintf (stdout,"\r\n%s FS/TC entry[%d] of TC[%d], extracts size is %d\r\n" , log_info, flow->tc_index, flow->tc_id, flow->fs_real_key_size); key = (uint8_t *)(size_t )flow->fs_rule.key_iova; mask = (uint8_t *)(size_t )flow->fs_rule.mask_iova; -printf ("key:\r\n" ); +fprintf (stdout,"key:\r\n" );for (idx =0 ; idx < flow->fs_real_key_size; idx++) -printf ("%02x " , key[idx]); +fprintf (stdout,"%02x " , key[idx]); -printf ("\r\nmask:\r\n" ); +fprintf (stdout,"\r\nmask:\r\n" );for (idx =0 ; idx < flow->fs_real_key_size; idx++) -printf ("%02x " , mask[idx]); +fprintf (stdout,"%02x " , mask[idx]); -printf ("\r\n%s FS ipsrc: %d, ipdst: %d\r\n" , log_info, +fprintf (stdout,"\r\n%s FS ipsrc: %d, ipdst: %d\r\n" , log_info, flow->ipaddr_rule.fs_ipsrc_offset, flow->ipaddr_rule.fs_ipdst_offset); }
Signature · 1 line
2.17.1
Re: [PATCH 2/2] drivers: replace printf with fprintf for debug functions
15/02/2023 11:29, Hemant Agrawal:
Quoted 2 lines
This patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
Why replacing with fprintf(stdout)?
Would it be better to provide a FILE* parameter to the functions?
Re: [PATCH 2/2] drivers: replace printf with fprintf for debug functions
Quoted 6 lines · Thomas Monjalon
15/02/2023 11:29, Hemant Agrawal:
Quoted 2 lines
This patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
Why replacing with fprintf(stdout)?
Would it be better to provide a FILE* parameter to the functions?
yes, I will update.
Quoted 3 lines
Re: [PATCH 2/2] drivers: replace printf with fprintf for debug functions
Hello Hemant,
Quoted 8 lines · Hemant Agrawal
Quoted 6 lines · Thomas Monjalon
15/02/2023 11:29, Hemant Agrawal:
Quoted 2 lines
This patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
Why replacing with fprintf(stdout)?
Would it be better to provide a FILE* parameter to the functions?
yes, I will update.
Any news for this series?
At least a rebase is needed, I marked it as changes requested.
Signature · 1 line
David Marchand
Re: [PATCH 2/2] drivers: replace printf with fprintf for debug functions
Quoted 6 lines · David Marchand
Hello Hemant,
Quoted 2 lines · Hemant Agrawal
Quoted 1 line · Thomas Monjalon
15/02/2023 11:29, Hemant Agrawal:
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
This patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
Why replacing with fprintf(stdout)?
Would it be better to provide a FILE* parameter to the functions?
yes, I will update.
Any news for this series?
At least a rebase is needed, I marked it as changes requested.
I missed it. i will send it.
Quoted 2 lines
Re: [PATCH 2/2] drivers: replace printf with fprintf for debug functions
In reply to Hemant Agrawaldrivers/bus/dpaa/base/fman/netcfg_layer.c dump_netcfg(struct netcfg_info *cfg_ptr) · line 37
Quoted 11 lines · On Wed, 15 Feb 2023 15:59:05 +0530 Hemant Agrawal <[email protected]>…
drivers/bus/dpaa/base/fman/netcfg_layer.c +1
-1@@ -33,33 +33,33 @@ dump_netcfg(struct netcfg_info *cfg_ptr) {int i; -printf (".......... DPAA Configuration ..........\n\n" ); +fprintf (stdout,".......... DPAA Configuration ..........\n\n" );
If you only do "printf -> fprintf(stdout," then it doesn't make sense. Ideally change debug interface to take a user supplied output FILE * like other dump routines.
PATCH v2 1/2 drivers: replace printf with log macros
In reply to Hemant AgrawalThis patch replaces the printf with related log macros and functions at various places in NXP dpaaX drivers.
--- drivers/bus/dpaa/base/fman/fman.c | 8 +++---- drivers/bus/dpaa/base/qbman/process.c | 29 +++++++++++++------------- drivers/bus/dpaa/base/qbman/qman.c | 2 +- drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/qbman/qbman_portal.c | 2 +- drivers/crypto/caam_jr/caam_jr.c | 2 +- drivers/crypto/caam_jr/caam_jr_uio.c | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_flow.c | 8 +++---- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_tm.c | 10 ++++----- 12 files changed, 37 insertions(+), 38 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +3 -5
@@ -425,7 +425,7 @@ fman_if_init(const struct device_node *dpa_node) char_prop =of_get_property (mac_node,"phy-connection-type" ,NULL );if (!char_prop) { -printf ("memac: unknown MII type assuming 1G\n" ); +FMAN_ERR (-EINVAL ,"memac: unknown MII type assuming 1G\n" );/* Right now forcing memac to 1g in case of error*/ __if->__if.mac_type = fman_mac_1g; }else {
@@ -723,10 +723,8 @@ fman_finish(void)/* release the mapping */ _errno =munmap (__if->ccsr_map, __if->regs_size);if (unlikely (_errno <0 )) -fprintf (stderr,"%s:%d:%s(): munmap() = %d (%s)\n" , - __FILE__, __LINE__, __func__, - -errno,strerror (errno)); -printf ("Tearing down %s\n" , __if->node_path); +FMAN_ERR (_errno,"munmap() = (%s)\n" ,strerror (errno)); +DPAA_BUS_INFO ("Tearing down %s\n" , __if->node_path);list_del (&__if->__if.node);rte_free (__if); }
drivers/bus/dpaa/base/qbman/process.c +15 -14
@@ -13,6 +13,7 @@#include "process.h" #include <fsl_usd.h> +#include "rte_dpaa_logs.h" /* As higher-level drivers will be built on top of this (dma_mem, qbman, ...), * it's preferable that the process driver itself not provide any exported API.
@@ -99,12 +100,12 @@ void process_release(enum dpaa_id_type id_type, uint32_t base, uint32_t num)int ret =check_fd ();if (ret) { -fprintf (stderr,"Process FD failure\n" ); +DPAA_BUS_ERR ("Process FD failure\n" );return ; } ret =ioctl (fd,DPAA_IOCTL_ID_RELEASE , &id);if (ret) -fprintf (stderr,"Process FD ioctl failure type %d base 0x%x num %d\n" , +DPAA_BUS_ERR ("Process FD ioctl failure type %d base 0x%x num %d\n" , id_type, base, num); }
@@ -333,9 +334,9 @@ int dpaa_intr_disable(char *if_name) ret =ioctl (fd,DPAA_IOCTL_DISABLE_LINK_STATUS_INTERRUPT , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to disable interrupt: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt: Not Supported\n" );else -printf ("Failed to disable interrupt\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt\n" );return ret; }
@@ -357,7 +358,7 @@ int dpaa_get_ioctl_version_number(void)if (errno ==EINVAL ) { version_num =1 ; }else { -printf ("Failed to get ioctl version number\n" ); +DPAA_BUS_ERR ("Failed to get ioctl version number\n" ); version_num =-1 ; } }
@@ -388,7 +389,7 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS , &args);if (ret) { -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status\n" );return ret; }
@@ -404,9 +405,9 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS_OLD , &args);if (ret) {if (errno ==EINVAL ) -printf ("Get link status: Not Supported\n" ); +DPAA_BUS_ERR ("Get link status: Not Supported\n" );else -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status\n" );return ret; }
@@ -434,9 +435,9 @@ int dpaa_update_link_status(char *if_name, int link_status) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_STATUS , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link status: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link status: Not Supported\n" );else -printf ("Failed to set link status" ); +DPAA_BUS_ERR ("Failed to set link status" );return ret; }
@@ -462,9 +463,9 @@ int dpaa_update_link_speed(char *if_name, int link_speed, int link_duplex) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_SPEED , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link speed: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link speed: Not Supported\n" );else -printf ("Failed to set link speed\n" ); +DPAA_BUS_ERR ("Failed to set link speed\n" );return ret; }
@@ -484,9 +485,9 @@ int dpaa_restart_link_autoneg(char *if_name) ret =ioctl (fd,DPAA_IOCTL_RESTART_LINK_AUTONEG , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to restart autoneg: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg: Not Supported\n" );else -printf ("Failed to restart autoneg\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg\n" );return ret; }
drivers/bus/dpaa/base/qbman/qman.c +1 -1
@@ -817,7 +817,7 @@ qman_ern_poll_free(void) fd = &swapped_msg.ern.fd;if (unlikely (verb &0x20 )) { -printf ("HW ERN notification, Nothing to do\n" ); +pr_warn ("HW ERN notification, Nothing to do\n" ); }else {if ((fd->bpid &0xff ) !=0xff )qman_free_mbuf_cb (fd);
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -395,7 +395,7 @@ rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size) ret =ioctl (group->container->fd,VFIO_IOMMU_MAP_DMA , &dma_map);if (ret) { -printf ("Unable to map DMA address (errno = %d)\n" , +DPAA2_BUS_ERR ("Unable to map DMA address (errno = %d)\n" , errno);return ret; }
drivers/bus/fslmc/qbman/qbman_portal.c +1 -1
@@ -1879,7 +1879,7 @@ void qbman_pull_desc_set_rad(struct qbman_pull_desc *d, int rad)else d->pull.verb &= ~(1 <<QB_VDQCR_VERB_RAD_SHIFT ); }else { -printf ("The RAD feature is not valid when RLS = 0\n" ); +pr_warn ("The RAD feature is not valid when RLS = 0\n" ); } }
drivers/crypto/caam_jr/caam_jr.c +1 -1
@@ -587,7 +587,7 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring,/* todo check if it is false alarm no desc present */ if (!current_desc_addr) { false_alarm++; -printf ("false alarm %" PRIu64"real %" PRIu64 +CAAM_JR_ERR ("false alarm %" PRIu64"real %" PRIu64" sec_err =0x%x cidx Index =0%d\n" , false_alarm, real_poll, sec_error_code, job_ring->cidx);
drivers/crypto/caam_jr/caam_jr_uio.c +1 -1
@@ -418,7 +418,7 @@ sec_configure(void) d =opendir (SEC_UIO_DEVICE_SYS_ATTR_PATH );if (d ==NULL ) { -printf ("\nError opening directory '%s': %s\n" , +CAAM_JR_ERR ("Error opening directory '%s': %s\n" ,SEC_UIO_DEVICE_SYS_ATTR_PATH ,strerror (errno));return -1 ; }
drivers/net/dpaa/dpaa_ethdev.c +3 -3
@@ -282,9 +282,9 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_interrupt_handler, (void *)dev);if (ret ==EINVAL ) -printf ("Failed to enable interrupt: Not Supported\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt: Not Supported\n" );else -printf ("Failed to enable interrupt\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt\n" ); } dev->data->dev_conf.intr_conf.lsc =0 ; dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC ;
@@ -340,7 +340,7 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)dpaa_update_link_speed (__fif->node_name, speed, duplex); }else {/* Manual autoneg - custom advertisement speed. */ -printf ("Custom Advertisement speeds not supported\n" ); +DPAA_PMD_ERR ("Custom Advertisement speeds not supported\n" ); } }
drivers/net/dpaa/dpaa_flow.c +4 -4
@@ -68,7 +68,7 @@ static void fm_prev_cleanup(void) fm_info.fman_handle =fm_open (fman_id);if (!fm_info.fman_handle) { -printf ("\n%s- unable to open FMAN" , __func__); +DPAA_PMD_ERR ("unable to open FMAN" );return ; }
@@ -78,7 +78,7 @@ static void fm_prev_cleanup(void)/* FM PCD Open */ fm_info.pcd_handle =fm_pcd_open (&fm_pcd_params);if (!fm_info.pcd_handle) { -printf ("\n%s- unable to open PCD" , __func__); +DPAA_PMD_ERR ("unable to open PCD" );return ; }
@@ -108,11 +108,11 @@ static void fm_prev_cleanup(void)continue ;if (dpaa_fm_deconfig (&dpaa_intf,NULL )) -printf ("\nDPAA FM deconfig failed\n" ); +DPAA_PMD_ERR ("DPAA FM deconfig failed\n" ); }if (dpaa_fm_term ()) -printf ("\nDPAA FM term failed\n" ); +DPAA_PMD_ERR ("DPAA FM term failed\n" );memset (&fm_model,0 ,sizeof (struct dpaa_fm_model )); }
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -103,7 +103,7 @@ static void dpaa_display_frame_info(const struct qm_fd *fd,for (ii =0 ; ii < fd->length20; ii++) {DISPLAY_PRINT ("%02x " , ptr[ii]);if (((ii +1 ) %16 ) ==0 ) -printf ("\n" ); +DISPLAY_PRINT ("\n" ); }DISPLAY_PRINT ("\n" ); }
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2694,7 +2694,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->max_vlan_filters = attr.vlan_filter_entries; priv->flags =0 ;#if defined(RTE_LIBRTE_IEEE1588 ) -printf ("DPDK IEEE1588 is enabled\n" ); +DPAA2_PMD_INFO ("DPDK IEEE1588 is enabled\n" ); priv->flags |=DPAA2_TX_CONF_ENABLE ;#endif /* Used with ``fslmc:dpni.1,drv_tx_conf=1`` */
drivers/net/dpaa2/dpaa2_tm.c +5 -5
@@ -499,7 +499,7 @@ dpaa2_node_add(struct rte_eth_dev *dev, uint32_t node_id, node->channel_id = priv->channel_inuse; priv->channel_inuse++; }else { -printf ("error no channel id available\n" ); +DPAA2_PMD_ERR ("error no channel id available\n" ); } }
@@ -580,7 +580,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) flow_id =0 ;if (dpaa2_q ==NULL ) { -printf ("Queue is not configured for node = %d\n" , node->id); +DPAA2_PMD_ERR ("Queue is not configured for node = %d\n" , node->id);return -1 ; }
@@ -590,7 +590,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), flow_id, options, &tx_flow_cfg);if (ret) { - printf("Error in setting the tx flow: " + DPAA2_PMD_ERR("Error in setting the tx flow: " "channel id = %d tc_id= %d, param = 0x%x " "flow=%d err=%d\n", node->parent->channel_id, tc_id, ((node->parent->channel_id << 8) | tc_id), flow_id,
@@ -605,7 +605,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node)DPNI_QUEUE_TX , ((node->parent->channel_id <<8 ) | dpaa2_q->tc_index), dpaa2_q->flow_id, &tx_flow_cfg, &qid);if (ret) { -printf ("Error in getting LFQID err=%d" , ret); +DPAA2_PMD_ERR ("Error in getting LFQID err=%d" , ret);return -1 ; } dpaa2_q->fqid = qid.fqid;
@@ -636,7 +636,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), &cong_notif_cfg);if (ret) { -printf ("Error in setting tx congestion notification: " +DPAA2_PMD_ERR ("Error in setting tx congestion notification: " "err=%d" , ret);return -ret; }
Signature · 1 line
2.25.1
PATCH v2 2/2 drivers: replace printf with fprintf for debug functions
This patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
--- drivers/bus/dpaa/base/fman/netcfg_layer.c | 22 +++---- drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/dpaa/include/netcfg.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 6 +- drivers/crypto/caam_jr/caam_jr_desc.h | 4 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 32 +++++----- drivers/crypto/dpaa_sec/dpaa_sec.c | 62 +++++++++---------- drivers/net/dpaa2/dpaa2_flow.c | 66 +++++++++++---------- 8 files changed, 99 insertions(+), 97 deletions(-)
drivers/bus/dpaa/base/fman/netcfg_layer.c +11 -11
@@ -29,37 +29,37 @@ static int skfd = -1;#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER void -dump_netcfg (struct netcfg_info *cfg_ptr) +dump_netcfg (struct netcfg_info *cfg_ptr,FILE *f) {int i; -printf (".......... DPAA Configuration ..........\n\n" ); +fprintf (f,".......... DPAA Configuration ..........\n\n" );/* Network interfaces */ -printf ("Network interfaces: %d\n" , cfg_ptr->num_ethports); +fprintf (f,"Network interfaces: %d\n" , cfg_ptr->num_ethports);for (i =0 ; i < cfg_ptr->num_ethports; i++) {struct fman_if_bpool *bpool;struct fm_eth_port_cfg *p_cfg = &cfg_ptr->port_cfg[i];struct fman_if *__if = p_cfg->fman_if; -printf ("\n+ Fman %d, MAC %d (%s);\n" , +fprintf (f,"\n+ Fman %d, MAC %d (%s);\n" , __if->fman_idx, __if->mac_idx, (__if->mac_type == fman_mac_1g) ?"1G" : (__if->mac_type == fman_mac_2_5g) ?"2.5G" :"10G" ); -printf ("\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" , +fprintf (f,"\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" ,RTE_ETHER_ADDR_BYTES (&__if->mac_addr)); -printf ("\ttx_channel_id: 0x%02x\n" , +fprintf (f,"\ttx_channel_id: 0x%02x\n" , __if->tx_channel_id); -printf ("\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); -printf ("\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); +fprintf (f,"\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); +fprintf (f,"\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); -printf ("\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); -printf ("\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm); +fprintf (f,"\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); +fprintf (f,"\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm);fman_if_for_each_bpool (bpool, __if) -printf ("\tbuffer pool: (bpid=%d, count=%" PRId64 +fprintf (f,"\tbuffer pool: (bpid=%d, count=%" PRId64" size=%" PRId64", addr=0x%" PRIx64")\n" , bpool->bpid, bpool->count, bpool->size, bpool->addr);
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -586,7 +586,7 @@ rte_dpaa_bus_dev_build(void) }#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER -dump_netcfg (dpaa_netcfg); +dump_netcfg (dpaa_netcfg, stdout);#endif DPAA_BUS_LOG(DEBUG, "Number of ethernet devices = %d",
drivers/bus/dpaa/include/netcfg.h +1 -1
@@ -60,7 +60,7 @@ void netcfg_release(struct netcfg_info *cfg_ptr);/* cfg_ptr: configuration information pointer. * This function dumps configuration data to stdout. */ -void dump_netcfg (struct netcfg_info *cfg_ptr); +void dump_netcfg (struct netcfg_info *cfg_ptr,FILE *f);#endif #endif /* __NETCFG_H */
drivers/crypto/caam_jr/caam_jr.c +3 -3
@@ -461,7 +461,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) }#if CAAM_JR_DBG -SEC_DUMP_DESC (cdb->sh_desc); +SEC_DUMP_DESC (cdb->sh_desc, stdout);#endif cdb->sh_hdr.hi.field.idlen = shared_desc_len;
@@ -1410,9 +1410,9 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) rte_pktmbuf_mtod(op->sym->m_src, void *),rte_pktmbuf_data_len (op->sym->m_src)); -printf ("\n JD before conversion\n" ); +fprintf (stdout,"\n JD before conversion\n" );for (i =0 ; i <12 ; i++) -printf ("\n 0x%08x" , ctx->jobdes.desc[i]); +fprintf (stdout,"\n 0x%08x" , ctx->jobdes.desc[i]);#endif CAAM_JR_DP_DEBUG("Jr[%p] pi[%d] ci[%d].Before sending desc",
drivers/crypto/caam_jr/caam_jr_desc.h +2 -2
@@ -110,13 +110,13 @@ ((struct descriptor_header_s *)(descriptor))->command.jd.desclen)/* Helper macro for dumping the hex representation of a descriptor */ -#define SEC_DUMP_DESC (descriptor) { \ +#define SEC_DUMP_DESC (descriptor, f) { \ int __i; \ CAAM_JR_INFO("Des@ 0x%08x\n", (uint32_t)((uint32_t *)(descriptor)));\ for (__i = 0; \ __i < SEC_GET_DESC_LEN(descriptor); \ __i++) { \ - printf("0x%08x: 0x%08x\n", \ + fprintf(f, "0x%08x: 0x%08x\n", \ (uint32_t)(((uint32_t *)(descriptor)) + __i), \ *(((uint32_t *)(descriptor)) + __i)); \ } \
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +16 -16
@@ -1621,7 +1621,7 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct dpaa2_sec_qp *qp) }static void -dpaa2_sec_dump (struct rte_crypto_op *op) +dpaa2_sec_dump (struct rte_crypto_op *op,FILE *f) {int i;dpaa2_sec_session *sess =NULL ;
@@ -1640,18 +1640,18 @@ dpaa2_sec_dump(struct rte_crypto_op *op) goto mbuf_dump; priv = (struct ctxt_priv *)sess->ctxt; -printf ("\n****************************************\n" +fprintf (f,"\n****************************************\n" "session params:\n\tContext type:\t%d\n\tDirection:\t%s\n" "\tCipher alg:\t%d\n\tAuth alg:\t%d\n\tAead alg:\t%d\n" "\tCipher key len:\t%zd\n" , sess->ctxt_type, (sess->dir ==DIR_ENC ) ?"DIR_ENC" :"DIR_DEC" , sess->cipher_alg, sess->auth_alg, sess->aead_alg, sess->cipher_key.length); -rte_hexdump (stdout,"cipher key" , sess->cipher_key.data, +rte_hexdump (f,"cipher key" , sess->cipher_key.data, sess->cipher_key.length); -rte_hexdump (stdout,"auth key" , sess->auth_key.data, +rte_hexdump (f,"auth key" , sess->auth_key.data, sess->auth_key.length); - printf("\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" + fprintf(f, "\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" "\tdigest length:\t%d\n\tstatus:\t\t%d\n\taead auth only" " len:\t%d\n\taead cipher text:\t%d\n", sess->auth_key.length, sess->iv.length, sess->iv.offset,
@@ -1659,7 +1659,7 @@ dpaa2_sec_dump(struct rte_crypto_op *op) sess->ext_params.aead_ctxt.auth_only_len, sess->ext_params.aead_ctxt.auth_cipher_text);#ifdef RTE_LIB_SECURITY - printf("PDCP session params:\n" + fprintf(f, "PDCP session params:\n" "\tDomain:\t\t%d\n\tBearer:\t\t%d\n\tpkt_dir:\t%d\n\thfn_ovd:" "\t%d\n\tsn_size:\t%d\n\thfn_ovd_offset:\t%d\n\thfn:\t\t%d\n" "\thfn_threshold:\t0x%x\n", sess->pdcp.domain,
@@ -1669,29 +1669,29 @@ dpaa2_sec_dump(struct rte_crypto_op *op)#endif bufsize = (uint8_t )priv->flc_desc[0 ].flc.word1_sdl; -printf ("Descriptor Dump:\n" ); +fprintf (f,"Descriptor Dump:\n" );for (i =0 ; i < bufsize; i++) -printf ("\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); +fprintf (f,"\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); -printf ("\n" ); +fprintf (f,"\n" ); mbuf_dump: sym_op = op->sym;if (sym_op->m_src) { -printf ("Source mbuf:\n" ); -rte_pktmbuf_dump (stdout, sym_op->m_src, sym_op->m_src->data_len); +fprintf (f,"Source mbuf:\n" ); +rte_pktmbuf_dump (f, sym_op->m_src, sym_op->m_src->data_len); }if (sym_op->m_dst) { -printf ("Destination mbuf:\n" ); -rte_pktmbuf_dump (stdout, sym_op->m_dst, sym_op->m_dst->data_len); +fprintf (f,"Destination mbuf:\n" ); +rte_pktmbuf_dump (f, sym_op->m_dst, sym_op->m_dst->data_len); } -printf ("Session address = %p\ncipher offset: %d, length: %d\n" +fprintf (f,"Session address = %p\ncipher offset: %d, length: %d\n" "auth offset: %d, length: %d\n aead offset: %d, length: %d\n" , sym_op->session, sym_op->cipher.data.offset, sym_op->cipher.data.length, sym_op->auth.data.offset, sym_op->auth.data.length, sym_op->aead.data.offset, sym_op->aead.data.length); -printf ("\n" ); +fprintf (f,"\n" ); }
@@ -1951,7 +1951,7 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,DPAA2_SEC_DP_ERR ("SEC returned Error - %x\n" , fd->simple.frc);if (dpaa2_sec_dp_dump >DPAA2_SEC_DP_ERR_DUMP ) -dpaa2_sec_dump (ops[num_rx]); +dpaa2_sec_dump (ops[num_rx], stdout); } dpaa2_qp->rx_vq.err_pkts +=1 ;
drivers/crypto/dpaa_sec/dpaa_sec.c +31 -31
135 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_flow.c +34 -32
190 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v2 2/2] drivers: replace printf with fprintf for debug functions
drivers/crypto/caam_jr/caam_jr.c caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) · line 1415
Quoted 6 lines · On Tue, 2 Jul 2024 16:10:13 +0530 Hemant Agrawal <[email protected]>…
drivers/crypto/caam_jr/caam_jr.c +2
-2-printf ("\n JD before conversion\n" ); +fprintf (stdout,"\n JD before conversion\n" );for (i =0 ; i <12 ; i++) -printf ("\n 0x%08x" , ctx->jobdes.desc[i]); +fprintf (stdout,"\n 0x%08x" , ctx->jobdes.desc[i]);
Don't see the point of this change, printf() and fprintf(stdout) are same thing.
Re: [PATCH v2 2/2] drivers: replace printf with fprintf for debug functions
Quoted 10 lines · Stephen Hemminger
drivers/crypto/caam_jr/caam_jr.c caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) · line 1415
Quoted 6 lines · On Tue, 2 Jul 2024 16:10:13 +0530 Hemant Agrawal <[email protected]>…
drivers/crypto/caam_jr/caam_jr.c +2
-2-printf ("\n JD before conversion\n" ); +fprintf (stdout,"\n JD before conversion\n" );for (i =0 ; i <12 ; i++) -printf ("\n 0x%08x" , ctx->jobdes.desc[i]); +fprintf (stdout,"\n 0x%08x" , ctx->jobdes.desc[i]);Don't see the point of this change,
printf()and fprintf(stdout) are same thing.
Yes, but no harm in this change. It was originally a script based change in the files. Now the code is consistent - only using fprintf. Either with f or with stdout.
Quoted 5 lines · Hemant Agrawal
This patch replaces the printf with related log macros and functions at various places in NXP dpaaX drivers.
Signed-off-by Hemant Agrawal <[email protected]>
Please double check callers of DPAA_BUS_LOG to avoid log messages ending with \n\n.
I see that DPAA_BUS_LOG is called from DPAA_BUS_(ERR|INFO|WARN) and FMAN_ERR.
Signature · 1 line
David Marchand
PATCH v3 1/3 drivers: replace printf with log macros
In reply to Hemant AgrawalThis patch replaces the printf with related log macros and functions at various places in NXP dpaaX drivers.
--- drivers/bus/dpaa/base/fman/fman.c | 6 ++---- drivers/bus/dpaa/base/qbman/process.c | 29 +++++++++++++------------- drivers/bus/dpaa/base/qbman/qman.c | 2 +- drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/qbman/qbman_portal.c | 2 +- drivers/crypto/caam_jr/caam_jr.c | 6 +++--- drivers/crypto/caam_jr/caam_jr_uio.c | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_flow.c | 8 +++---- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_tm.c | 12 +++++------ 12 files changed, 39 insertions(+), 40 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +2 -4
@@ -723,10 +723,8 @@ fman_finish(void)/* release the mapping */ _errno =munmap (__if->ccsr_map, __if->regs_size);if (unlikely (_errno <0 )) -fprintf (stderr,"%s:%d:%s(): munmap() = %d (%s)\n" , - __FILE__, __LINE__, __func__, - -errno,strerror (errno)); -printf ("Tearing down %s\n" , __if->node_path); +FMAN_ERR (_errno,"munmap() = (%s)" ,strerror (errno)); +DPAA_BUS_INFO ("Tearing down %s" , __if->node_path);list_del (&__if->__if.node);rte_free (__if); }
drivers/bus/dpaa/base/qbman/process.c +15 -14
@@ -13,6 +13,7 @@#include "process.h" #include <fsl_usd.h> +#include "rte_dpaa_logs.h" /* As higher-level drivers will be built on top of this (dma_mem, qbman, ...), * it's preferable that the process driver itself not provide any exported API.
@@ -99,12 +100,12 @@ void process_release(enum dpaa_id_type id_type, uint32_t base, uint32_t num)int ret =check_fd ();if (ret) { -fprintf (stderr,"Process FD failure\n" ); +DPAA_BUS_ERR ("Process FD failure" );return ; } ret =ioctl (fd,DPAA_IOCTL_ID_RELEASE , &id);if (ret) -fprintf (stderr,"Process FD ioctl failure type %d base 0x%x num %d\n" , +DPAA_BUS_ERR ("Process FD ioctl failure type %d base 0x%x num %d" , id_type, base, num); }
@@ -333,9 +334,9 @@ int dpaa_intr_disable(char *if_name) ret =ioctl (fd,DPAA_IOCTL_DISABLE_LINK_STATUS_INTERRUPT , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to disable interrupt: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt: Not Supported" );else -printf ("Failed to disable interrupt\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt" );return ret; }
@@ -357,7 +358,7 @@ int dpaa_get_ioctl_version_number(void)if (errno ==EINVAL ) { version_num =1 ; }else { -printf ("Failed to get ioctl version number\n" ); +DPAA_BUS_ERR ("Failed to get ioctl version number" ); version_num =-1 ; } }
@@ -388,7 +389,7 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS , &args);if (ret) { -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status" );return ret; }
@@ -404,9 +405,9 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS_OLD , &args);if (ret) {if (errno ==EINVAL ) -printf ("Get link status: Not Supported\n" ); +DPAA_BUS_ERR ("Get link status: Not Supported" );else -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status" );return ret; }
@@ -434,9 +435,9 @@ int dpaa_update_link_status(char *if_name, int link_status) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_STATUS , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link status: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link status: Not Supported" );else -printf ("Failed to set link status" ); +DPAA_BUS_ERR ("Failed to set link status" );return ret; }
@@ -462,9 +463,9 @@ int dpaa_update_link_speed(char *if_name, int link_speed, int link_duplex) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_SPEED , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link speed: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link speed: Not Supported" );else -printf ("Failed to set link speed\n" ); +DPAA_BUS_ERR ("Failed to set link speed" );return ret; }
@@ -484,9 +485,9 @@ int dpaa_restart_link_autoneg(char *if_name) ret =ioctl (fd,DPAA_IOCTL_RESTART_LINK_AUTONEG , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to restart autoneg: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg: Not Supported" );else -printf ("Failed to restart autoneg\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg" );return ret; }
drivers/bus/dpaa/base/qbman/qman.c +1 -1
@@ -817,7 +817,7 @@ qman_ern_poll_free(void) fd = &swapped_msg.ern.fd;if (unlikely (verb &0x20 )) { -printf ("HW ERN notification, Nothing to do\n" ); +pr_warn ("HW ERN notification, Nothing to do\n" ); }else {if ((fd->bpid &0xff ) !=0xff )qman_free_mbuf_cb (fd);
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -395,7 +395,7 @@ rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size) ret =ioctl (group->container->fd,VFIO_IOMMU_MAP_DMA , &dma_map);if (ret) { -printf ("Unable to map DMA address (errno = %d)\n" , +DPAA2_BUS_ERR ("Unable to map DMA address (errno = %d)" , errno);return ret; }
drivers/bus/fslmc/qbman/qbman_portal.c +1 -1
@@ -1879,7 +1879,7 @@ void qbman_pull_desc_set_rad(struct qbman_pull_desc *d, int rad)else d->pull.verb &= ~(1 <<QB_VDQCR_VERB_RAD_SHIFT ); }else { -printf ("The RAD feature is not valid when RLS = 0\n" ); +pr_warn ("The RAD feature is not valid when RLS = 0\n" ); } }
drivers/crypto/caam_jr/caam_jr.c +3 -3
@@ -461,7 +461,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) }#if CAAM_JR_DBG -SEC_DUMP_DESC (cdb->sh_desc); +SEC_DUMP_DESC (cdb->sh_desc, stdout);#endif cdb->sh_hdr.hi.field.idlen = shared_desc_len;
@@ -587,8 +587,8 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring,/* todo check if it is false alarm no desc present */ if (!current_desc_addr) { false_alarm++; -printf ("false alarm %" PRIu64"real %" PRIu64 -" sec_err =0x%x cidx Index =0%d\n" , +CAAM_JR_ERR ("false alarm %" PRIu64"real %" PRIu64 +" sec_err =0x%x cidx Index =0%d" , false_alarm, real_poll, sec_error_code, job_ring->cidx);rte_panic ("CAAM JR descriptor NULL" );
drivers/crypto/caam_jr/caam_jr_uio.c +1 -1
@@ -418,7 +418,7 @@ sec_configure(void) d =opendir (SEC_UIO_DEVICE_SYS_ATTR_PATH );if (d ==NULL ) { -printf ("\nError opening directory '%s': %s\n" , +CAAM_JR_ERR ("Error opening directory '%s': %s" ,SEC_UIO_DEVICE_SYS_ATTR_PATH ,strerror (errno));return -1 ; }
drivers/net/dpaa/dpaa_ethdev.c +3 -3
@@ -282,9 +282,9 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_interrupt_handler, (void *)dev);if (ret ==EINVAL ) -printf ("Failed to enable interrupt: Not Supported\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt: Not Supported\n" );else -printf ("Failed to enable interrupt\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt\n" ); } dev->data->dev_conf.intr_conf.lsc =0 ; dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC ;
@@ -340,7 +340,7 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)dpaa_update_link_speed (__fif->node_name, speed, duplex); }else {/* Manual autoneg - custom advertisement speed. */ -printf ("Custom Advertisement speeds not supported\n" ); +DPAA_PMD_ERR ("Custom Advertisement speeds not supported\n" ); } }
drivers/net/dpaa/dpaa_flow.c +4 -4
@@ -68,7 +68,7 @@ static void fm_prev_cleanup(void) fm_info.fman_handle =fm_open (fman_id);if (!fm_info.fman_handle) { -printf ("\n%s- unable to open FMAN" , __func__); +DPAA_PMD_ERR ("unable to open FMAN" );return ; }
@@ -78,7 +78,7 @@ static void fm_prev_cleanup(void)/* FM PCD Open */ fm_info.pcd_handle =fm_pcd_open (&fm_pcd_params);if (!fm_info.pcd_handle) { -printf ("\n%s- unable to open PCD" , __func__); +DPAA_PMD_ERR ("unable to open PCD" );return ; }
@@ -108,11 +108,11 @@ static void fm_prev_cleanup(void)continue ;if (dpaa_fm_deconfig (&dpaa_intf,NULL )) -printf ("\nDPAA FM deconfig failed\n" ); +DPAA_PMD_ERR ("DPAA FM deconfig failed" ); }if (dpaa_fm_term ()) -printf ("\nDPAA FM term failed\n" ); +DPAA_PMD_ERR ("DPAA FM term failed" );memset (&fm_model,0 ,sizeof (struct dpaa_fm_model )); }
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -103,7 +103,7 @@ static void dpaa_display_frame_info(const struct qm_fd *fd,for (ii =0 ; ii < fd->length20; ii++) {DISPLAY_PRINT ("%02x " , ptr[ii]);if (((ii +1 ) %16 ) ==0 ) -printf ("\n" ); +DISPLAY_PRINT ("\n" ); }DISPLAY_PRINT ("\n" ); }
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2694,7 +2694,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->max_vlan_filters = attr.vlan_filter_entries; priv->flags =0 ;#if defined(RTE_LIBRTE_IEEE1588 ) -printf ("DPDK IEEE1588 is enabled\n" ); +DPAA2_PMD_INFO ("DPDK IEEE1588 is enabled" ); priv->flags |=DPAA2_TX_CONF_ENABLE ;#endif /* Used with ``fslmc:dpni.1,drv_tx_conf=1`` */
drivers/net/dpaa2/dpaa2_tm.c +6 -6
@@ -499,7 +499,7 @@ dpaa2_node_add(struct rte_eth_dev *dev, uint32_t node_id, node->channel_id = priv->channel_inuse; priv->channel_inuse++; }else { -printf ("error no channel id available\n" ); +DPAA2_PMD_ERR ("error no channel id available" ); } }
@@ -580,7 +580,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) flow_id =0 ;if (dpaa2_q ==NULL ) { -printf ("Queue is not configured for node = %d\n" , node->id); +DPAA2_PMD_ERR ("Queue is not configured for node = %d" , node->id);return -1 ; }
@@ -590,9 +590,9 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), flow_id, options, &tx_flow_cfg);if (ret) { -printf ("Error in setting the tx flow: " +DPAA2_PMD_ERR ("Error in setting the tx flow: " "channel id = %d tc_id= %d, param = 0x%x " -"flow=%d err=%d\n" , node->parent->channel_id, tc_id, +"flow=%d err=%d" , node->parent->channel_id, tc_id, ((node->parent->channel_id <<8 ) | tc_id), flow_id, ret);return -1 ;
@@ -605,7 +605,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node)DPNI_QUEUE_TX , ((node->parent->channel_id <<8 ) | dpaa2_q->tc_index), dpaa2_q->flow_id, &tx_flow_cfg, &qid);if (ret) { -printf ("Error in getting LFQID err=%d" , ret); +DPAA2_PMD_ERR ("Error in getting LFQID err=%d" , ret);return -1 ; } dpaa2_q->fqid = qid.fqid;
@@ -636,7 +636,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), &cong_notif_cfg);if (ret) { -printf ("Error in setting tx congestion notification: " +DPAA2_PMD_ERR ("Error in setting tx congestion notification: " "err=%d" , ret);return -ret; }
Signature · 1 line
2.25.1
PATCH v3 2/3 bus/dpaa: remove double newline
Remove duplicate newline \n from the debugging macros to avoid double \n\n.
--- drivers/bus/dpaa/base/fman/fman.c | 58 +++++++++++++++---------------- drivers/bus/dpaa/dpaa_bus.c | 12 +++---- 2 files changed, 34 insertions(+), 36 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +28 -30
@@ -244,13 +244,13 @@ fman_if_init(const struct device_node *dpa_node)/* Obtain the MAC node used by this interface except macless */ mac_phandle =of_get_property (dpa_node, mprop, &lenp);if (!mac_phandle) { -FMAN_ERR (-EINVAL ,"%s: no %s\n" , dname, mprop); +FMAN_ERR (-EINVAL ,"%s: no %s" , dname, mprop);return -EINVAL ; }assert (lenp ==sizeof (phandle)); mac_node =of_find_node_by_phandle (*mac_phandle);if (!mac_node) { -FMAN_ERR (-ENXIO ,"%s: bad 'fsl,fman-mac\n" , dname); +FMAN_ERR (-ENXIO ,"%s: bad 'fsl,fman-mac" , dname);return -ENXIO ; } mname = mac_node->full_name;
@@ -262,19 +262,19 @@ fman_if_init(const struct device_node *dpa_node) ports_phandle =of_get_property (mac_node,"fsl,fman-ports" , &lenp);if (!ports_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,port-handles\n" , +FMAN_ERR (-EINVAL ,"%s: no fsl,port-handles" , mname);return -EINVAL ; }assert (lenp == (2 *sizeof (phandle))); rx_node =of_find_node_by_phandle (ports_phandle[0 ]);if (!rx_node) { -FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[0]\n" , mname); +FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[0]" , mname);return -ENXIO ; } tx_node =of_find_node_by_phandle (ports_phandle[1 ]);if (!tx_node) { -FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[1]\n" , mname); +FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[1]" , mname);return -ENXIO ; }
@@ -282,8 +282,7 @@ fman_if_init(const struct device_node *dpa_node)if (of_device_is_compatible (dpa_node,"fsl,dpa-ethernet" )) { port_cell_idx =of_get_property (rx_node,"cell-index" , &lenp);if (!port_cell_idx) { -FMAN_ERR (-ENXIO , -"%s: no cell-index for port\n" , mname); +FMAN_ERR (-ENXIO ,"%s: no cell-index for port" , mname);return -ENXIO ; }assert (lenp ==sizeof (*port_cell_idx));
@@ -305,8 +304,7 @@ fman_if_init(const struct device_node *dpa_node) ext_args_cell_idx =of_get_property (ext_args_node,"cell-index" , &lenp);if (!ext_args_cell_idx) { -FMAN_ERR (-ENXIO , -"%s: no cell-index for ext args\n" , +FMAN_ERR (-ENXIO ,"%s: no cell-index for ext args" , mname);return -ENXIO ; }
@@ -343,7 +341,7 @@ fman_if_init(const struct device_node *dpa_node)/* Allocate an object for this network interface */ __if =rte_malloc (NULL ,sizeof (*__if),RTE_CACHE_LINE_SIZE );if (!__if) { -FMAN_ERR (-ENOMEM ,"malloc(%zu)\n" ,sizeof (*__if)); +FMAN_ERR (-ENOMEM ,"malloc(%zu)" ,sizeof (*__if)); goto err; }memset (__if,0 ,sizeof (*__if));
@@ -356,12 +354,12 @@ fman_if_init(const struct device_node *dpa_node)/* Map the CCSR regs for the MAC node */ regs_addr =of_get_address (mac_node,0 , &__if->regs_size,NULL );if (!regs_addr) { -FMAN_ERR (-EINVAL ,"of_get_address(%s)\n" , mname); +FMAN_ERR (-EINVAL ,"of_get_address(%s)" , mname); goto err; } phys_addr =of_translate_address (mac_node, regs_addr);if (!phys_addr) { -FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)\n" , +FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)" , mname, regs_addr); goto err; }
@@ -369,7 +367,7 @@ fman_if_init(const struct device_node *dpa_node)PROT_READ |PROT_WRITE ,MAP_SHARED , fman_ccsr_map_fd, phys_addr);if (__if->ccsr_map ==MAP_FAILED ) { -FMAN_ERR (-errno,"mmap(0x%" PRIx64")\n" , phys_addr); +FMAN_ERR (-errno,"mmap(0x%" PRIx64")" , phys_addr); goto err; } na =of_n_addr_cells (mac_node);
@@ -380,13 +378,13 @@ fman_if_init(const struct device_node *dpa_node) fman_node =of_get_parent (mac_node); na =of_n_addr_cells (mac_node);if (!fman_node) { -FMAN_ERR (-ENXIO ,"of_get_parent(%s)\n" , mname); +FMAN_ERR (-ENXIO ,"of_get_parent(%s)" , mname); goto err; } fname = fman_node->full_name; cell_idx =of_get_property (fman_node,"cell-index" , &lenp);if (!cell_idx) { -FMAN_ERR (-ENXIO ,"%s: no cell-index)\n" , fname); +FMAN_ERR (-ENXIO ,"%s: no cell-index)" , fname); goto err; }assert (lenp ==sizeof (*cell_idx));
@@ -395,7 +393,7 @@ fman_if_init(const struct device_node *dpa_node)if (!get_once) { _errno =fman_get_ip_rev (fman_node);if (_errno) { -FMAN_ERR (-ENXIO ,"%s: ip_rev is not available\n" , +FMAN_ERR (-ENXIO ,"%s: ip_rev is not available" , fname); goto err; }
@@ -425,7 +423,7 @@ fman_if_init(const struct device_node *dpa_node) char_prop =of_get_property (mac_node,"phy-connection-type" ,NULL );if (!char_prop) { -printf ("memac: unknown MII type assuming 1G\n" ); +FMAN_ERR (-EINVAL ,"memac: unknown MII type assuming 1G" );/* Right now forcing memac to 1g in case of error*/ __if->__if.mac_type = fman_mac_1g; }else {
@@ -440,7 +438,7 @@ fman_if_init(const struct device_node *dpa_node) __if->__if.mac_type = fman_mac_10g; } }else { -FMAN_ERR (-EINVAL ,"%s: unknown MAC type\n" , mname); +FMAN_ERR (-EINVAL ,"%s: unknown MAC type" , mname); goto err; }
@@ -463,7 +461,7 @@ fman_if_init(const struct device_node *dpa_node) mac_addr =of_get_property (mac_node,"local-mac-address" , &lenp);if (!mac_addr) { -FMAN_ERR (-EINVAL ,"%s: no local-mac-address\n" , +FMAN_ERR (-EINVAL ,"%s: no local-mac-address" , mname); goto err; }
@@ -473,19 +471,19 @@ fman_if_init(const struct device_node *dpa_node) tx_channel_id =of_get_property (tx_node,"fsl,qman-channel-id" , &lenp);if (!tx_channel_id) { -FMAN_ERR (-EINVAL ,"%s: no fsl-qman-channel-id\n" , +FMAN_ERR (-EINVAL ,"%s: no fsl-qman-channel-id" , tx_node->full_name); goto err; } regs_addr =of_get_address (rx_node,0 , &__if->regs_size,NULL );if (!regs_addr) { -FMAN_ERR (-EINVAL ,"of_get_address(%s)\n" , mname); +FMAN_ERR (-EINVAL ,"of_get_address(%s)" , mname); goto err; } phys_addr =of_translate_address (rx_node, regs_addr);if (!phys_addr) { -FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)\n" , +FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)" , mname, regs_addr); goto err; }
@@ -493,7 +491,7 @@ fman_if_init(const struct device_node *dpa_node)PROT_READ |PROT_WRITE ,MAP_SHARED , fman_ccsr_map_fd, phys_addr);if (__if->bmi_map ==MAP_FAILED ) { -FMAN_ERR (-errno,"mmap(0x%" PRIx64")\n" , phys_addr); +FMAN_ERR (-errno,"mmap(0x%" PRIx64")" , phys_addr); goto err; }
@@ -507,7 +505,7 @@ fman_if_init(const struct device_node *dpa_node)*/ rx_phandle =of_get_property (dpa_node, rprop, &lenp);if (!rx_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-rx\n" , dname); +FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-rx" , dname); goto err; }
@@ -542,7 +540,7 @@ fman_if_init(const struct device_node *dpa_node) tx_phandle =of_get_property (dpa_node,"fsl,qman-frame-queues-tx" , &lenp);if (!tx_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-tx\n" , dname); +FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-tx" , dname); goto err; }
@@ -562,7 +560,7 @@ fman_if_init(const struct device_node *dpa_node) pools_phandle =of_get_property (dpa_node,"fsl,bman-buffer-pools" , &lenp);if (!pools_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,bman-buffer-pools\n" , dname); +FMAN_ERR (-EINVAL ,"%s: no fsl,bman-buffer-pools" , dname); goto err; }/* For each pool, parse the corresponding node and add a pool object
@@ -578,13 +576,13 @@ fman_if_init(const struct device_node *dpa_node)/* Allocate an object for the pool */ bpool =rte_malloc (NULL ,sizeof (*bpool),RTE_CACHE_LINE_SIZE );if (!bpool) { -FMAN_ERR (-ENOMEM ,"malloc(%zu)\n" ,sizeof (*bpool)); +FMAN_ERR (-ENOMEM ,"malloc(%zu)" ,sizeof (*bpool)); goto err; }/* Find the pool node */ pool_node =of_find_node_by_phandle (*pools_phandle);if (!pool_node) { -FMAN_ERR (-ENXIO ,"%s: bad fsl,bman-buffer-pools\n" , +FMAN_ERR (-ENXIO ,"%s: bad fsl,bman-buffer-pools" , dname);rte_free (bpool); goto err;
@@ -593,7 +591,7 @@ fman_if_init(const struct device_node *dpa_node)/* Extract the BPID property */ prop =of_get_property (pool_node,"fsl,bpid" , &proplen);if (!prop) { -FMAN_ERR (-EINVAL ,"%s: no fsl,bpid\n" , pname); +FMAN_ERR (-EINVAL ,"%s: no fsl,bpid" , pname);rte_free (bpool); goto err; }
@@ -691,7 +689,7 @@ fman_init(void)for_each_child_node (parent_node, dpa_node) { _errno =fman_if_init (dpa_node);if (_errno) { -FMAN_ERR (_errno,"if_init(%s)\n" , dpa_node->full_name); +FMAN_ERR (_errno,"if_init(%s)" , dpa_node->full_name); goto err; } }
drivers/bus/dpaa/dpaa_bus.c +6 -6
@@ -326,7 +326,7 @@ int rte_dpaa_portal_init(void *arg) dpaa_seqn_dynfield_offset =rte_mbuf_dynfield_register (&dpaa_seqn_dynfield_desc);if (dpaa_seqn_dynfield_offset <0 ) { -DPAA_BUS_LOG (ERR ,"Failed to register mbuf field for dpaa sequence number\n" ); +DPAA_BUS_LOG (ERR ,"Failed to register mbuf field for dpaa sequence number" );return -rte_errno; }
@@ -673,7 +673,7 @@ rte_dpaa_bus_probe(void)if (dev->device_type ==FSL_DPAA_ETH ) { ret =rte_dpaa_setup_intr (dev->intr_handle);if (ret) -DPAA_BUS_ERR ("Error setting up interrupt.\n" ); +DPAA_BUS_ERR ("Error setting up interrupt." ); } }
@@ -734,13 +734,13 @@ rte_dpaa_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,while (dev !=NULL ) {if (cmp (&dev->device, data) ==0 ) { -DPAA_BUS_DEBUG ("Found dev=(%s)\n" , dev->device.name); +DPAA_BUS_DEBUG ("Found dev=(%s)" , dev->device.name);return &dev->device; } dev =TAILQ_NEXT (dev, next); } -DPAA_BUS_DEBUG ("Unable to find any device\n" ); +DPAA_BUS_DEBUG ("Unable to find any device" );return NULL ; }
@@ -786,14 +786,14 @@ dpaa_bus_dev_iterate(const void *start, const char *str,/* Expectation is that device would be name=device_name */ if (strncmp (str,"name=" ,5 ) !=0 ) { -DPAA_BUS_DEBUG ("Invalid device string (%s)\n" , str); +DPAA_BUS_DEBUG ("Invalid device string (%s)" , str);return NULL ; }/* Now that name=device_name format is available, split */ dup =strdup (str);if (dup ==NULL ) { -DPAA_BUS_DEBUG ("Dup string (%s) failed!\n" , str); +DPAA_BUS_DEBUG ("Dup string (%s) failed!" , str);return NULL ; } dev_name = dup +strlen ("name=" );
Signature · 1 line
2.25.1
PATCH v3 3/3 drivers: replace printf with fprintf for debug functions
In reply to Hemant AgrawalThis patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
--- drivers/bus/dpaa/base/fman/netcfg_layer.c | 22 +++---- drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/dpaa/include/netcfg.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 4 +- drivers/crypto/caam_jr/caam_jr_desc.h | 4 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 32 +++++----- drivers/crypto/dpaa_sec/dpaa_sec.c | 62 +++++++++---------- drivers/net/dpaa2/dpaa2_flow.c | 66 +++++++++++---------- 8 files changed, 98 insertions(+), 96 deletions(-)
drivers/bus/dpaa/base/fman/netcfg_layer.c +11 -11
@@ -29,37 +29,37 @@ static int skfd = -1;#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER void -dump_netcfg (struct netcfg_info *cfg_ptr) +dump_netcfg (struct netcfg_info *cfg_ptr,FILE *f) {int i; -printf (".......... DPAA Configuration ..........\n\n" ); +fprintf (f,".......... DPAA Configuration ..........\n\n" );/* Network interfaces */ -printf ("Network interfaces: %d\n" , cfg_ptr->num_ethports); +fprintf (f,"Network interfaces: %d\n" , cfg_ptr->num_ethports);for (i =0 ; i < cfg_ptr->num_ethports; i++) {struct fman_if_bpool *bpool;struct fm_eth_port_cfg *p_cfg = &cfg_ptr->port_cfg[i];struct fman_if *__if = p_cfg->fman_if; -printf ("\n+ Fman %d, MAC %d (%s);\n" , +fprintf (f,"\n+ Fman %d, MAC %d (%s);\n" , __if->fman_idx, __if->mac_idx, (__if->mac_type == fman_mac_1g) ?"1G" : (__if->mac_type == fman_mac_2_5g) ?"2.5G" :"10G" ); -printf ("\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" , +fprintf (f,"\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" ,RTE_ETHER_ADDR_BYTES (&__if->mac_addr)); -printf ("\ttx_channel_id: 0x%02x\n" , +fprintf (f,"\ttx_channel_id: 0x%02x\n" , __if->tx_channel_id); -printf ("\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); -printf ("\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); +fprintf (f,"\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); +fprintf (f,"\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); -printf ("\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); -printf ("\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm); +fprintf (f,"\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); +fprintf (f,"\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm);fman_if_for_each_bpool (bpool, __if) -printf ("\tbuffer pool: (bpid=%d, count=%" PRId64 +fprintf (f,"\tbuffer pool: (bpid=%d, count=%" PRId64" size=%" PRId64", addr=0x%" PRIx64")\n" , bpool->bpid, bpool->count, bpool->size, bpool->addr);
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -586,7 +586,7 @@ rte_dpaa_bus_dev_build(void) }#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER -dump_netcfg (dpaa_netcfg); +dump_netcfg (dpaa_netcfg, stdout);#endif DPAA_BUS_LOG(DEBUG, "Number of ethernet devices = %d",
drivers/bus/dpaa/include/netcfg.h +1 -1
@@ -60,7 +60,7 @@ void netcfg_release(struct netcfg_info *cfg_ptr);/* cfg_ptr: configuration information pointer. * This function dumps configuration data to stdout. */ -void dump_netcfg (struct netcfg_info *cfg_ptr); +void dump_netcfg (struct netcfg_info *cfg_ptr,FILE *f);#endif #endif /* __NETCFG_H */
drivers/crypto/caam_jr/caam_jr.c +2 -2
@@ -1410,9 +1410,9 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) rte_pktmbuf_mtod(op->sym->m_src, void *),rte_pktmbuf_data_len (op->sym->m_src)); -printf ("\n JD before conversion\n" ); +fprintf (stdout,"\n JD before conversion\n" );for (i =0 ; i <12 ; i++) -printf ("\n 0x%08x" , ctx->jobdes.desc[i]); +fprintf (stdout,"\n 0x%08x" , ctx->jobdes.desc[i]);#endif CAAM_JR_DP_DEBUG("Jr[%p] pi[%d] ci[%d].Before sending desc",
drivers/crypto/caam_jr/caam_jr_desc.h +2 -2
@@ -110,13 +110,13 @@ ((struct descriptor_header_s *)(descriptor))->command.jd.desclen)/* Helper macro for dumping the hex representation of a descriptor */ -#define SEC_DUMP_DESC (descriptor) { \ +#define SEC_DUMP_DESC (descriptor, f) { \ int __i; \ CAAM_JR_INFO("Des@ 0x%08x\n", (uint32_t)((uint32_t *)(descriptor)));\ for (__i = 0; \ __i < SEC_GET_DESC_LEN(descriptor); \ __i++) { \ - printf("0x%08x: 0x%08x\n", \ + fprintf(f, "0x%08x: 0x%08x\n", \ (uint32_t)(((uint32_t *)(descriptor)) + __i), \ *(((uint32_t *)(descriptor)) + __i)); \ } \
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +16 -16
@@ -1621,7 +1621,7 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct dpaa2_sec_qp *qp) }static void -dpaa2_sec_dump (struct rte_crypto_op *op) +dpaa2_sec_dump (struct rte_crypto_op *op,FILE *f) {int i;dpaa2_sec_session *sess =NULL ;
@@ -1640,18 +1640,18 @@ dpaa2_sec_dump(struct rte_crypto_op *op) goto mbuf_dump; priv = (struct ctxt_priv *)sess->ctxt; -printf ("\n****************************************\n" +fprintf (f,"\n****************************************\n" "session params:\n\tContext type:\t%d\n\tDirection:\t%s\n" "\tCipher alg:\t%d\n\tAuth alg:\t%d\n\tAead alg:\t%d\n" "\tCipher key len:\t%zd\n" , sess->ctxt_type, (sess->dir ==DIR_ENC ) ?"DIR_ENC" :"DIR_DEC" , sess->cipher_alg, sess->auth_alg, sess->aead_alg, sess->cipher_key.length); -rte_hexdump (stdout,"cipher key" , sess->cipher_key.data, +rte_hexdump (f,"cipher key" , sess->cipher_key.data, sess->cipher_key.length); -rte_hexdump (stdout,"auth key" , sess->auth_key.data, +rte_hexdump (f,"auth key" , sess->auth_key.data, sess->auth_key.length); - printf("\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" + fprintf(f, "\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" "\tdigest length:\t%d\n\tstatus:\t\t%d\n\taead auth only" " len:\t%d\n\taead cipher text:\t%d\n", sess->auth_key.length, sess->iv.length, sess->iv.offset,
@@ -1659,7 +1659,7 @@ dpaa2_sec_dump(struct rte_crypto_op *op) sess->ext_params.aead_ctxt.auth_only_len, sess->ext_params.aead_ctxt.auth_cipher_text);#ifdef RTE_LIB_SECURITY - printf("PDCP session params:\n" + fprintf(f, "PDCP session params:\n" "\tDomain:\t\t%d\n\tBearer:\t\t%d\n\tpkt_dir:\t%d\n\thfn_ovd:" "\t%d\n\tsn_size:\t%d\n\thfn_ovd_offset:\t%d\n\thfn:\t\t%d\n" "\thfn_threshold:\t0x%x\n", sess->pdcp.domain,
@@ -1669,29 +1669,29 @@ dpaa2_sec_dump(struct rte_crypto_op *op)#endif bufsize = (uint8_t )priv->flc_desc[0 ].flc.word1_sdl; -printf ("Descriptor Dump:\n" ); +fprintf (f,"Descriptor Dump:\n" );for (i =0 ; i < bufsize; i++) -printf ("\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); +fprintf (f,"\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); -printf ("\n" ); +fprintf (f,"\n" ); mbuf_dump: sym_op = op->sym;if (sym_op->m_src) { -printf ("Source mbuf:\n" ); -rte_pktmbuf_dump (stdout, sym_op->m_src, sym_op->m_src->data_len); +fprintf (f,"Source mbuf:\n" ); +rte_pktmbuf_dump (f, sym_op->m_src, sym_op->m_src->data_len); }if (sym_op->m_dst) { -printf ("Destination mbuf:\n" ); -rte_pktmbuf_dump (stdout, sym_op->m_dst, sym_op->m_dst->data_len); +fprintf (f,"Destination mbuf:\n" ); +rte_pktmbuf_dump (f, sym_op->m_dst, sym_op->m_dst->data_len); } -printf ("Session address = %p\ncipher offset: %d, length: %d\n" +fprintf (f,"Session address = %p\ncipher offset: %d, length: %d\n" "auth offset: %d, length: %d\n aead offset: %d, length: %d\n" , sym_op->session, sym_op->cipher.data.offset, sym_op->cipher.data.length, sym_op->auth.data.offset, sym_op->auth.data.length, sym_op->aead.data.offset, sym_op->aead.data.length); -printf ("\n" ); +fprintf (f,"\n" ); }
@@ -1951,7 +1951,7 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,DPAA2_SEC_DP_ERR ("SEC returned Error - %x\n" , fd->simple.frc);if (dpaa2_sec_dp_dump >DPAA2_SEC_DP_ERR_DUMP ) -dpaa2_sec_dump (ops[num_rx]); +dpaa2_sec_dump (ops[num_rx], stdout); } dpaa2_qp->rx_vq.err_pkts +=1 ;
drivers/crypto/dpaa_sec/dpaa_sec.c +31 -31
135 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_flow.c +34 -32
190 lines not on this page · raw message
Signature · 1 line
2.25.1
Hello Hemant,
On Tue, Jul 2, 2024 at 3:09 PM Hemant Agrawal <[email protected]> wrote:
[snip]
drivers/crypto/caam_jr/caam_jr.c caam_jr_prep_cdb(struct caam_jr_session *ses) · line 465
Quoted 11 lines
drivers/crypto/caam_jr/caam_jr.c +1
-1@@ -461,7 +461,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) }#if CAAM_JR_DBG -SEC_DUMP_DESC (cdb->sh_desc); +SEC_DUMP_DESC (cdb->sh_desc, stdout);#endif
This hunk should go to next patch.
Quoted 2 lines
drivers/crypto/caam_jr/caam_jr.c +0
-0cdb->sh_hdr.hi.field.idlen = shared_desc_len;
[snip]
drivers/net/dpaa/dpaa_ethdev.c dpaa_eth_dev_configure(struct rte_eth_dev *dev) · line 287
Quoted 13 lines
drivers/net/dpaa/dpaa_ethdev.c +2
-2@@ -282,9 +282,9 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_interrupt_handler, (void *)dev);if (ret ==EINVAL ) -printf ("Failed to enable interrupt: Not Supported\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt: Not Supported\n" );else -printf ("Failed to enable interrupt\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt\n" );
DPAA_PMD_ERR appends a \n, so \n should be removed here.
There are double \n in this driver prior to this patch, can you fix them too? It is probably worth checking other NXP drivers on this topic.
drivers/net/dpaa/dpaa_ethdev.c dpaa_eth_dev_configure(struct rte_eth_dev *dev) · line 343
Quoted 9 lines
drivers/net/dpaa/dpaa_ethdev.c +1
-1} dev->data->dev_conf.intr_conf.lsc =0 ; dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC ;@@ -340,7 +340,7 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)dpaa_update_link_speed (__fif->node_name, speed, duplex); }else {/* Manual autoneg - custom advertisement speed. */ -printf ("Custom Advertisement speeds not supported\n" ); +DPAA_PMD_ERR ("Custom Advertisement speeds not supported\n" );
Idem.
Quoted 3 lines
drivers/net/dpaa/dpaa_ethdev.c +0
-0} }
[snip]
drivers/net/dpaa/dpaa_rxtx.c static void dpaa_display_frame_info(const struct qm_fd *fd, · line 109
Quoted 13 lines
drivers/net/dpaa/dpaa_rxtx.c +1
-1@@ -103,7 +103,7 @@ static void dpaa_display_frame_info(const struct qm_fd *fd,for (ii =0 ; ii < fd->length20; ii++) {DISPLAY_PRINT ("%02x " , ptr[ii]);if (((ii +1 ) %16 ) ==0 ) -printf ("\n" ); +DISPLAY_PRINT ("\n" ); }DISPLAY_PRINT ("\n" ); }
Indeed it is better to call this macro, but this macro is calling printf. I am ok with the change as this is under a debug build cflag, but I would prefer this debug code goes through rte_log in the future.
Signature · 1 line
David Marchand
Hi David
Quoted 13 lines · David Marchand
Hello Hemant,
On Tue, Jul 2, 2024 at 3:09 PM Hemant Agrawal <[email protected]> wrote:
[snip]
Quoted 7 lines
drivers/crypto/caam_jr/caam_jr.c +0
-0@@ -461,7 +461,7 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) }
Quoted 5 lines
drivers/crypto/caam_jr/caam_jr.c caam_jr_prep_cdb(struct caam_jr_session *ses) · line 465
Quoted 4 lines
drivers/crypto/caam_jr/caam_jr.c +1
-1#if CAAM_JR_DBG -SEC_DUMP_DESC (cdb->sh_desc); +SEC_DUMP_DESC (cdb->sh_desc, stdout);#endif This hunk should go to next patch.
will fix it in v4
Quoted 18 lines
Quoted 1 line
drivers/crypto/caam_jr/caam_jr.c +0
-0cdb->sh_hdr.hi.field.idlen = shared_desc_len;[snip]
drivers/net/dpaa/dpaa_ethdev.c dpaa_eth_dev_configure(struct rte_eth_dev *dev) · line 287
Quoted 13 lines
drivers/net/dpaa/dpaa_ethdev.c +2
-2@@ -282,9 +282,9 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_interrupt_handler, (void *)dev);if (ret ==EINVAL ) -printf ("Failed to enable interrupt: Not Supported\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt: Not Supported\n" );else -printf ("Failed to enable interrupt\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt\n" );
DPAA_PMD_ERRappends a \n, so \n should be removed here.
Quoted 2 lines
There are double \n in this driver prior to this patch, can you fix them too? It is probably worth checking other NXP drivers on this topic.
will fix this in v4 and for the time being I am fixing it for dpaa set of drivers in 2nd patch of this series. Rest will follow as a separate patch.
Quoted 11 lines
drivers/net/dpaa/dpaa_ethdev.c dpaa_eth_dev_configure(struct rte_eth_dev *dev) · line 343
Quoted 10 lines
drivers/net/dpaa/dpaa_ethdev.c +1
-1} dev->data->dev_conf.intr_conf.lsc =0 ; dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC ;@@ -340,7 +340,7 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)dpaa_update_link_speed (__fif->node_name, speed, duplex); }else {/* Manual autoneg - custom advertisement speed. */ -printf ("Custom Advertisement speeds not supported\n" ); +DPAA_PMD_ERR ("Custom Advertisement speeds not supported\n" );Idem.
ok
Quoted 25 lines
Quoted 5 lines
drivers/net/dpaa/dpaa_ethdev.c +0
-0} }[snip]
drivers/net/dpaa/dpaa_rxtx.c static void dpaa_display_frame_info(const struct qm_fd *fd, · line 109
Quoted 13 lines
drivers/net/dpaa/dpaa_rxtx.c +1
-1@@ -103,7 +103,7 @@ static void dpaa_display_frame_info(const struct qm_fd *fd,for (ii =0 ; ii < fd->length20; ii++) {DISPLAY_PRINT ("%02x " , ptr[ii]);if (((ii +1 ) %16 ) ==0 ) -printf ("\n" ); +DISPLAY_PRINT ("\n" ); }DISPLAY_PRINT ("\n" ); }Indeed it is better to call this macro, but this macro is calling printf. I am ok with the change as this is under a debug build cflag, but I would prefer this debug code goes through
rte_login the future.
Quoted 15 lines · Hemant Agrawal
Quoted 15 lines
drivers/net/dpaa/dpaa_ethdev.c dpaa_eth_dev_configure(struct rte_eth_dev *dev) · line 287
Quoted 13 lines
drivers/net/dpaa/dpaa_ethdev.c +2
-2@@ -282,9 +282,9 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_interrupt_handler, (void *)dev);if (ret ==EINVAL ) -printf ("Failed to enable interrupt: Not Supported\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt: Not Supported\n" );else -printf ("Failed to enable interrupt\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt\n" );
DPAA_PMD_ERRappends a \n, so \n should be removed here.
Quoted 5 lines
Quoted 2 lines
There are double \n in this driver prior to this patch, can you fix them too? It is probably worth checking other NXP drivers on this topic.
will fix this in v4 and for the time being I am fixing it for dpaa set of drivers in 2nd patch of this series. Rest will follow as a separate patch.
Ok, thanks.
Signature · 1 line
David Marchand
PATCH v4 1/3 drivers: replace printf with log macros
In reply to Hemant AgrawalThis patch replaces the printf with related log macros and functions at various places in NXP dpaaX drivers.
--- drivers/bus/dpaa/base/fman/fman.c | 6 ++---- drivers/bus/dpaa/base/qbman/process.c | 29 +++++++++++++------------- drivers/bus/dpaa/base/qbman/qman.c | 2 +- drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/qbman/qbman_portal.c | 2 +- drivers/crypto/caam_jr/caam_jr.c | 4 ++-- drivers/crypto/caam_jr/caam_jr_uio.c | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_flow.c | 8 +++---- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_tm.c | 12 +++++------ 12 files changed, 38 insertions(+), 39 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +2 -4
@@ -723,10 +723,8 @@ fman_finish(void)/* release the mapping */ _errno =munmap (__if->ccsr_map, __if->regs_size);if (unlikely (_errno <0 )) -fprintf (stderr,"%s:%d:%s(): munmap() = %d (%s)\n" , - __FILE__, __LINE__, __func__, - -errno,strerror (errno)); -printf ("Tearing down %s\n" , __if->node_path); +FMAN_ERR (_errno,"munmap() = (%s)" ,strerror (errno)); +DPAA_BUS_INFO ("Tearing down %s" , __if->node_path);list_del (&__if->__if.node);rte_free (__if); }
drivers/bus/dpaa/base/qbman/process.c +15 -14
@@ -13,6 +13,7 @@#include "process.h" #include <fsl_usd.h> +#include "rte_dpaa_logs.h" /* As higher-level drivers will be built on top of this (dma_mem, qbman, ...), * it's preferable that the process driver itself not provide any exported API.
@@ -99,12 +100,12 @@ void process_release(enum dpaa_id_type id_type, uint32_t base, uint32_t num)int ret =check_fd ();if (ret) { -fprintf (stderr,"Process FD failure\n" ); +DPAA_BUS_ERR ("Process FD failure" );return ; } ret =ioctl (fd,DPAA_IOCTL_ID_RELEASE , &id);if (ret) -fprintf (stderr,"Process FD ioctl failure type %d base 0x%x num %d\n" , +DPAA_BUS_ERR ("Process FD ioctl failure type %d base 0x%x num %d" , id_type, base, num); }
@@ -333,9 +334,9 @@ int dpaa_intr_disable(char *if_name) ret =ioctl (fd,DPAA_IOCTL_DISABLE_LINK_STATUS_INTERRUPT , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to disable interrupt: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt: Not Supported" );else -printf ("Failed to disable interrupt\n" ); +DPAA_BUS_ERR ("Failed to disable interrupt" );return ret; }
@@ -357,7 +358,7 @@ int dpaa_get_ioctl_version_number(void)if (errno ==EINVAL ) { version_num =1 ; }else { -printf ("Failed to get ioctl version number\n" ); +DPAA_BUS_ERR ("Failed to get ioctl version number" ); version_num =-1 ; } }
@@ -388,7 +389,7 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS , &args);if (ret) { -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status" );return ret; }
@@ -404,9 +405,9 @@ int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) ret =ioctl (fd,DPAA_IOCTL_GET_LINK_STATUS_OLD , &args);if (ret) {if (errno ==EINVAL ) -printf ("Get link status: Not Supported\n" ); +DPAA_BUS_ERR ("Get link status: Not Supported" );else -printf ("Failed to get link status\n" ); +DPAA_BUS_ERR ("Failed to get link status" );return ret; }
@@ -434,9 +435,9 @@ int dpaa_update_link_status(char *if_name, int link_status) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_STATUS , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link status: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link status: Not Supported" );else -printf ("Failed to set link status" ); +DPAA_BUS_ERR ("Failed to set link status" );return ret; }
@@ -462,9 +463,9 @@ int dpaa_update_link_speed(char *if_name, int link_speed, int link_duplex) ret =ioctl (fd,DPAA_IOCTL_UPDATE_LINK_SPEED , &args);if (ret) {if (errno ==EINVAL ) -printf ("Failed to set link speed: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to set link speed: Not Supported" );else -printf ("Failed to set link speed\n" ); +DPAA_BUS_ERR ("Failed to set link speed" );return ret; }
@@ -484,9 +485,9 @@ int dpaa_restart_link_autoneg(char *if_name) ret =ioctl (fd,DPAA_IOCTL_RESTART_LINK_AUTONEG , if_name);if (ret) {if (errno ==EINVAL ) -printf ("Failed to restart autoneg: Not Supported\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg: Not Supported" );else -printf ("Failed to restart autoneg\n" ); +DPAA_BUS_ERR ("Failed to restart autoneg" );return ret; }
drivers/bus/dpaa/base/qbman/qman.c +1 -1
@@ -817,7 +817,7 @@ qman_ern_poll_free(void) fd = &swapped_msg.ern.fd;if (unlikely (verb &0x20 )) { -printf ("HW ERN notification, Nothing to do\n" ); +pr_warn ("HW ERN notification, Nothing to do\n" ); }else {if ((fd->bpid &0xff ) !=0xff )qman_free_mbuf_cb (fd);
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -395,7 +395,7 @@ rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size) ret =ioctl (group->container->fd,VFIO_IOMMU_MAP_DMA , &dma_map);if (ret) { -printf ("Unable to map DMA address (errno = %d)\n" , +DPAA2_BUS_ERR ("Unable to map DMA address (errno = %d)" , errno);return ret; }
drivers/bus/fslmc/qbman/qbman_portal.c +1 -1
@@ -1879,7 +1879,7 @@ void qbman_pull_desc_set_rad(struct qbman_pull_desc *d, int rad)else d->pull.verb &= ~(1 <<QB_VDQCR_VERB_RAD_SHIFT ); }else { -printf ("The RAD feature is not valid when RLS = 0\n" ); +pr_warn ("The RAD feature is not valid when RLS = 0\n" ); } }
drivers/crypto/caam_jr/caam_jr.c +2 -2
@@ -587,8 +587,8 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring,/* todo check if it is false alarm no desc present */ if (!current_desc_addr) { false_alarm++; -printf ("false alarm %" PRIu64"real %" PRIu64 -" sec_err =0x%x cidx Index =0%d\n" , +CAAM_JR_ERR ("false alarm %" PRIu64"real %" PRIu64 +" sec_err =0x%x cidx Index =0%d" , false_alarm, real_poll, sec_error_code, job_ring->cidx);rte_panic ("CAAM JR descriptor NULL" );
drivers/crypto/caam_jr/caam_jr_uio.c +1 -1
@@ -418,7 +418,7 @@ sec_configure(void) d =opendir (SEC_UIO_DEVICE_SYS_ATTR_PATH );if (d ==NULL ) { -printf ("\nError opening directory '%s': %s\n" , +CAAM_JR_ERR ("Error opening directory '%s': %s" ,SEC_UIO_DEVICE_SYS_ATTR_PATH ,strerror (errno));return -1 ; }
drivers/net/dpaa/dpaa_ethdev.c +3 -3
@@ -282,9 +282,9 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_interrupt_handler, (void *)dev);if (ret ==EINVAL ) -printf ("Failed to enable interrupt: Not Supported\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt: Not Supported" );else -printf ("Failed to enable interrupt\n" ); +DPAA_PMD_ERR ("Failed to enable interrupt" ); } dev->data->dev_conf.intr_conf.lsc =0 ; dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC ;
@@ -340,7 +340,7 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)dpaa_update_link_speed (__fif->node_name, speed, duplex); }else {/* Manual autoneg - custom advertisement speed. */ -printf ("Custom Advertisement speeds not supported\n" ); +DPAA_PMD_ERR ("Custom Advertisement speeds not supported" ); } }
drivers/net/dpaa/dpaa_flow.c +4 -4
@@ -68,7 +68,7 @@ static void fm_prev_cleanup(void) fm_info.fman_handle =fm_open (fman_id);if (!fm_info.fman_handle) { -printf ("\n%s- unable to open FMAN" , __func__); +DPAA_PMD_ERR ("unable to open FMAN" );return ; }
@@ -78,7 +78,7 @@ static void fm_prev_cleanup(void)/* FM PCD Open */ fm_info.pcd_handle =fm_pcd_open (&fm_pcd_params);if (!fm_info.pcd_handle) { -printf ("\n%s- unable to open PCD" , __func__); +DPAA_PMD_ERR ("unable to open PCD" );return ; }
@@ -108,11 +108,11 @@ static void fm_prev_cleanup(void)continue ;if (dpaa_fm_deconfig (&dpaa_intf,NULL )) -printf ("\nDPAA FM deconfig failed\n" ); +DPAA_PMD_ERR ("DPAA FM deconfig failed" ); }if (dpaa_fm_term ()) -printf ("\nDPAA FM term failed\n" ); +DPAA_PMD_ERR ("DPAA FM term failed" );memset (&fm_model,0 ,sizeof (struct dpaa_fm_model )); }
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -103,7 +103,7 @@ static void dpaa_display_frame_info(const struct qm_fd *fd,for (ii =0 ; ii < fd->length20; ii++) {DISPLAY_PRINT ("%02x " , ptr[ii]);if (((ii +1 ) %16 ) ==0 ) -printf ("\n" ); +DISPLAY_PRINT ("\n" ); }DISPLAY_PRINT ("\n" ); }
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -2694,7 +2694,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->max_vlan_filters = attr.vlan_filter_entries; priv->flags =0 ;#if defined(RTE_LIBRTE_IEEE1588 ) -printf ("DPDK IEEE1588 is enabled\n" ); +DPAA2_PMD_INFO ("DPDK IEEE1588 is enabled" ); priv->flags |=DPAA2_TX_CONF_ENABLE ;#endif /* Used with ``fslmc:dpni.1,drv_tx_conf=1`` */
drivers/net/dpaa2/dpaa2_tm.c +6 -6
@@ -499,7 +499,7 @@ dpaa2_node_add(struct rte_eth_dev *dev, uint32_t node_id, node->channel_id = priv->channel_inuse; priv->channel_inuse++; }else { -printf ("error no channel id available\n" ); +DPAA2_PMD_ERR ("error no channel id available" ); } }
@@ -580,7 +580,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) flow_id =0 ;if (dpaa2_q ==NULL ) { -printf ("Queue is not configured for node = %d\n" , node->id); +DPAA2_PMD_ERR ("Queue is not configured for node = %d" , node->id);return -1 ; }
@@ -590,9 +590,9 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), flow_id, options, &tx_flow_cfg);if (ret) { -printf ("Error in setting the tx flow: " +DPAA2_PMD_ERR ("Error in setting the tx flow: " "channel id = %d tc_id= %d, param = 0x%x " -"flow=%d err=%d\n" , node->parent->channel_id, tc_id, +"flow=%d err=%d" , node->parent->channel_id, tc_id, ((node->parent->channel_id <<8 ) | tc_id), flow_id, ret);return -1 ;
@@ -605,7 +605,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node)DPNI_QUEUE_TX , ((node->parent->channel_id <<8 ) | dpaa2_q->tc_index), dpaa2_q->flow_id, &tx_flow_cfg, &qid);if (ret) { -printf ("Error in getting LFQID err=%d" , ret); +DPAA2_PMD_ERR ("Error in getting LFQID err=%d" , ret);return -1 ; } dpaa2_q->fqid = qid.fqid;
@@ -636,7 +636,7 @@ dpaa2_tm_configure_queue(struct rte_eth_dev *dev, struct dpaa2_tm_node *node) ((node->parent->channel_id <<8 ) | tc_id), &cong_notif_cfg);if (ret) { -printf ("Error in setting tx congestion notification: " +DPAA2_PMD_ERR ("Error in setting tx congestion notification: " "err=%d" , ret);return -ret; }
Signature · 1 line
2.25.1
PATCH v4 2/3 drivers: dpaa: remove double newline
Remove duplicate newline \n from the debugging macros to avoid double \n\n.
--- drivers/bus/dpaa/base/fman/fman.c | 58 ++++++++++++++--------------- drivers/bus/dpaa/dpaa_bus.c | 12 +++--- drivers/event/dpaa/dpaa_eventdev.c | 20 +++++----- drivers/mempool/dpaa/dpaa_mempool.c | 4 +- drivers/net/dpaa/dpaa_ethdev.c | 42 ++++++++++----------- drivers/net/dpaa/dpaa_flow.c | 4 +- drivers/net/dpaa/fmlib/fm_lib.c | 6 +-- drivers/net/dpaa/fmlib/fm_vsp.c | 10 ++--- 8 files changed, 77 insertions(+), 79 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +28 -30
@@ -244,13 +244,13 @@ fman_if_init(const struct device_node *dpa_node)/* Obtain the MAC node used by this interface except macless */ mac_phandle =of_get_property (dpa_node, mprop, &lenp);if (!mac_phandle) { -FMAN_ERR (-EINVAL ,"%s: no %s\n" , dname, mprop); +FMAN_ERR (-EINVAL ,"%s: no %s" , dname, mprop);return -EINVAL ; }assert (lenp ==sizeof (phandle)); mac_node =of_find_node_by_phandle (*mac_phandle);if (!mac_node) { -FMAN_ERR (-ENXIO ,"%s: bad 'fsl,fman-mac\n" , dname); +FMAN_ERR (-ENXIO ,"%s: bad 'fsl,fman-mac" , dname);return -ENXIO ; } mname = mac_node->full_name;
@@ -262,19 +262,19 @@ fman_if_init(const struct device_node *dpa_node) ports_phandle =of_get_property (mac_node,"fsl,fman-ports" , &lenp);if (!ports_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,port-handles\n" , +FMAN_ERR (-EINVAL ,"%s: no fsl,port-handles" , mname);return -EINVAL ; }assert (lenp == (2 *sizeof (phandle))); rx_node =of_find_node_by_phandle (ports_phandle[0 ]);if (!rx_node) { -FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[0]\n" , mname); +FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[0]" , mname);return -ENXIO ; } tx_node =of_find_node_by_phandle (ports_phandle[1 ]);if (!tx_node) { -FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[1]\n" , mname); +FMAN_ERR (-ENXIO ,"%s: bad fsl,port-handle[1]" , mname);return -ENXIO ; }
@@ -282,8 +282,7 @@ fman_if_init(const struct device_node *dpa_node)if (of_device_is_compatible (dpa_node,"fsl,dpa-ethernet" )) { port_cell_idx =of_get_property (rx_node,"cell-index" , &lenp);if (!port_cell_idx) { -FMAN_ERR (-ENXIO , -"%s: no cell-index for port\n" , mname); +FMAN_ERR (-ENXIO ,"%s: no cell-index for port" , mname);return -ENXIO ; }assert (lenp ==sizeof (*port_cell_idx));
@@ -305,8 +304,7 @@ fman_if_init(const struct device_node *dpa_node) ext_args_cell_idx =of_get_property (ext_args_node,"cell-index" , &lenp);if (!ext_args_cell_idx) { -FMAN_ERR (-ENXIO , -"%s: no cell-index for ext args\n" , +FMAN_ERR (-ENXIO ,"%s: no cell-index for ext args" , mname);return -ENXIO ; }
@@ -343,7 +341,7 @@ fman_if_init(const struct device_node *dpa_node)/* Allocate an object for this network interface */ __if =rte_malloc (NULL ,sizeof (*__if),RTE_CACHE_LINE_SIZE );if (!__if) { -FMAN_ERR (-ENOMEM ,"malloc(%zu)\n" ,sizeof (*__if)); +FMAN_ERR (-ENOMEM ,"malloc(%zu)" ,sizeof (*__if)); goto err; }memset (__if,0 ,sizeof (*__if));
@@ -356,12 +354,12 @@ fman_if_init(const struct device_node *dpa_node)/* Map the CCSR regs for the MAC node */ regs_addr =of_get_address (mac_node,0 , &__if->regs_size,NULL );if (!regs_addr) { -FMAN_ERR (-EINVAL ,"of_get_address(%s)\n" , mname); +FMAN_ERR (-EINVAL ,"of_get_address(%s)" , mname); goto err; } phys_addr =of_translate_address (mac_node, regs_addr);if (!phys_addr) { -FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)\n" , +FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)" , mname, regs_addr); goto err; }
@@ -369,7 +367,7 @@ fman_if_init(const struct device_node *dpa_node)PROT_READ |PROT_WRITE ,MAP_SHARED , fman_ccsr_map_fd, phys_addr);if (__if->ccsr_map ==MAP_FAILED ) { -FMAN_ERR (-errno,"mmap(0x%" PRIx64")\n" , phys_addr); +FMAN_ERR (-errno,"mmap(0x%" PRIx64")" , phys_addr); goto err; } na =of_n_addr_cells (mac_node);
@@ -380,13 +378,13 @@ fman_if_init(const struct device_node *dpa_node) fman_node =of_get_parent (mac_node); na =of_n_addr_cells (mac_node);if (!fman_node) { -FMAN_ERR (-ENXIO ,"of_get_parent(%s)\n" , mname); +FMAN_ERR (-ENXIO ,"of_get_parent(%s)" , mname); goto err; } fname = fman_node->full_name; cell_idx =of_get_property (fman_node,"cell-index" , &lenp);if (!cell_idx) { -FMAN_ERR (-ENXIO ,"%s: no cell-index)\n" , fname); +FMAN_ERR (-ENXIO ,"%s: no cell-index)" , fname); goto err; }assert (lenp ==sizeof (*cell_idx));
@@ -395,7 +393,7 @@ fman_if_init(const struct device_node *dpa_node)if (!get_once) { _errno =fman_get_ip_rev (fman_node);if (_errno) { -FMAN_ERR (-ENXIO ,"%s: ip_rev is not available\n" , +FMAN_ERR (-ENXIO ,"%s: ip_rev is not available" , fname); goto err; }
@@ -425,7 +423,7 @@ fman_if_init(const struct device_node *dpa_node) char_prop =of_get_property (mac_node,"phy-connection-type" ,NULL );if (!char_prop) { -printf ("memac: unknown MII type assuming 1G\n" ); +FMAN_ERR (-EINVAL ,"memac: unknown MII type assuming 1G" );/* Right now forcing memac to 1g in case of error*/ __if->__if.mac_type = fman_mac_1g; }else {
@@ -440,7 +438,7 @@ fman_if_init(const struct device_node *dpa_node) __if->__if.mac_type = fman_mac_10g; } }else { -FMAN_ERR (-EINVAL ,"%s: unknown MAC type\n" , mname); +FMAN_ERR (-EINVAL ,"%s: unknown MAC type" , mname); goto err; }
@@ -463,7 +461,7 @@ fman_if_init(const struct device_node *dpa_node) mac_addr =of_get_property (mac_node,"local-mac-address" , &lenp);if (!mac_addr) { -FMAN_ERR (-EINVAL ,"%s: no local-mac-address\n" , +FMAN_ERR (-EINVAL ,"%s: no local-mac-address" , mname); goto err; }
@@ -473,19 +471,19 @@ fman_if_init(const struct device_node *dpa_node) tx_channel_id =of_get_property (tx_node,"fsl,qman-channel-id" , &lenp);if (!tx_channel_id) { -FMAN_ERR (-EINVAL ,"%s: no fsl-qman-channel-id\n" , +FMAN_ERR (-EINVAL ,"%s: no fsl-qman-channel-id" , tx_node->full_name); goto err; } regs_addr =of_get_address (rx_node,0 , &__if->regs_size,NULL );if (!regs_addr) { -FMAN_ERR (-EINVAL ,"of_get_address(%s)\n" , mname); +FMAN_ERR (-EINVAL ,"of_get_address(%s)" , mname); goto err; } phys_addr =of_translate_address (rx_node, regs_addr);if (!phys_addr) { -FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)\n" , +FMAN_ERR (-EINVAL ,"of_translate_address(%s, %p)" , mname, regs_addr); goto err; }
@@ -493,7 +491,7 @@ fman_if_init(const struct device_node *dpa_node)PROT_READ |PROT_WRITE ,MAP_SHARED , fman_ccsr_map_fd, phys_addr);if (__if->bmi_map ==MAP_FAILED ) { -FMAN_ERR (-errno,"mmap(0x%" PRIx64")\n" , phys_addr); +FMAN_ERR (-errno,"mmap(0x%" PRIx64")" , phys_addr); goto err; }
@@ -507,7 +505,7 @@ fman_if_init(const struct device_node *dpa_node)*/ rx_phandle =of_get_property (dpa_node, rprop, &lenp);if (!rx_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-rx\n" , dname); +FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-rx" , dname); goto err; }
@@ -542,7 +540,7 @@ fman_if_init(const struct device_node *dpa_node) tx_phandle =of_get_property (dpa_node,"fsl,qman-frame-queues-tx" , &lenp);if (!tx_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-tx\n" , dname); +FMAN_ERR (-EINVAL ,"%s: no fsl,qman-frame-queues-tx" , dname); goto err; }
@@ -562,7 +560,7 @@ fman_if_init(const struct device_node *dpa_node) pools_phandle =of_get_property (dpa_node,"fsl,bman-buffer-pools" , &lenp);if (!pools_phandle) { -FMAN_ERR (-EINVAL ,"%s: no fsl,bman-buffer-pools\n" , dname); +FMAN_ERR (-EINVAL ,"%s: no fsl,bman-buffer-pools" , dname); goto err; }/* For each pool, parse the corresponding node and add a pool object
@@ -578,13 +576,13 @@ fman_if_init(const struct device_node *dpa_node)/* Allocate an object for the pool */ bpool =rte_malloc (NULL ,sizeof (*bpool),RTE_CACHE_LINE_SIZE );if (!bpool) { -FMAN_ERR (-ENOMEM ,"malloc(%zu)\n" ,sizeof (*bpool)); +FMAN_ERR (-ENOMEM ,"malloc(%zu)" ,sizeof (*bpool)); goto err; }/* Find the pool node */ pool_node =of_find_node_by_phandle (*pools_phandle);if (!pool_node) { -FMAN_ERR (-ENXIO ,"%s: bad fsl,bman-buffer-pools\n" , +FMAN_ERR (-ENXIO ,"%s: bad fsl,bman-buffer-pools" , dname);rte_free (bpool); goto err;
@@ -593,7 +591,7 @@ fman_if_init(const struct device_node *dpa_node)/* Extract the BPID property */ prop =of_get_property (pool_node,"fsl,bpid" , &proplen);if (!prop) { -FMAN_ERR (-EINVAL ,"%s: no fsl,bpid\n" , pname); +FMAN_ERR (-EINVAL ,"%s: no fsl,bpid" , pname);rte_free (bpool); goto err; }
@@ -691,7 +689,7 @@ fman_init(void)for_each_child_node (parent_node, dpa_node) { _errno =fman_if_init (dpa_node);if (_errno) { -FMAN_ERR (_errno,"if_init(%s)\n" , dpa_node->full_name); +FMAN_ERR (_errno,"if_init(%s)" , dpa_node->full_name); goto err; } }
drivers/bus/dpaa/dpaa_bus.c +6 -6
@@ -326,7 +326,7 @@ int rte_dpaa_portal_init(void *arg) dpaa_seqn_dynfield_offset =rte_mbuf_dynfield_register (&dpaa_seqn_dynfield_desc);if (dpaa_seqn_dynfield_offset <0 ) { -DPAA_BUS_LOG (ERR ,"Failed to register mbuf field for dpaa sequence number\n" ); +DPAA_BUS_LOG (ERR ,"Failed to register mbuf field for dpaa sequence number" );return -rte_errno; }
@@ -673,7 +673,7 @@ rte_dpaa_bus_probe(void)if (dev->device_type ==FSL_DPAA_ETH ) { ret =rte_dpaa_setup_intr (dev->intr_handle);if (ret) -DPAA_BUS_ERR ("Error setting up interrupt.\n" ); +DPAA_BUS_ERR ("Error setting up interrupt." ); } }
@@ -734,13 +734,13 @@ rte_dpaa_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,while (dev !=NULL ) {if (cmp (&dev->device, data) ==0 ) { -DPAA_BUS_DEBUG ("Found dev=(%s)\n" , dev->device.name); +DPAA_BUS_DEBUG ("Found dev=(%s)" , dev->device.name);return &dev->device; } dev =TAILQ_NEXT (dev, next); } -DPAA_BUS_DEBUG ("Unable to find any device\n" ); +DPAA_BUS_DEBUG ("Unable to find any device" );return NULL ; }
@@ -786,14 +786,14 @@ dpaa_bus_dev_iterate(const void *start, const char *str,/* Expectation is that device would be name=device_name */ if (strncmp (str,"name=" ,5 ) !=0 ) { -DPAA_BUS_DEBUG ("Invalid device string (%s)\n" , str); +DPAA_BUS_DEBUG ("Invalid device string (%s)" , str);return NULL ; }/* Now that name=device_name format is available, split */ dup =strdup (str);if (dup ==NULL ) { -DPAA_BUS_DEBUG ("Dup string (%s) failed!\n" , str); +DPAA_BUS_DEBUG ("Dup string (%s) failed!" , str);return NULL ; } dev_name = dup +strlen ("name=" );
drivers/event/dpaa/dpaa_eventdev.c +10 -10
@@ -386,13 +386,13 @@ dpaa_event_dev_configure(const struct rte_eventdev *dev)sizeof (uint32_t ) * priv->nb_event_queues, RTE_CACHE_LINE_SIZE);if (ch_id ==NULL ) { -DPAA_EVENTDEV_ERR ("Fail to allocate memory for dpaa channels\n" ); +DPAA_EVENTDEV_ERR ("Fail to allocate memory for dpaa channels" );return -ENOMEM ; }/* Create requested event queues within the given event device */ ret =qman_alloc_pool_range (ch_id, priv->nb_event_queues,1 ,0 );if (ret <0 ) { -DPAA_EVENTDEV_ERR ("qman_alloc_pool_range %u, err =%d\n" , +DPAA_EVENTDEV_ERR ("qman_alloc_pool_range %u, err =%d" , priv->nb_event_queues, ret);rte_free (ch_id);return ret;
@@ -655,7 +655,7 @@ dpaa_event_eth_rx_adapter_queue_add( queue_conf);if (ret) {DPAA_EVENTDEV_ERR ( -"Event Queue attach failed:%d\n" , ret); +"Event Queue attach failed:%d" , ret); goto detach_configured_queues; } }
@@ -664,7 +664,7 @@ dpaa_event_eth_rx_adapter_queue_add( ret =dpaa_eth_eventq_attach (eth_dev, rx_queue_id, ch_id, queue_conf);if (ret) -DPAA_EVENTDEV_ERR ("dpaa_eth_eventq_attach failed:%d\n" , ret); +DPAA_EVENTDEV_ERR ("dpaa_eth_eventq_attach failed:%d" , ret);return ret; detach_configured_queues:
@@ -691,7 +691,7 @@ dpaa_event_eth_rx_adapter_queue_del(const struct rte_eventdev *dev, ret =dpaa_eth_eventq_detach (eth_dev, i);if (ret)DPAA_EVENTDEV_ERR ( -"Event Queue detach failed:%d\n" , ret); +"Event Queue detach failed:%d" , ret); }return 0 ;
@@ -699,7 +699,7 @@ dpaa_event_eth_rx_adapter_queue_del(const struct rte_eventdev *dev, ret =dpaa_eth_eventq_detach (eth_dev, rx_queue_id);if (ret) -DPAA_EVENTDEV_ERR ("dpaa_eth_eventq_detach failed:%d\n" , ret); +DPAA_EVENTDEV_ERR ("dpaa_eth_eventq_detach failed:%d" , ret);return ret; }
@@ -762,7 +762,7 @@ dpaa_eventdev_crypto_queue_add_all(const struct rte_eventdev *dev, ret =dpaa_sec_eventq_attach (cryptodev, i, ch_id, ev);if (ret) { -DPAA_EVENTDEV_ERR ("dpaa_sec_eventq_attach failed: ret %d\n" , +DPAA_EVENTDEV_ERR ("dpaa_sec_eventq_attach failed: ret %d" , ret); goto fail; }
@@ -796,7 +796,7 @@ dpaa_eventdev_crypto_queue_add(const struct rte_eventdev *dev, ch_id, &conf->ev);if (ret) {DPAA_EVENTDEV_ERR ( -"dpaa_sec_eventq_attach failed: ret: %d\n" , ret); +"dpaa_sec_eventq_attach failed: ret: %d" , ret);return ret; }return 0 ;
@@ -816,7 +816,7 @@ dpaa_eventdev_crypto_queue_del_all(const struct rte_eventdev *dev, ret =dpaa_sec_eventq_detach (cdev, i);if (ret) {DPAA_EVENTDEV_ERR ( -"dpaa_sec_eventq_detach failed:ret %d\n" , ret); +"dpaa_sec_eventq_detach failed:ret %d" , ret);return ret; } }
@@ -839,7 +839,7 @@ dpaa_eventdev_crypto_queue_del(const struct rte_eventdev *dev, ret =dpaa_sec_eventq_detach (cryptodev, rx_queue_id);if (ret) {DPAA_EVENTDEV_ERR ( -"dpaa_sec_eventq_detach failed: ret: %d\n" , ret); +"dpaa_sec_eventq_detach failed: ret: %d" , ret);return ret; }
drivers/mempool/dpaa/dpaa_mempool.c +2 -2
@@ -285,7 +285,7 @@ dpaa_mbuf_get_count(const struct rte_mempool *mp)MEMPOOL_INIT_FUNC_TRACE ();if (!mp || !mp->pool_data) { -DPAA_MEMPOOL_ERR ("Invalid mempool provided\n" ); +DPAA_MEMPOOL_ERR ("Invalid mempool provided" );return 0 ; }
@@ -303,7 +303,7 @@ dpaa_populate(struct rte_mempool *mp, unsigned int max_objs,unsigned int total_elt_sz;if (!mp || !mp->pool_data) { -DPAA_MEMPOOL_ERR ("Invalid mempool provided\n" ); +DPAA_MEMPOOL_ERR ("Invalid mempool provided" );return 0 ; }
drivers/net/dpaa/dpaa_ethdev.c +21 -21
162 lines not on this page · raw message
drivers/net/dpaa/dpaa_flow.c +2 -2
@@ -531,7 +531,7 @@ static inline int set_port_pcd(struct dpaa_if *dpaa_intf)/* FM PORT DeletePCD */ ret =fm_port_delete_pcd (dpaa_intf->port_handle);if (ret !=E_OK ) { -DPAA_PMD_ERR ("fm_port_delete_pcd: Failed\n" ); +DPAA_PMD_ERR ("fm_port_delete_pcd: Failed" );return ret; }return -1 ;
@@ -686,7 +686,7 @@ static inline int set_fm_port_handle(struct dpaa_if *dpaa_intf,/* FM PORT Open */ dpaa_intf->port_handle =fm_port_open (&fm_port_params);if (!dpaa_intf->port_handle) { -DPAA_PMD_ERR ("fm_port_open: Failed\n" ); +DPAA_PMD_ERR ("fm_port_open: Failed" );return -1 ; }
drivers/net/dpaa/fmlib/fm_lib.c +3 -3
@@ -102,7 +102,7 @@ fm_get_api_version(t_handle h_fm, ioc_fm_api_version_t *p_version) ret =ioctl (p_dev->fd,FM_IOC_GET_API_VERSION , p_version);if (ret) { -DPAA_PMD_ERR ("cannot get API version, error %i (%s)\n" , +DPAA_PMD_ERR ("cannot get API version, error %i (%s)" , errno,strerror (errno));RETURN_ERROR (MINOR ,E_INVALID_OPERATION ,NO_MSG ); }
@@ -275,7 +275,7 @@ fm_pcd_kg_scheme_set(t_handle h_fm_pcd, ret =ioctl (p_pcd_dev->fd,FM_PCD_IOC_KG_SCHEME_SET , params);if (ret) { -DPAA_PMD_ERR (" cannot set kg scheme, error %i (%s)\n" , +DPAA_PMD_ERR (" cannot set kg scheme, error %i (%s)" , errno,strerror (errno));return NULL ; }
@@ -309,7 +309,7 @@ fm_pcd_kg_scheme_delete(t_handle h_scheme) id.obj =UINT_TO_PTR (p_dev->id);if (ioctl (p_pcd_dev->fd,FM_PCD_IOC_KG_SCHEME_DELETE , &id)) { -DPAA_PMD_WARN ("cannot delete kg scheme, error %i (%s)\n" , +DPAA_PMD_WARN ("cannot delete kg scheme, error %i (%s)" , errno,strerror (errno));RETURN_ERROR (MINOR ,E_INVALID_OPERATION ,NO_MSG ); }
drivers/net/dpaa/fmlib/fm_vsp.c +5 -5
@@ -55,13 +55,13 @@ fm_vsp_config(t_fm_vsp_params *p_fm_vsp_params) param.id =NULL ;if (ioctl (p_dev->fd,FM_IOC_VSP_CONFIG , ¶m)) { -DPAA_PMD_ERR ("%s ioctl error\n" , __func__); +DPAA_PMD_ERR ("ioctl error" );return NULL ; } p_vsp_dev = (t_device *)malloc (sizeof (t_device));if (!p_vsp_dev) { -DPAA_PMD_ERR ("FM VSP Params!\n" ); +DPAA_PMD_ERR ("FM VSP Params!" );return NULL ; }memset (p_vsp_dev,0 ,sizeof (t_device));
@@ -87,7 +87,7 @@ fm_vsp_init(t_handle h_fm_vsp) id.obj =UINT_TO_PTR (p_vsp_dev->id);if (ioctl (p_dev->fd,FM_IOC_VSP_INIT , &id)) { -DPAA_PMD_ERR ("%s ioctl error\n" , __func__); +DPAA_PMD_ERR ("ioctl error" );RETURN_ERROR (MINOR ,E_INVALID_OPERATION ,NO_MSG ); }
@@ -109,7 +109,7 @@ fm_vsp_free(t_handle h_fm_vsp) id.obj =UINT_TO_PTR (p_vsp_dev->id);if (ioctl (p_dev->fd,FM_IOC_VSP_FREE , &id)) { -DPAA_PMD_ERR ("%s ioctl error\n" , __func__); +DPAA_PMD_ERR ("ioctl error" );RETURN_ERROR (MINOR ,E_INVALID_OPERATION ,NO_MSG ); }
@@ -138,7 +138,7 @@ fm_vsp_config_buffer_prefix_content(t_handle h_fm_vsp,if (ioctl (p_dev->fd,FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT , ¶ms)) { -DPAA_PMD_ERR ("%s ioctl error\n" , __func__); +DPAA_PMD_ERR ("ioctl error" );RETURN_ERROR (MINOR ,E_INVALID_OPERATION ,NO_MSG ); }
Signature · 1 line
2.25.1
PATCH v4 3/3 drivers: replace printf with fprintf for debug functions
In reply to Hemant AgrawalThis patch replaces simple printf with fprintf for debug dump related functions for various NXP dpaaX related drivers.
--- drivers/bus/dpaa/base/fman/netcfg_layer.c | 22 +++---- drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/dpaa/include/netcfg.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 4 +- drivers/crypto/caam_jr/caam_jr_desc.h | 4 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 32 +++++----- drivers/crypto/dpaa_sec/dpaa_sec.c | 62 +++++++++---------- drivers/net/dpaa2/dpaa2_flow.c | 66 +++++++++++---------- 8 files changed, 98 insertions(+), 96 deletions(-)
drivers/bus/dpaa/base/fman/netcfg_layer.c +11 -11
@@ -29,37 +29,37 @@ static int skfd = -1;#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER void -dump_netcfg (struct netcfg_info *cfg_ptr) +dump_netcfg (struct netcfg_info *cfg_ptr,FILE *f) {int i; -printf (".......... DPAA Configuration ..........\n\n" ); +fprintf (f,".......... DPAA Configuration ..........\n\n" );/* Network interfaces */ -printf ("Network interfaces: %d\n" , cfg_ptr->num_ethports); +fprintf (f,"Network interfaces: %d\n" , cfg_ptr->num_ethports);for (i =0 ; i < cfg_ptr->num_ethports; i++) {struct fman_if_bpool *bpool;struct fm_eth_port_cfg *p_cfg = &cfg_ptr->port_cfg[i];struct fman_if *__if = p_cfg->fman_if; -printf ("\n+ Fman %d, MAC %d (%s);\n" , +fprintf (f,"\n+ Fman %d, MAC %d (%s);\n" , __if->fman_idx, __if->mac_idx, (__if->mac_type == fman_mac_1g) ?"1G" : (__if->mac_type == fman_mac_2_5g) ?"2.5G" :"10G" ); -printf ("\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" , +fprintf (f,"\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n" ,RTE_ETHER_ADDR_BYTES (&__if->mac_addr)); -printf ("\ttx_channel_id: 0x%02x\n" , +fprintf (f,"\ttx_channel_id: 0x%02x\n" , __if->tx_channel_id); -printf ("\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); -printf ("\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); +fprintf (f,"\tfqid_rx_def: 0x%x\n" , p_cfg->rx_def); +fprintf (f,"\tfqid_rx_err: 0x%x\n" , __if->fqid_rx_err); -printf ("\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); -printf ("\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm); +fprintf (f,"\tfqid_tx_err: 0x%x\n" , __if->fqid_tx_err); +fprintf (f,"\tfqid_tx_confirm: 0x%x\n" , __if->fqid_tx_confirm);fman_if_for_each_bpool (bpool, __if) -printf ("\tbuffer pool: (bpid=%d, count=%" PRId64 +fprintf (f,"\tbuffer pool: (bpid=%d, count=%" PRId64" size=%" PRId64", addr=0x%" PRIx64")\n" , bpool->bpid, bpool->count, bpool->size, bpool->addr);
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -586,7 +586,7 @@ rte_dpaa_bus_dev_build(void) }#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER -dump_netcfg (dpaa_netcfg); +dump_netcfg (dpaa_netcfg, stdout);#endif DPAA_BUS_LOG(DEBUG, "Number of ethernet devices = %d",
drivers/bus/dpaa/include/netcfg.h +1 -1
@@ -60,7 +60,7 @@ void netcfg_release(struct netcfg_info *cfg_ptr);/* cfg_ptr: configuration information pointer. * This function dumps configuration data to stdout. */ -void dump_netcfg (struct netcfg_info *cfg_ptr); +void dump_netcfg (struct netcfg_info *cfg_ptr,FILE *f);#endif #endif /* __NETCFG_H */
drivers/crypto/caam_jr/caam_jr.c +2 -2
@@ -1410,9 +1410,9 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) rte_pktmbuf_mtod(op->sym->m_src, void *),rte_pktmbuf_data_len (op->sym->m_src)); -printf ("\n JD before conversion\n" ); +fprintf (stdout,"\n JD before conversion\n" );for (i =0 ; i <12 ; i++) -printf ("\n 0x%08x" , ctx->jobdes.desc[i]); +fprintf (stdout,"\n 0x%08x" , ctx->jobdes.desc[i]);#endif CAAM_JR_DP_DEBUG("Jr[%p] pi[%d] ci[%d].Before sending desc",
drivers/crypto/caam_jr/caam_jr_desc.h +2 -2
@@ -110,13 +110,13 @@ ((struct descriptor_header_s *)(descriptor))->command.jd.desclen)/* Helper macro for dumping the hex representation of a descriptor */ -#define SEC_DUMP_DESC (descriptor) { \ +#define SEC_DUMP_DESC (descriptor, f) { \ int __i; \ CAAM_JR_INFO("Des@ 0x%08x\n", (uint32_t)((uint32_t *)(descriptor)));\ for (__i = 0; \ __i < SEC_GET_DESC_LEN(descriptor); \ __i++) { \ - printf("0x%08x: 0x%08x\n", \ + fprintf(f, "0x%08x: 0x%08x\n", \ (uint32_t)(((uint32_t *)(descriptor)) + __i), \ *(((uint32_t *)(descriptor)) + __i)); \ } \
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +16 -16
@@ -1621,7 +1621,7 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct dpaa2_sec_qp *qp) }static void -dpaa2_sec_dump (struct rte_crypto_op *op) +dpaa2_sec_dump (struct rte_crypto_op *op,FILE *f) {int i;dpaa2_sec_session *sess =NULL ;
@@ -1640,18 +1640,18 @@ dpaa2_sec_dump(struct rte_crypto_op *op) goto mbuf_dump; priv = (struct ctxt_priv *)sess->ctxt; -printf ("\n****************************************\n" +fprintf (f,"\n****************************************\n" "session params:\n\tContext type:\t%d\n\tDirection:\t%s\n" "\tCipher alg:\t%d\n\tAuth alg:\t%d\n\tAead alg:\t%d\n" "\tCipher key len:\t%zd\n" , sess->ctxt_type, (sess->dir ==DIR_ENC ) ?"DIR_ENC" :"DIR_DEC" , sess->cipher_alg, sess->auth_alg, sess->aead_alg, sess->cipher_key.length); -rte_hexdump (stdout,"cipher key" , sess->cipher_key.data, +rte_hexdump (f,"cipher key" , sess->cipher_key.data, sess->cipher_key.length); -rte_hexdump (stdout,"auth key" , sess->auth_key.data, +rte_hexdump (f,"auth key" , sess->auth_key.data, sess->auth_key.length); - printf("\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" + fprintf(f, "\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n" "\tdigest length:\t%d\n\tstatus:\t\t%d\n\taead auth only" " len:\t%d\n\taead cipher text:\t%d\n", sess->auth_key.length, sess->iv.length, sess->iv.offset,
@@ -1659,7 +1659,7 @@ dpaa2_sec_dump(struct rte_crypto_op *op) sess->ext_params.aead_ctxt.auth_only_len, sess->ext_params.aead_ctxt.auth_cipher_text);#ifdef RTE_LIB_SECURITY - printf("PDCP session params:\n" + fprintf(f, "PDCP session params:\n" "\tDomain:\t\t%d\n\tBearer:\t\t%d\n\tpkt_dir:\t%d\n\thfn_ovd:" "\t%d\n\tsn_size:\t%d\n\thfn_ovd_offset:\t%d\n\thfn:\t\t%d\n" "\thfn_threshold:\t0x%x\n", sess->pdcp.domain,
@@ -1669,29 +1669,29 @@ dpaa2_sec_dump(struct rte_crypto_op *op)#endif bufsize = (uint8_t )priv->flc_desc[0 ].flc.word1_sdl; -printf ("Descriptor Dump:\n" ); +fprintf (f,"Descriptor Dump:\n" );for (i =0 ; i < bufsize; i++) -printf ("\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); +fprintf (f,"\tDESC[%d]:0x%x\n" , i, priv->flc_desc[0 ].desc[i]); -printf ("\n" ); +fprintf (f,"\n" ); mbuf_dump: sym_op = op->sym;if (sym_op->m_src) { -printf ("Source mbuf:\n" ); -rte_pktmbuf_dump (stdout, sym_op->m_src, sym_op->m_src->data_len); +fprintf (f,"Source mbuf:\n" ); +rte_pktmbuf_dump (f, sym_op->m_src, sym_op->m_src->data_len); }if (sym_op->m_dst) { -printf ("Destination mbuf:\n" ); -rte_pktmbuf_dump (stdout, sym_op->m_dst, sym_op->m_dst->data_len); +fprintf (f,"Destination mbuf:\n" ); +rte_pktmbuf_dump (f, sym_op->m_dst, sym_op->m_dst->data_len); } -printf ("Session address = %p\ncipher offset: %d, length: %d\n" +fprintf (f,"Session address = %p\ncipher offset: %d, length: %d\n" "auth offset: %d, length: %d\n aead offset: %d, length: %d\n" , sym_op->session, sym_op->cipher.data.offset, sym_op->cipher.data.length, sym_op->auth.data.offset, sym_op->auth.data.length, sym_op->aead.data.offset, sym_op->aead.data.length); -printf ("\n" ); +fprintf (f,"\n" ); }
@@ -1951,7 +1951,7 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,DPAA2_SEC_DP_ERR ("SEC returned Error - %x\n" , fd->simple.frc);if (dpaa2_sec_dp_dump >DPAA2_SEC_DP_ERR_DUMP ) -dpaa2_sec_dump (ops[num_rx]); +dpaa2_sec_dump (ops[num_rx], stdout); } dpaa2_qp->rx_vq.err_pkts +=1 ;
drivers/crypto/dpaa_sec/dpaa_sec.c +31 -31
135 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_flow.c +34 -32
190 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 5 lines · Hemant Agrawal
This patch replaces the printf with related log macros and functions at various places in NXP dpaaX drivers.
Signed-off-by Hemant Agrawal <[email protected]>
Series applied, thanks Hemant.
Signature · 1 line
David Marchand