X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fieee1588fwd.c;h=9ff817aa68a6cb1b502f02db4e63d637fd7a5f7e;hb=9da077adb34630d388e0ededdd7ce4214d764284;hp=2b7003be4f26b590ff2d60bf6d4aafd923984c39;hpb=538da7a1cad25fbdffe298c8ca76fc4dbd262d1b;p=dpdk.git diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 2b7003be4f..9ff817aa68 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -60,8 +60,8 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index) printf("Port %u RX timestamp registers not valid\n", pi); return; } - printf("Port %u RX timestamp value %lu s %lu ns\n", - pi, timestamp.tv_sec, timestamp.tv_nsec); + printf("Port %u RX timestamp value %ju s %lu ns\n", + pi, (uintmax_t)timestamp.tv_sec, timestamp.tv_nsec); } #define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */ @@ -83,9 +83,9 @@ port_ieee1588_tx_timestamp_check(portid_t pi) pi, MAX_TX_TMST_WAIT_MICROSECS); return; } - printf("Port %u TX timestamp value %lu s %lu ns validated after " + printf("Port %u TX timestamp value %ju s %lu ns validated after " "%u micro-second%s\n", - pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, + pi, (uintmax_t)timestamp.tv_sec, timestamp.tv_nsec, wait_us, (wait_us == 1) ? "" : "s"); } @@ -114,8 +114,8 @@ ieee1588_packet_fwd(struct fwd_stream *fs) eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); eth_type = rte_be_to_cpu_16(eth_hdr->ether_type); - if (! (mb->ol_flags & PKT_RX_IEEE1588_PTP)) { - if (eth_type == ETHER_TYPE_1588) { + if (!(mb->ol_flags & RTE_MBUF_F_RX_IEEE1588_PTP)) { + if (eth_type == RTE_ETHER_TYPE_1588) { printf("Port %u Received PTP packet not filtered" " by hardware\n", fs->rx_port); @@ -128,7 +128,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) rte_pktmbuf_free(mb); return; } - if (eth_type != ETHER_TYPE_1588) { + if (eth_type != RTE_ETHER_TYPE_1588) { printf("Port %u Received NON PTP packet incorrectly" " detected by hardware\n", fs->rx_port); @@ -163,7 +163,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) * Check that the received PTP packet has been timestamped by the * hardware. */ - if (! (mb->ol_flags & PKT_RX_IEEE1588_TMST)) { + if (!(mb->ol_flags & RTE_MBUF_F_RX_IEEE1588_TMST)) { printf("Port %u Received PTP packet not timestamped" " by hardware\n", fs->rx_port); @@ -178,12 +178,12 @@ ieee1588_packet_fwd(struct fwd_stream *fs) port_ieee1588_rx_timestamp_check(fs->rx_port, timesync_index); /* Swap dest and src mac addresses. */ - rte_ether_addr_copy(ð_hdr->d_addr, &addr); - rte_ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr); - rte_ether_addr_copy(&addr, ð_hdr->s_addr); + rte_ether_addr_copy(ð_hdr->dst_addr, &addr); + rte_ether_addr_copy(ð_hdr->src_addr, ð_hdr->dst_addr); + rte_ether_addr_copy(&addr, ð_hdr->src_addr); /* Forward PTP packet with hardware TX timestamp */ - mb->ol_flags |= PKT_TX_IEEE1588_TMST; + mb->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST; fs->tx_packets += 1; if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) { printf("Port %u sent PTP packet dropped\n", fs->rx_port); @@ -198,10 +198,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs) port_ieee1588_tx_timestamp_check(fs->rx_port); } -static void +static int port_ieee1588_fwd_begin(portid_t pi) { rte_eth_timesync_enable(pi); + return 0; } static void