Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Testing
Commits
2e5cae01
Commit
2e5cae01
authored
May 12, 2014
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smartbits-tester: calculate loss rate with fractional part too
parent
a9997dcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
smartbits.c
sw/smartbits-tester/smartbits.c
+5
-4
No files found.
sw/smartbits-tester/smartbits.c
View file @
2e5cae01
...
...
@@ -162,17 +162,18 @@ int clear_allcntrs(int mask)
int
show_floss
(
FILE
*
f
,
HTCountStructure
*
cntrs
,
unsigned
long
*
total
)
{
int
i
,
loss
[
SMB_PORTS
];
int
i
;
float
loss
[
SMB_PORTS
];
fprintf
(
f
,
"===========================
\n
"
);
fprintf
(
f
,
"| Port
\t
| Loss rate
\t
|
\n
"
);
fprintf
(
f
,
"===========================
\n
"
);
for
(
i
=
0
;
i
<
SMB_PORTS
;
++
i
)
{
if
(
total
[
i
]
!=
0
)
loss
[
i
]
=
(
total
[
i
]
-
cntrs
[
i
].
RcvTrig
)
*
100
/
total
[
i
];
loss
[
i
]
=
(
total
[
i
]
-
cntrs
[
i
].
RcvTrig
)
*
100
.
0
/
total
[
i
];
else
loss
[
i
]
=
0
;
fprintf
(
f
,
"| %d
\t
| %d
\t
|
\n
"
,
i
,
loss
[
i
]);
fprintf
(
f
,
"| %d
\t
| %f
\t
|
\n
"
,
i
,
loss
[
i
]);
}
}
...
...
@@ -464,7 +465,7 @@ int exp_rx_frames(struct smb_test *wrst, HTCountStructure *cntrs, unsigned long
exp
[
p_tx
->
d_ports
[
idp
]
]
+=
cntrs
[
i_port
].
TmtPkt
/
p_tx
->
d_ports_n
;
/* now check if at the end of the stream run, one more frame wasn't sent
* to analyzed port */
if
(
cntrs
[
i_port
].
TmtPkt
%
p_tx
->
d_ports_n
>
p_tx
->
d_ports
[
idp
]
)
if
(
cntrs
[
i_port
].
TmtPkt
%
p_tx
->
d_ports_n
>
idp
)
exp
[
p_tx
->
d_ports
[
idp
]
]
++
;
}
else
if
(
p_tx
->
d_ports
[
idp
]
==
TX_PALL
){
...
...
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