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 */
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");
}
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);
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);
* 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);
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);
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