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
net/mlx5: fix meter flow direction check
[dpdk.git]
/
examples
/
ptpclient
/
ptpclient.c
diff --git
a/examples/ptpclient/ptpclient.c
b/examples/ptpclient/ptpclient.c
index
a1a7ae6
..
173451e
100644
(file)
--- a/
examples/ptpclient/ptpclient.c
+++ b/
examples/ptpclient/ptpclient.c
@@
-62,7
+62,7
@@
struct tstamp {
uint16_t sec_msb;
uint32_t sec_lsb;
uint32_t ns;
uint16_t sec_msb;
uint32_t sec_lsb;
uint32_t ns;
-} __
attribute__((packed))
;
+} __
rte_packed
;
struct clock_id {
uint8_t id[8];
struct clock_id {
uint8_t id[8];
@@
-71,7
+71,7
@@
struct clock_id {
struct port_id {
struct clock_id clock_id;
uint16_t port_number;
struct port_id {
struct clock_id clock_id;
uint16_t port_number;
-} __
attribute__((packed))
;
+} __
rte_packed
;
struct ptp_header {
uint8_t msg_type;
struct ptp_header {
uint8_t msg_type;
@@
-86,30
+86,30
@@
struct ptp_header {
uint16_t seq_id;
uint8_t control;
int8_t log_message_interval;
uint16_t seq_id;
uint8_t control;
int8_t log_message_interval;
-} __
attribute__((packed))
;
+} __
rte_packed
;
struct sync_msg {
struct ptp_header hdr;
struct tstamp origin_tstamp;
struct sync_msg {
struct ptp_header hdr;
struct tstamp origin_tstamp;
-} __
attribute__((packed))
;
+} __
rte_packed
;
struct follow_up_msg {
struct ptp_header hdr;
struct tstamp precise_origin_tstamp;
uint8_t suffix[0];
struct follow_up_msg {
struct ptp_header hdr;
struct tstamp precise_origin_tstamp;
uint8_t suffix[0];
-} __
attribute__((packed))
;
+} __
rte_packed
;
struct delay_req_msg {
struct ptp_header hdr;
struct tstamp origin_tstamp;
struct delay_req_msg {
struct ptp_header hdr;
struct tstamp origin_tstamp;
-} __
attribute__((packed))
;
+} __
rte_packed
;
struct delay_resp_msg {
struct ptp_header hdr;
struct tstamp rx_tstamp;
struct port_id req_port_id;
uint8_t suffix[0];
struct delay_resp_msg {
struct ptp_header hdr;
struct tstamp rx_tstamp;
struct port_id req_port_id;
uint8_t suffix[0];
-} __
attribute__((packed))
;
+} __
rte_packed
;
struct ptp_message {
union {
struct ptp_message {
union {
@@
-118,7
+118,7
@@
struct ptp_message {
struct delay_req_msg delay_req;
struct follow_up_msg follow_up;
struct delay_resp_msg delay_resp;
struct delay_req_msg delay_req;
struct follow_up_msg follow_up;
struct delay_resp_msg delay_resp;
- } __
attribute__((packed))
;
+ } __
rte_packed
;
};
struct ptpv2_data_slave_ordinary {
};
struct ptpv2_data_slave_ordinary {
@@
-197,6
+197,9
@@
port_init(uint16_t port, struct rte_mempool *mbuf_pool)
return retval;
}
return retval;
}
+ if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)
+ port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
+
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@
-372,7
+375,7
@@
parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
}
/*
}
/*
- * Parse the PTP FOLLOWUP message and send DELAY_REQ to the ma
ster
clock.
+ * Parse the PTP FOLLOWUP message and send DELAY_REQ to the ma
in
clock.
*/
static void
parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
*/
static void
parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
@@
-596,17
+599,13
@@
parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) {
* The lcore main. This is the main thread that does the work, reading from an
* input port and writing to an output port.
*/
* The lcore main. This is the main thread that does the work, reading from an
* input port and writing to an output port.
*/
-static __
attribute__((noreturn))
void
+static __
rte_noreturn
void
lcore_main(void)
{
uint16_t portid;
unsigned nb_rx;
struct rte_mbuf *m;
lcore_main(void)
{
uint16_t portid;
unsigned nb_rx;
struct rte_mbuf *m;
- /*
- * Check that the port is on the same NUMA node as the polling thread
- * for best performance.
- */
printf("\nCore %u Waiting for SYNC packets. [Ctrl+C to quit]\n",
rte_lcore_id());
printf("\nCore %u Waiting for SYNC packets. [Ctrl+C to quit]\n",
rte_lcore_id());
@@
-650,10
+649,7
@@
ptp_parse_portmask(const char *portmask)
pm = strtoul(portmask, &end, 16);
if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
pm = strtoul(portmask, &end, 16);
if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
- return -1;
-
- if (pm == 0)
- return -1;
+ return 0;
return pm;
}
return pm;
}
@@
-785,8
+781,11
@@
main(int argc, char *argv[])
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
- /* Call lcore_main on the ma
ster
core only. */
+ /* Call lcore_main on the ma
in
core only. */
lcore_main();
lcore_main();
+ /* clean up the EAL */
+ rte_eal_cleanup();
+
return 0;
}
return 0;
}