Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
137d56d3
Commit
137d56d3
authored
Jan 30, 2015
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging of timing loss when high load of background traffic
parent
b85b5490
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
4 deletions
+25
-4
Makefile
kernel/wr_nic/Makefile
+2
-2
nic-core.c
kernel/wr_nic/nic-core.c
+18
-0
timestamp.c
kernel/wr_nic/timestamp.c
+4
-1
ppsi
userspace/ppsi
+1
-1
No files found.
kernel/wr_nic/Makefile
View file @
137d56d3
...
...
@@ -4,9 +4,9 @@ wr-nic-objs := module.o device.o nic-core.o endpoint.o ethtool.o \
pps.o timestamp.o dmtd.o
# accept WRN_DEBUG from the environment. It turns pr_debug() into printk.
ifdef
WRN_DEBUG
#
ifdef WRN_DEBUG
ccflags-y
+=
-DDEBUG
endif
#
endif
ccflags-y
+=
-I
$(src)
/../wr_pstats
...
...
kernel/wr_nic/nic-core.c
View file @
137d56d3
...
...
@@ -160,6 +160,18 @@ static void __wrn_tx_desc(struct wrn_ep *ep, int desc,
&
tx
->
tx1
);
}
inline
char
*
decode_frame
(
uint8_t
byte
)
{
if
(
byte
==
0x00
)
return
"SYNC"
;
if
(
byte
==
0x08
)
return
"FOLLOW-UP"
;
if
(
byte
==
0x0b
)
return
"ANNOUNCE"
;
if
(
byte
==
0x09
)
return
"DELAY_RESP"
;
return
"unknown"
;
}
static
int
wrn_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
...
...
@@ -171,6 +183,7 @@ static int wrn_start_xmit(struct sk_buff *skb, struct net_device *dev)
int
id
;
int
do_stamp
=
0
;
void
*
data
;
/* FIXME: move data and len to __wrn_tx_desc */
uint8_t
*
dbg_ptr
;
unsigned
len
;
if
(
unlikely
(
skb
->
len
>
WRN_MTU
))
{
...
...
@@ -210,6 +223,11 @@ static int wrn_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* This both copies the data to the descriptr and fires tx */
__wrn_tx_desc
(
ep
,
desc
,
data
,
len
,
id
,
do_stamp
);
if
(
do_stamp
)
{
dbg_ptr
=
(
uint8_t
*
)
data
;
pr_debug
(
"GD: tx %s id: %d, len: %d
\n
"
,
decode_frame
(
dbg_ptr
[
14
]),
id
,
len
);
}
/* We are done, this is trivial maiintainance*/
ep
->
stats
.
tx_packets
++
;
...
...
kernel/wr_nic/timestamp.c
View file @
137d56d3
...
...
@@ -47,6 +47,7 @@ void wrn_tstamp_find_skb(struct wrn_dev *wrn, int desc)
ts
.
tv_sec
=
(
s32
)
utc
&
0x7fffffff
;
ts
.
tv_nsec
=
wrn
->
ts_buf
[
i
].
ts
*
NSEC_PER_TICK
;
pr_debug
(
"GD: tx ts %d.%d
\n
"
,
ts
.
tv_sec
,
ts
.
tv_nsec
);
if
(
!
(
wrn
->
ts_buf
[
i
].
valid
&
TS_INVALID
))
{
hwts
=
skb_hwtstamps
(
skb
);
...
...
@@ -90,6 +91,8 @@ static int record_tstamp(struct wrn_dev *wrn, u32 tsval, u32 idreg, u32 r2)
ts
.
tv_sec
=
(
s32
)
utc
&
0x7fffffff
;
ts
.
tv_nsec
=
(
tsval
&
0xfffffff
)
*
NSEC_PER_TICK
;
pr_debug
(
"GD: %s txts (id:%d, v:%d) %d.%d
\n
"
,
__func__
,
frame_id
,
!
ts_incorrect
,
ts
.
tv_sec
,
ts
.
tv_nsec
);
/* Provide the timestamp for the userland only if we're 100% sure about its correctness */
if
(
!
ts_incorrect
)
...
...
@@ -111,7 +114,7 @@ static int record_tstamp(struct wrn_dev *wrn, u32 tsval, u32 idreg, u32 r2)
pr_debug
(
"%s: ENOMEM
\n
"
,
__func__
);
return
-
ENOMEM
;
}
pr_debug
(
"%s:
save to slot %i
\n
"
,
__func__
,
i
);
pr_debug
(
"%s:
GD save id: %d to slot %i
\n
"
,
__func__
,
frame_id
,
i
);
wrn
->
ts_buf
[
i
].
ts
=
tsval
;
wrn
->
ts_buf
[
i
].
port_id
=
port_id
;
wrn
->
ts_buf
[
i
].
frame_id
=
frame_id
;
...
...
ppsi
@
aafbc027
Subproject commit
466051b2048854036b83ca96be1e332f9098dac3
Subproject commit
aafbc0276233d56c59590840e98f989add07a0fd
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