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
ba1c0eea
Commit
ba1c0eea
authored
May 20, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SO_TXTIME socket configuration issue, and disable Werror
parent
97a93f13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
packet-exchange/build/Makefile
packet-exchange/build/Makefile
+1
-1
packet-exchange/src/client.c
packet-exchange/src/client.c
+2
-2
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+4
-3
No files found.
packet-exchange/build/Makefile
View file @
ba1c0eea
...
@@ -12,7 +12,7 @@ CLIENT_SRCS += send_packet.c
...
@@ -12,7 +12,7 @@ CLIENT_SRCS += send_packet.c
SERVER_OBJS
=
$(SERVER_SRCS:%.c=%.o)
SERVER_OBJS
=
$(SERVER_SRCS:%.c=%.o)
CLIENT_OBJS
=
$(CLIENT_SRCS:%.c=%.o)
CLIENT_OBJS
=
$(CLIENT_SRCS:%.c=%.o)
CFLAGS
=
-Og
-g
-Wall
-We
rror
-We
xtra
CFLAGS
=
-Og
-g
-Wall
-Wextra
CFLAGS
+=
-MD
-MP
CFLAGS
+=
-MD
-MP
CFLAGS
+=
-I
$(SRCDIR)
CFLAGS
+=
-I
$(SRCDIR)
CFLAGS
+=
-std
=
gnu99
CFLAGS
+=
-std
=
gnu99
...
...
packet-exchange/src/client.c
View file @
ba1c0eea
...
@@ -81,7 +81,7 @@ static void *packet_sending_thread(void *p) {
...
@@ -81,7 +81,7 @@ static void *packet_sending_thread(void *p) {
clock_gettime
(
CLOCK_ID
,
&
next
);
clock_gettime
(
CLOCK_ID
,
&
next
);
next_txtime
=
next
.
tv_sec
*
NSEC_PER_SEC
+
next
.
tv_nsec
;
next_txtime
=
next
.
tv_sec
*
NSEC_PER_SEC
+
next
.
tv_nsec
;
// Wait around 1 second
// Wait around 1 second
next_txtime
+=
(
NSEC_PER_SEC
/
param
->
interval
)
*
param
->
interval
;
next_txtime
+=
(
10
*
NSEC_PER_SEC
/
param
->
interval
)
*
param
->
interval
;
// Send packet while thread is sleeping
// Send packet while thread is sleeping
next_txtime
+=
(
param
->
interval
)
/
2
;
next_txtime
+=
(
param
->
interval
)
/
2
;
...
@@ -120,7 +120,7 @@ int main(int argc, char *argv[]) {
...
@@ -120,7 +120,7 @@ int main(int argc, char *argv[]) {
// Process bash options
// Process bash options
process_options
(
argc
,
argv
,
&
param
,
&
main_param
);
process_options
(
argc
,
argv
,
&
param
,
&
main_param
);
init_udp_etf
(
param
.
enable_
affinity
,
param
.
network_if
);
init_udp_etf
(
param
.
enable_
etf
,
param
.
network_if
);
usleep
(
10000
);
usleep
(
10000
);
...
...
packet-exchange/src/send_packet.c
View file @
ba1c0eea
...
@@ -133,7 +133,7 @@ void init_udp_etf(int use_etf, char *network_if) {
...
@@ -133,7 +133,7 @@ void init_udp_etf(int use_etf, char *network_if) {
if
(
use_etf
)
{
if
(
use_etf
)
{
sk_txtime
.
clockid
=
CLOCK_ID
;
sk_txtime
.
clockid
=
CLOCK_ID
;
sk_txtime
.
flags
=
0
;
sk_txtime
.
flags
=
1
;
// sk_txtime.flags = SOF_TXTIME_REPORT_ERRORS;
// sk_txtime.flags = SOF_TXTIME_REPORT_ERRORS;
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_TXTIME
,
&
sk_txtime
,
sizeof
(
sk_txtime
)))
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_TXTIME
,
&
sk_txtime
,
sizeof
(
sk_txtime
)))
...
@@ -174,8 +174,9 @@ void send_udp_packet_etf(int use_etf, uint64_t txtime, const char *server_ip) {
...
@@ -174,8 +174,9 @@ void send_udp_packet_etf(int use_etf, uint64_t txtime, const char *server_ip) {
cmsg
=
CMSG_FIRSTHDR
(
&
msg
);
cmsg
=
CMSG_FIRSTHDR
(
&
msg
);
cmsg
->
cmsg_level
=
SOL_SOCKET
;
cmsg
->
cmsg_level
=
SOL_SOCKET
;
cmsg
->
cmsg_type
=
SCM_TXTIME
;
cmsg
->
cmsg_type
=
SCM_TXTIME
;
cmsg
->
cmsg_len
=
CMSG_LEN
(
sizeof
(
__u64
));
cmsg
->
cmsg_len
=
CMSG_LEN
(
sizeof
(
uint64_t
));
*
((
__u64
*
)
CMSG_DATA
(
cmsg
))
=
txtime
;
*
((
uint64_t
*
)
CMSG_DATA
(
cmsg
))
=
txtime
;
msg
.
msg_controllen
=
cmsg
->
cmsg_len
;
}
}
sendmsgerr
=
sendmsg
(
fd
,
&
msg
,
0
);
sendmsgerr
=
sendmsg
(
fd
,
&
msg
,
0
);
...
...
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