From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id B7163C320 for ; Mon, 18 May 2015 10:18:14 +0200 (CEST) Received: by wguv19 with SMTP id v19so117474557wgu.1 for ; Mon, 18 May 2015 01:18:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OV2YTQojYZ6dowDQ59fX1IQkzdwx6CVLblD1aS7vk1c=; b=cOWdypbMze0zEtWnhcVEDQZmEqI44EQL+hBnTSxrIlZ7vgkpcPZSqERSlPMzmdxCqI 0EPaOcAzMepL6Z+n8HM5i6vQA1Sr2FIilAP/uMx9AsXVHftJBteTKoxwu2/NlAe3BZKp pjuButf0m70nse47cp+cG+j3nTgizUlbffAu2AmDlKzMhn6CrVqNl24RR7TIeAm/Y+b5 jgYJ2DKQ94aNaUJ1FDEeEGYIpLvZbqSRFcxvQ2tYoF9GT/xQ2pgdLgg3csf/SjXEPiZu 1TCWbMeO9WZ8O8IxHVqYqnUv2NAcdMS8KIXqERyFSOwIjwq1aot/a1H1OdUE+VCTeIiG pp7Q== X-Gm-Message-State: ALoCoQnhPDUieVxut5ZBqlbtWawy1kVVXoFj9iKVCK+PeVTpG32WVIgctQuxWODQ94T/+GMiy4Zn X-Received: by 10.181.13.198 with SMTP id fa6mr19985737wid.41.1431937094627; Mon, 18 May 2015 01:18:14 -0700 (PDT) Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id ck16sm7664735wjb.37.2015.05.18.01.18.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 May 2015 01:18:14 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Date: Mon, 18 May 2015 10:18:00 +0200 Message-Id: <1431937081-20083-4-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431937081-20083-1-git-send-email-olivier.matz@6wind.com> References: <1431937081-20083-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH 3/4] pmds: fix 32 bits compilation with debug enabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2015 08:18:15 -0000 When debug is enabled for 32 bits targets, it triggers some format errors that are not visible in 64 bits. Fix them by using the proper format from inttypes.h or the proper cast. Signed-off-by: Olivier Matz --- lib/librte_pmd_fm10k/fm10k_rxtx.c | 5 +- lib/librte_pmd_i40e/i40e_ethdev.c | 124 +++++++++++++++++----------------- lib/librte_pmd_i40e/i40e_rxtx.c | 2 +- lib/librte_pmd_virtio/virtio_ethdev.c | 2 +- 4 files changed, 68 insertions(+), 65 deletions(-) diff --git a/lib/librte_pmd_fm10k/fm10k_rxtx.c b/lib/librte_pmd_fm10k/fm10k_rxtx.c index 83bddfc..56df6cd 100644 --- a/lib/librte_pmd_fm10k/fm10k_rxtx.c +++ b/lib/librte_pmd_fm10k/fm10k_rxtx.c @@ -30,6 +30,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#include + #include #include #include "fm10k.h" @@ -57,7 +60,7 @@ static inline void dump_rxd(union fm10k_rx_desc *rxd) PMD_RX_LOG(DEBUG, "| 0x%08x | 0x%08x |", 0, rxd->d.rss); PMD_RX_LOG(DEBUG, "+----------------|----------------+"); PMD_RX_LOG(DEBUG, "| TIME TAG |"); - PMD_RX_LOG(DEBUG, "| 0x%016lx |", rxd->q.timestamp); + PMD_RX_LOG(DEBUG, "| 0x%016"PRIx64" |", rxd->q.timestamp); PMD_RX_LOG(DEBUG, "+----------------|----------------+"); } #endif diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index 96700e4..ece88d9 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -1200,19 +1200,19 @@ i40e_update_vsi_stats(struct i40e_vsi *vsi) PMD_DRV_LOG(DEBUG, "***************** VSI[%u] stats start *******************", vsi->vsi_id); - PMD_DRV_LOG(DEBUG, "rx_bytes: %lu", nes->rx_bytes); - PMD_DRV_LOG(DEBUG, "rx_unicast: %lu", nes->rx_unicast); - PMD_DRV_LOG(DEBUG, "rx_multicast: %lu", nes->rx_multicast); - PMD_DRV_LOG(DEBUG, "rx_broadcast: %lu", nes->rx_broadcast); - PMD_DRV_LOG(DEBUG, "rx_discards: %lu", nes->rx_discards); - PMD_DRV_LOG(DEBUG, "rx_unknown_protocol: %lu", + PMD_DRV_LOG(DEBUG, "rx_bytes: %"PRIu64"", nes->rx_bytes); + PMD_DRV_LOG(DEBUG, "rx_unicast: %"PRIu64"", nes->rx_unicast); + PMD_DRV_LOG(DEBUG, "rx_multicast: %"PRIu64"", nes->rx_multicast); + PMD_DRV_LOG(DEBUG, "rx_broadcast: %"PRIu64"", nes->rx_broadcast); + PMD_DRV_LOG(DEBUG, "rx_discards: %"PRIu64"", nes->rx_discards); + PMD_DRV_LOG(DEBUG, "rx_unknown_protocol: %"PRIu64"", nes->rx_unknown_protocol); - PMD_DRV_LOG(DEBUG, "tx_bytes: %lu", nes->tx_bytes); - PMD_DRV_LOG(DEBUG, "tx_unicast: %lu", nes->tx_unicast); - PMD_DRV_LOG(DEBUG, "tx_multicast: %lu", nes->tx_multicast); - PMD_DRV_LOG(DEBUG, "tx_broadcast: %lu", nes->tx_broadcast); - PMD_DRV_LOG(DEBUG, "tx_discards: %lu", nes->tx_discards); - PMD_DRV_LOG(DEBUG, "tx_errors: %lu", nes->tx_errors); + PMD_DRV_LOG(DEBUG, "tx_bytes: %"PRIu64"", nes->tx_bytes); + PMD_DRV_LOG(DEBUG, "tx_unicast: %"PRIu64"", nes->tx_unicast); + PMD_DRV_LOG(DEBUG, "tx_multicast: %"PRIu64"", nes->tx_multicast); + PMD_DRV_LOG(DEBUG, "tx_broadcast: %"PRIu64"", nes->tx_broadcast); + PMD_DRV_LOG(DEBUG, "tx_discards: %"PRIu64"", nes->tx_discards); + PMD_DRV_LOG(DEBUG, "tx_errors: %"PRIu64"", nes->tx_errors); PMD_DRV_LOG(DEBUG, "***************** VSI[%u] stats end *******************", vsi->vsi_id); } @@ -1424,73 +1424,73 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->ierrors = stats->ibadcrc + stats->ibadlen + stats->imissed; PMD_DRV_LOG(DEBUG, "***************** PF stats start *******************"); - PMD_DRV_LOG(DEBUG, "rx_bytes: %lu", ns->eth.rx_bytes); - PMD_DRV_LOG(DEBUG, "rx_unicast: %lu", ns->eth.rx_unicast); - PMD_DRV_LOG(DEBUG, "rx_multicast: %lu", ns->eth.rx_multicast); - PMD_DRV_LOG(DEBUG, "rx_broadcast: %lu", ns->eth.rx_broadcast); - PMD_DRV_LOG(DEBUG, "rx_discards: %lu", ns->eth.rx_discards); - PMD_DRV_LOG(DEBUG, "rx_unknown_protocol: %lu", + PMD_DRV_LOG(DEBUG, "rx_bytes: %"PRIu64"", ns->eth.rx_bytes); + PMD_DRV_LOG(DEBUG, "rx_unicast: %"PRIu64"", ns->eth.rx_unicast); + PMD_DRV_LOG(DEBUG, "rx_multicast: %"PRIu64"", ns->eth.rx_multicast); + PMD_DRV_LOG(DEBUG, "rx_broadcast: %"PRIu64"", ns->eth.rx_broadcast); + PMD_DRV_LOG(DEBUG, "rx_discards: %"PRIu64"", ns->eth.rx_discards); + PMD_DRV_LOG(DEBUG, "rx_unknown_protocol: %"PRIu64"", ns->eth.rx_unknown_protocol); - PMD_DRV_LOG(DEBUG, "tx_bytes: %lu", ns->eth.tx_bytes); - PMD_DRV_LOG(DEBUG, "tx_unicast: %lu", ns->eth.tx_unicast); - PMD_DRV_LOG(DEBUG, "tx_multicast: %lu", ns->eth.tx_multicast); - PMD_DRV_LOG(DEBUG, "tx_broadcast: %lu", ns->eth.tx_broadcast); - PMD_DRV_LOG(DEBUG, "tx_discards: %lu", ns->eth.tx_discards); - PMD_DRV_LOG(DEBUG, "tx_errors: %lu", ns->eth.tx_errors); - - PMD_DRV_LOG(DEBUG, "tx_dropped_link_down: %lu", + PMD_DRV_LOG(DEBUG, "tx_bytes: %"PRIu64"", ns->eth.tx_bytes); + PMD_DRV_LOG(DEBUG, "tx_unicast: %"PRIu64"", ns->eth.tx_unicast); + PMD_DRV_LOG(DEBUG, "tx_multicast: %"PRIu64"", ns->eth.tx_multicast); + PMD_DRV_LOG(DEBUG, "tx_broadcast: %"PRIu64"", ns->eth.tx_broadcast); + PMD_DRV_LOG(DEBUG, "tx_discards: %"PRIu64"", ns->eth.tx_discards); + PMD_DRV_LOG(DEBUG, "tx_errors: %"PRIu64"", ns->eth.tx_errors); + + PMD_DRV_LOG(DEBUG, "tx_dropped_link_down: %"PRIu64"", ns->tx_dropped_link_down); - PMD_DRV_LOG(DEBUG, "crc_errors: %lu", ns->crc_errors); - PMD_DRV_LOG(DEBUG, "illegal_bytes: %lu", + PMD_DRV_LOG(DEBUG, "crc_errors: %"PRIu64"", ns->crc_errors); + PMD_DRV_LOG(DEBUG, "illegal_bytes: %"PRIu64"", ns->illegal_bytes); - PMD_DRV_LOG(DEBUG, "error_bytes: %lu", ns->error_bytes); - PMD_DRV_LOG(DEBUG, "mac_local_faults: %lu", + PMD_DRV_LOG(DEBUG, "error_bytes: %"PRIu64"", ns->error_bytes); + PMD_DRV_LOG(DEBUG, "mac_local_faults: %"PRIu64"", ns->mac_local_faults); - PMD_DRV_LOG(DEBUG, "mac_remote_faults: %lu", + PMD_DRV_LOG(DEBUG, "mac_remote_faults: %"PRIu64"", ns->mac_remote_faults); - PMD_DRV_LOG(DEBUG, "rx_length_errors: %lu", + PMD_DRV_LOG(DEBUG, "rx_length_errors: %"PRIu64"", ns->rx_length_errors); - PMD_DRV_LOG(DEBUG, "link_xon_rx: %lu", ns->link_xon_rx); - PMD_DRV_LOG(DEBUG, "link_xoff_rx: %lu", ns->link_xoff_rx); + PMD_DRV_LOG(DEBUG, "link_xon_rx: %"PRIu64"", ns->link_xon_rx); + PMD_DRV_LOG(DEBUG, "link_xoff_rx: %"PRIu64"", ns->link_xoff_rx); for (i = 0; i < 8; i++) { - PMD_DRV_LOG(DEBUG, "priority_xon_rx[%d]: %lu", + PMD_DRV_LOG(DEBUG, "priority_xon_rx[%d]: %"PRIu64"", i, ns->priority_xon_rx[i]); - PMD_DRV_LOG(DEBUG, "priority_xoff_rx[%d]: %lu", + PMD_DRV_LOG(DEBUG, "priority_xoff_rx[%d]: %"PRIu64"", i, ns->priority_xoff_rx[i]); } - PMD_DRV_LOG(DEBUG, "link_xon_tx: %lu", ns->link_xon_tx); - PMD_DRV_LOG(DEBUG, "link_xoff_tx: %lu", ns->link_xoff_tx); + PMD_DRV_LOG(DEBUG, "link_xon_tx: %"PRIu64"", ns->link_xon_tx); + PMD_DRV_LOG(DEBUG, "link_xoff_tx: %"PRIu64"", ns->link_xoff_tx); for (i = 0; i < 8; i++) { - PMD_DRV_LOG(DEBUG, "priority_xon_tx[%d]: %lu", + PMD_DRV_LOG(DEBUG, "priority_xon_tx[%d]: %"PRIu64"", i, ns->priority_xon_tx[i]); - PMD_DRV_LOG(DEBUG, "priority_xoff_tx[%d]: %lu", + PMD_DRV_LOG(DEBUG, "priority_xoff_tx[%d]: %"PRIu64"", i, ns->priority_xoff_tx[i]); - PMD_DRV_LOG(DEBUG, "priority_xon_2_xoff[%d]: %lu", + PMD_DRV_LOG(DEBUG, "priority_xon_2_xoff[%d]: %"PRIu64"", i, ns->priority_xon_2_xoff[i]); } - PMD_DRV_LOG(DEBUG, "rx_size_64: %lu", ns->rx_size_64); - PMD_DRV_LOG(DEBUG, "rx_size_127: %lu", ns->rx_size_127); - PMD_DRV_LOG(DEBUG, "rx_size_255: %lu", ns->rx_size_255); - PMD_DRV_LOG(DEBUG, "rx_size_511: %lu", ns->rx_size_511); - PMD_DRV_LOG(DEBUG, "rx_size_1023: %lu", ns->rx_size_1023); - PMD_DRV_LOG(DEBUG, "rx_size_1522: %lu", ns->rx_size_1522); - PMD_DRV_LOG(DEBUG, "rx_size_big: %lu", ns->rx_size_big); - PMD_DRV_LOG(DEBUG, "rx_undersize: %lu", ns->rx_undersize); - PMD_DRV_LOG(DEBUG, "rx_fragments: %lu", ns->rx_fragments); - PMD_DRV_LOG(DEBUG, "rx_oversize: %lu", ns->rx_oversize); - PMD_DRV_LOG(DEBUG, "rx_jabber: %lu", ns->rx_jabber); - PMD_DRV_LOG(DEBUG, "tx_size_64: %lu", ns->tx_size_64); - PMD_DRV_LOG(DEBUG, "tx_size_127: %lu", ns->tx_size_127); - PMD_DRV_LOG(DEBUG, "tx_size_255: %lu", ns->tx_size_255); - PMD_DRV_LOG(DEBUG, "tx_size_511: %lu", ns->tx_size_511); - PMD_DRV_LOG(DEBUG, "tx_size_1023: %lu", ns->tx_size_1023); - PMD_DRV_LOG(DEBUG, "tx_size_1522: %lu", ns->tx_size_1522); - PMD_DRV_LOG(DEBUG, "tx_size_big: %lu", ns->tx_size_big); - PMD_DRV_LOG(DEBUG, "mac_short_packet_dropped: %lu", + PMD_DRV_LOG(DEBUG, "rx_size_64: %"PRIu64"", ns->rx_size_64); + PMD_DRV_LOG(DEBUG, "rx_size_127: %"PRIu64"", ns->rx_size_127); + PMD_DRV_LOG(DEBUG, "rx_size_255: %"PRIu64"", ns->rx_size_255); + PMD_DRV_LOG(DEBUG, "rx_size_511: %"PRIu64"", ns->rx_size_511); + PMD_DRV_LOG(DEBUG, "rx_size_1023: %"PRIu64"", ns->rx_size_1023); + PMD_DRV_LOG(DEBUG, "rx_size_1522: %"PRIu64"", ns->rx_size_1522); + PMD_DRV_LOG(DEBUG, "rx_size_big: %"PRIu64"", ns->rx_size_big); + PMD_DRV_LOG(DEBUG, "rx_undersize: %"PRIu64"", ns->rx_undersize); + PMD_DRV_LOG(DEBUG, "rx_fragments: %"PRIu64"", ns->rx_fragments); + PMD_DRV_LOG(DEBUG, "rx_oversize: %"PRIu64"", ns->rx_oversize); + PMD_DRV_LOG(DEBUG, "rx_jabber: %"PRIu64"", ns->rx_jabber); + PMD_DRV_LOG(DEBUG, "tx_size_64: %"PRIu64"", ns->tx_size_64); + PMD_DRV_LOG(DEBUG, "tx_size_127: %"PRIu64"", ns->tx_size_127); + PMD_DRV_LOG(DEBUG, "tx_size_255: %"PRIu64"", ns->tx_size_255); + PMD_DRV_LOG(DEBUG, "tx_size_511: %"PRIu64"", ns->tx_size_511); + PMD_DRV_LOG(DEBUG, "tx_size_1023: %"PRIu64"", ns->tx_size_1023); + PMD_DRV_LOG(DEBUG, "tx_size_1522: %"PRIu64"", ns->tx_size_1522); + PMD_DRV_LOG(DEBUG, "tx_size_big: %"PRIu64"", ns->tx_size_big); + PMD_DRV_LOG(DEBUG, "mac_short_packet_dropped: %"PRIu64"", ns->mac_short_packet_dropped); - PMD_DRV_LOG(DEBUG, "checksum_error: %lu", + PMD_DRV_LOG(DEBUG, "checksum_error: %"PRIu64"", ns->checksum_error); - PMD_DRV_LOG(DEBUG, "fdir_match: %lu", ns->fd_sb_match); + PMD_DRV_LOG(DEBUG, "fdir_match: %"PRIu64"", ns->fd_sb_match); PMD_DRV_LOG(DEBUG, "***************** PF stats end ********************"); } diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c index cb6040a..453f98f 100644 --- a/lib/librte_pmd_i40e/i40e_rxtx.c +++ b/lib/librte_pmd_i40e/i40e_rxtx.c @@ -1348,7 +1348,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) "tunneling_params: %#x;\n" "l2tag2: %#hx;\n" "rsvd: %#hx;\n" - "type_cmd_tso_mss: %#lx;\n", + "type_cmd_tso_mss: %#"PRIx64";\n", tx_pkt, tx_id, ctx_txd->tunneling_params, ctx_txd->l2tag2, diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c index e63dbfb..f74e413 100644 --- a/lib/librte_pmd_virtio/virtio_ethdev.c +++ b/lib/librte_pmd_virtio/virtio_ethdev.c @@ -336,7 +336,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev, vq->vq_ring_mem = mz->phys_addr; vq->vq_ring_virt_mem = mz->addr; PMD_INIT_LOG(DEBUG, "vq->vq_ring_mem: 0x%"PRIx64, (uint64_t)mz->phys_addr); - PMD_INIT_LOG(DEBUG, "vq->vq_ring_virt_mem: 0x%"PRIx64, (uint64_t)mz->addr); + PMD_INIT_LOG(DEBUG, "vq->vq_ring_virt_mem: 0x%"PRIx64, (uint64_t)(uintptr_t)mz->addr); vq->virtio_net_hdr_mz = NULL; vq->virtio_net_hdr_mem = 0; -- 2.1.4