Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
b863db00
Commit
b863db00
authored
Jun 09, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: use txtime generated in client.c for etf
parent
7a514843
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
packet-exchange/src/client.c
packet-exchange/src/client.c
+2
-2
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+1
-1
No files found.
packet-exchange/src/client.c
View file @
b863db00
...
...
@@ -122,7 +122,7 @@ static void *packet_sending_thread(void *p) {
clock_gettime
(
CLOCK_MONOTONIC
,
&
next
);
next_txtime
=
next
.
tv_sec
*
NSEC_PER_SEC
+
next
.
tv_nsec
;
// Wait around 1 second
next_txtime
+=
(
1
0
*
NSEC_PER_SEC
/
param
->
interval
)
*
param
->
interval
;
next_txtime
+=
(
1
*
NSEC_PER_SEC
/
param
->
interval
)
*
param
->
interval
;
// Send packet while thread is sleeping
next_txtime
+=
(
param
->
interval
)
/
2
;
...
...
@@ -136,7 +136,7 @@ static void *packet_sending_thread(void *p) {
do_tsn_task
(
param
,
next_txtime
);
add_ns
(
&
next
,
param
->
interval
);
next_txtime
+=
(
param
->
interval
)
/
2
;
next_txtime
+=
(
param
->
interval
);
clock_nanosleep
(
CLOCK_MONOTONIC
,
TIMER_ABSTIME
,
&
next
,
NULL
);
}
...
...
packet-exchange/src/send_packet.c
View file @
b863db00
...
...
@@ -191,7 +191,7 @@ packet_timestamps_t send_udp_packet(int use_etf, int use_timestamps,
cmsg
->
cmsg_level
=
SOL_SOCKET
;
cmsg
->
cmsg_type
=
SCM_TXTIME
;
cmsg
->
cmsg_len
=
CMSG_LEN
(
sizeof
(
uint64_t
));
*
((
uint64_t
*
)
CMSG_DATA
(
cmsg
))
=
get_txtime
()
;
*
((
uint64_t
*
)
CMSG_DATA
(
cmsg
))
=
txtime
;
msg
.
msg_controllen
=
cmsg
->
cmsg_len
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment