git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
app/crypto-perf: remove cyclecount test type
[dpdk.git]
/
app
/
test-pmd
/
ieee1588fwd.c
diff --git
a/app/test-pmd/ieee1588fwd.c
b/app/test-pmd/ieee1588fwd.c
index
b1a301b
..
51170ee
100644
(file)
--- a/
app/test-pmd/ieee1588fwd.c
+++ b/
app/test-pmd/ieee1588fwd.c
@@
-34,6
+34,7
@@
#include <rte_cycles.h>
#include <rte_ethdev.h>
#include <rte_cycles.h>
#include <rte_ethdev.h>
+#include <rte_flow.h>
#include "testpmd.h"
#include "testpmd.h"
@@
-89,8
+90,8
@@
port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index)
(unsigned) pi);
return;
}
(unsigned) pi);
return;
}
- printf("Port %u RX timestamp value %lu\n",
- (unsigned) pi, timestamp.tv_sec);
+ printf("Port %u RX timestamp value %lu
s %lu ns
\n",
+ (unsigned) pi, timestamp.tv_sec
, timestamp.tv_nsec
);
}
#define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */
}
#define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */
@@
-112,9
+113,9
@@
port_ieee1588_tx_timestamp_check(portid_t pi)
(unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS);
return;
}
(unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS);
return;
}
- printf("Port %u TX timestamp value %lu validated after "
+ printf("Port %u TX timestamp value %lu
s %lu ns
validated after "
"%u micro-second%s\n",
"%u micro-second%s\n",
- (unsigned) pi, timestamp.tv_sec, wait_us,
+ (unsigned) pi, timestamp.tv_sec,
timestamp.tv_nsec,
wait_us,
(wait_us == 1) ? "" : "s");
}
(wait_us == 1) ? "" : "s");
}
@@
-123,6
+124,7
@@
ieee1588_packet_fwd(struct fwd_stream *fs)
{
struct rte_mbuf *mb;
struct ether_hdr *eth_hdr;
{
struct rte_mbuf *mb;
struct ether_hdr *eth_hdr;
+ struct ether_addr addr;
struct ptpv2_msg *ptp_hdr;
uint16_t eth_type;
uint32_t timesync_index;
struct ptpv2_msg *ptp_hdr;
uint16_t eth_type;
uint32_t timesync_index;
@@
-205,6
+207,11
@@
ieee1588_packet_fwd(struct fwd_stream *fs)
/* Read and check the RX timestamp. */
port_ieee1588_rx_timestamp_check(fs->rx_port, timesync_index);
/* Read and check the RX timestamp. */
port_ieee1588_rx_timestamp_check(fs->rx_port, timesync_index);
+ /* Swap dest and src mac addresses. */
+ ether_addr_copy(ð_hdr->d_addr, &addr);
+ ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr);
+ ether_addr_copy(&addr, ð_hdr->s_addr);
+
/* Forward PTP packet with hardware TX timestamp */
mb->ol_flags |= PKT_TX_IEEE1588_TMST;
fs->tx_packets += 1;
/* Forward PTP packet with hardware TX timestamp */
mb->ol_flags |= PKT_TX_IEEE1588_TMST;
fs->tx_packets += 1;