From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Subject: [PATCH v10] examples/ptp: replace terms master and slave
Date: Fri, 14 Jun 2024 08:41:07 -0700 [thread overview]
Message-ID: <20240614154615.65507-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20240205180328.131019-4-stephen@networkplumber.org>
Remove one of the few remaining uses of master/slave.
The IEEE 1588 standard has been updated to remove the use
of master-slave terminology. Change the sample to Use the terms
recommended by IEEE 1588g-2022 amendment.
In place of the term “master”, use the term “timeTransmitter”.
In place of the term “slave”, use the term “timeReceiver”.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
v10 - rebase to current version
doc/guides/nics/bnxt.rst | 8 ++--
doc/guides/sample_app_ug/img/ptpclient.svg | 4 +-
doc/guides/sample_app_ug/intro.rst | 4 +-
doc/guides/sample_app_ug/ptpclient.rst | 29 ++++++------
examples/ptpclient/ptpclient.c | 54 +++++++++++-----------
5 files changed, 51 insertions(+), 48 deletions(-)
diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst
index 6db880d632..8b9fcd2558 100644
--- a/doc/guides/nics/bnxt.rst
+++ b/doc/guides/nics/bnxt.rst
@@ -538,10 +538,12 @@ Time Synchronization
~~~~~~~~~~~~~~~~~~~~
System operators may run a PTP (Precision Time Protocol) client application to
-synchronize the time on the NIC (and optionally, on the system) to a PTP master.
+synchronize the time on the NIC (and optionally, on the system) to a
+PTP timeTransmitter.
-The BNXT PMD supports a PTP client application to communicate with a PTP master
-clock using DPDK IEEE1588 APIs. Note that the PTP client application needs to
+The BNXT PMD supports a PTP client application to communicate with a
+PTP timeTransmitter using DPDK IEEE1588 APIs.
+Note that the PTP client application needs to
run on PF and vector mode needs to be disabled.
.. code-block:: console
diff --git a/doc/guides/sample_app_ug/img/ptpclient.svg b/doc/guides/sample_app_ug/img/ptpclient.svg
index fd78ef839b..41869bc4c9 100644
--- a/doc/guides/sample_app_ug/img/ptpclient.svg
+++ b/doc/guides/sample_app_ug/img/ptpclient.svg
@@ -488,7 +488,7 @@
sodipodi:role="line"
id="tspan7096"
x="38.764343"
- y="590.47479">master</tspan></text>
+ y="590.47479">timeTransmitter</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:47.51625061px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -510,7 +510,7 @@
sodipodi:role="line"
id="tspan7104"
x="271.23392"
- y="593.71478">slave</tspan></text>
+ y="593.71478">timeReceiver</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20.3917141px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#800080;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
diff --git a/doc/guides/sample_app_ug/intro.rst b/doc/guides/sample_app_ug/intro.rst
index e765f1fd6b..5453df5766 100644
--- a/doc/guides/sample_app_ug/intro.rst
+++ b/doc/guides/sample_app_ug/intro.rst
@@ -85,8 +85,8 @@ examples are highlighted below.
* :doc:`Precision Time Protocol (PTP) client<ptpclient>`: The PTP
client is another minimal implementation of a real world application.
In this case the application is a PTP client that communicates with a PTP
- master clock to synchronize time on a Network Interface Card (NIC) using the
- IEEE1588 protocol.
+ timeTransmitter to synchronize time on a Network Interface Card (NIC)
+ using the IEEE1588 protocol.
* :doc:`Quality of Service (QoS) Scheduler<qos_scheduler>`: The QoS
Scheduler application demonstrates the use of DPDK to provide QoS scheduling.
diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst
index d47e942738..242c9628ea 100644
--- a/doc/guides/sample_app_ug/ptpclient.rst
+++ b/doc/guides/sample_app_ug/ptpclient.rst
@@ -5,8 +5,9 @@ PTP Client Sample Application
=============================
The PTP (Precision Time Protocol) client sample application is a simple
-example of using the DPDK IEEE1588 API to communicate with a PTP master clock
-to synchronize the time on the NIC and, optionally, on the Linux system.
+example of using the DPDK IEEE1588 API to communicate with a PTP
+timeTransmitter to synchronize the time on the NIC and, optionally,
+on the Linux system.
Note, PTP is a time syncing protocol and cannot be used within DPDK as a
time-stamping mechanism. See the following for an explanation of the protocol:
@@ -21,10 +22,10 @@ The PTP sample application is intended as a simple reference implementation of
a PTP client using the DPDK IEEE1588 API.
In order to keep the application simple the following assumptions are made:
-* The first discovered master is the main for the session.
+* The first discovered timeTransmitter is the main for the session.
* Only L2 PTP packets are supported.
* Only the PTP v2 protocol is supported.
-* Only the slave clock is implemented.
+* Only the timeReceiver clock is implemented.
How the Application Works
@@ -38,12 +39,12 @@ How the Application Works
The PTP synchronization in the sample application works as follows:
-* Master sends *Sync* message - the slave saves it as T2.
-* Master sends *Follow Up* message and sends time of T1.
-* Slave sends *Delay Request* frame to PTP Master and stores T3.
-* Master sends *Delay Response* T4 time which is time of received T3.
+* TimeTransmitter sends *Sync* message - the TimeReceiver saves it as T2.
+* TimeTransmitter sends *Follow Up* message and sends time of T1.
+* TimeReceiver sends *Delay Request* frame to PTP TimeTransmitter and stores T3.
+* TimeTransmitter sends *Delay Response* T4 time which is time of received T3.
-The adjustment for slave can be represented as:
+The adjustment for timeReceiver can be represented as:
adj = -[(T2-T1)-(T4 - T3)]/2
@@ -71,8 +72,8 @@ Refer to *DPDK Getting Started Guide* for general information on running
applications and the Environment Abstraction Layer (EAL) options.
* ``-p portmask``: Hexadecimal portmask.
-* ``-T 0``: Update only the PTP slave clock.
-* ``-T 1``: Update the PTP slave clock and synchronize the Linux Kernel to the PTP clock.
+* ``-T 0``: Update only the PTP timeReceiver clock.
+* ``-T 1``: Update the PTP timeReceiver clock and synchronize the Linux Kernel to the PTP clock.
Code Explanation
@@ -178,7 +179,7 @@ The forwarding loop can be interrupted and the application closed using
PTP parsing
~~~~~~~~~~~
-The ``parse_ptp_frames()`` function processes PTP packets, implementing slave
+The ``parse_ptp_frames()`` function processes PTP packets, implementing timeReceiver
PTP IEEE1588 L2 functionality.
.. literalinclude:: ../../../examples/ptpclient/ptpclient.c
@@ -187,11 +188,11 @@ PTP IEEE1588 L2 functionality.
:end-before: >8 End of function processes PTP packets.
There are 3 types of packets on the RX path which we must parse to create a minimal
-implementation of the PTP slave client:
+implementation of the PTP timeReceiver client:
* SYNC packet.
* FOLLOW UP packet
* DELAY RESPONSE packet.
When we parse the *FOLLOW UP* packet we also create and send a *DELAY_REQUEST* packet.
-Also when we parse the *DELAY RESPONSE* packet, and all conditions are met we adjust the PTP slave clock.
+Also when we parse the *DELAY RESPONSE* packet, and all conditions are met we adjust the PTP timeReceiver clock.
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index afb61bba51..889a8c075b 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -119,14 +119,14 @@ struct ptp_message {
} __rte_packed;
};
-struct ptpv2_data_slave_ordinary {
+struct ptpv2_timeReceiver_ordinary {
struct rte_mbuf *m;
struct timespec tstamp1;
struct timespec tstamp2;
struct timespec tstamp3;
struct timespec tstamp4;
struct clock_id client_clock_id;
- struct clock_id master_clock_id;
+ struct clock_id transmitter_clock_id;
struct timeval new_adj;
int64_t delta;
uint16_t portid;
@@ -137,7 +137,7 @@ struct ptpv2_data_slave_ordinary {
uint16_t current_ptp_port;
};
-static struct ptpv2_data_slave_ordinary ptp_data;
+static struct ptpv2_timeReceiver_ordinary ptp_data;
static inline uint64_t timespec64_to_ns(const struct timespec *ts)
{
@@ -266,38 +266,38 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
}
static void
-print_clock_info(struct ptpv2_data_slave_ordinary *ptp_data)
+print_clock_info(struct ptpv2_timeReceiver_ordinary *ptp_data)
{
int64_t nsec;
struct timespec net_time, sys_time;
- printf("Master Clock id: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
- ptp_data->master_clock_id.id[0],
- ptp_data->master_clock_id.id[1],
- ptp_data->master_clock_id.id[2],
- ptp_data->master_clock_id.id[3],
- ptp_data->master_clock_id.id[4],
- ptp_data->master_clock_id.id[5],
- ptp_data->master_clock_id.id[6],
- ptp_data->master_clock_id.id[7]);
-
- printf("\nT2 - Slave Clock. %lds %ldns",
+ printf("TimeTransmitter Clock id: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
+ ptp_data->transmitter_clock_id.id[0],
+ ptp_data->transmitter_clock_id.id[1],
+ ptp_data->transmitter_clock_id.id[2],
+ ptp_data->transmitter_clock_id.id[3],
+ ptp_data->transmitter_clock_id.id[4],
+ ptp_data->transmitter_clock_id.id[5],
+ ptp_data->transmitter_clock_id.id[6],
+ ptp_data->transmitter_clock_id.id[7]);
+
+ printf("\nT2 - TimeReceiver Clock. %lds %ldns",
(ptp_data->tstamp2.tv_sec),
(ptp_data->tstamp2.tv_nsec));
- printf("\nT1 - Master Clock. %lds %ldns ",
+ printf("\nT1 - TimeTransmitter Clock. %lds %ldns ",
ptp_data->tstamp1.tv_sec,
(ptp_data->tstamp1.tv_nsec));
- printf("\nT3 - Slave Clock. %lds %ldns",
+ printf("\nT3 - TimeReceiver Clock. %lds %ldns",
ptp_data->tstamp3.tv_sec,
(ptp_data->tstamp3.tv_nsec));
- printf("\nT4 - Master Clock. %lds %ldns ",
+ printf("\nT4 - TimeTransmitter Clock. %lds %ldns ",
ptp_data->tstamp4.tv_sec,
(ptp_data->tstamp4.tv_nsec));
- printf("\nDelta between master and slave clocks:%"PRId64"ns\n",
+ printf("\nDelta between timeTransmitter and timeReceiver clocks:%"PRId64"ns\n",
ptp_data->delta);
clock_gettime(CLOCK_REALTIME, &sys_time);
@@ -331,7 +331,7 @@ print_clock_info(struct ptpv2_data_slave_ordinary *ptp_data)
}
static int64_t
-delta_eval(struct ptpv2_data_slave_ordinary *ptp_data)
+delta_eval(struct ptpv2_timeReceiver_ordinary *ptp_data)
{
int64_t delta;
uint64_t t1 = 0;
@@ -353,7 +353,7 @@ delta_eval(struct ptpv2_data_slave_ordinary *ptp_data)
* Parse the PTP SYNC message.
*/
static void
-parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
+parse_sync(struct ptpv2_timeReceiver_ordinary *ptp_data, uint16_t rx_tstamp_idx)
{
struct ptp_header *ptp_hdr;
@@ -362,7 +362,7 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id);
if (ptp_data->ptpset == 0) {
- rte_memcpy(&ptp_data->master_clock_id,
+ rte_memcpy(&ptp_data->transmitter_clock_id,
&ptp_hdr->source_port_id.clock_id,
sizeof(struct clock_id));
ptp_data->ptpset = 1;
@@ -383,7 +383,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 main clock.
*/
static void
-parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
+parse_fup(struct ptpv2_timeReceiver_ordinary *ptp_data)
{
struct rte_ether_hdr *eth_hdr;
struct rte_ether_addr eth_addr;
@@ -402,7 +402,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ptp_hdr = rte_pktmbuf_mtod_offset(m, struct ptp_header *,
sizeof(struct rte_ether_hdr));
- if (memcmp(&ptp_data->master_clock_id,
+ if (memcmp(&ptp_data->transmitter_clock_id,
&ptp_hdr->source_port_id.clock_id,
sizeof(struct clock_id)) != 0)
return;
@@ -533,7 +533,7 @@ update_kernel_time(void)
* Parse the DELAY_RESP message.
*/
static void
-parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data)
+parse_drsp(struct ptpv2_timeReceiver_ordinary *ptp_data)
{
struct rte_mbuf *m = ptp_data->m;
struct ptp_message *ptp_msg;
@@ -571,7 +571,7 @@ parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data)
}
}
-/* This function processes PTP packets, implementing slave PTP IEEE1588 L2
+/* This function processes PTP packets, implementing timeReceiver PTP IEEE1588 L2
* functionality.
*/
@@ -763,7 +763,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Error with EAL initialization\n");
/* >8 End of initialization of EAL. */
- memset(&ptp_data, '\0', sizeof(struct ptpv2_data_slave_ordinary));
+ memset(&ptp_data, 0, sizeof(struct ptpv2_timeReceiver_ordinary));
/* Parse specific arguments. 8< */
argc -= ret;
--
2.43.0
next prev parent reply other threads:[~2024-06-14 15:46 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0230331200824.195294-1-stephen@networkplumber.org>
2023-04-05 23:29 ` [PATCH v3] devtools: add script to check for non inclusive naming Stephen Hemminger
2023-08-17 14:58 ` Stephen Hemminger
2023-04-19 15:00 ` [PATCH] " Stephen Hemminger
2023-10-30 21:33 ` [PATCH v4] " Stephen Hemminger
2023-10-30 22:17 ` [PATCH v5] " Stephen Hemminger
2023-10-30 22:22 ` [PATCH v6] " Stephen Hemminger
2023-10-30 22:32 ` [PATCH v7] " Stephen Hemminger
2023-11-02 20:57 ` [PATCH v8] " Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 00/23] Use inclusive naming in DPDK Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 01/23] devtools: add script to check for non inclusive naming Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 02/23] test: replace use of term segregate Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 03/23] examples/ptp: replace terms master and slave Stephen Hemminger
2024-06-14 15:41 ` Stephen Hemminger [this message]
2024-02-05 17:43 ` [PATCH v9 04/23] test: remove use of word master in test_red Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 05/23] mbuf: replace term sanity check Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 06/23] eal: replace use of sanity check in comments and messages Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 07/23] test: replace use word sanity Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 08/23] examples: remove term sanity Stephen Hemminger
2024-02-06 10:05 ` [EXT] " Akhil Goyal
2024-02-05 17:43 ` [PATCH v9 09/23] lib: replace use of sanity check in comments and messages Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 10/23] doc/eventdev_pipeline: remove sanity Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 11/23] net/ring: replace use of sanity Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 12/23] net/fm10k, net/ixgbe: remove word sanity Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 13/23] net/mlx[45]: " Stephen Hemminger
2024-02-05 19:22 ` Dariusz Sosnowski
2024-02-05 17:43 ` [PATCH v9 14/23] net/sfc: remove term "sanity check" Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 15/23] net/ark: replace use of term sanity Stephen Hemminger
2024-02-05 21:12 ` Ed Czeck
2024-02-05 17:43 ` [PATCH v9 16/23] net/bnxt: " Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 17/23] net/bnx2x: remove reference to sanity Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 18/23] cnxk: replace term sanity Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 19/23] event/opdl: remove " Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 20/23] net/txgbe: replace " Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 21/23] net/cxgbe: remove use of " Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 22/23] crypto/bcmfs: replace term sanity check Stephen Hemminger
2024-02-05 17:43 ` [PATCH v9 23/23] drivers: remove use of " Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240614154615.65507-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=kirill.rybalchenko@intel.com \
--cc=somnath.kotur@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).