Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
f73b15de
Commit
f73b15de
authored
Nov 25, 2020
by
Antoine Kaufmann
Browse files
libnicbm: add parameters for latencies
parent
ae7945ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
libnicbm/nicbm.cc
libnicbm/nicbm.cc
+15
-9
No files found.
libnicbm/nicbm.cc
View file @
f73b15de
...
...
@@ -12,9 +12,6 @@
//#define DEBUG_NICBM 1
#define SYNC_PERIOD (100 * 1000ULL) // 100ns
#define PCI_LATENCY (500 * 1000ULL) // 500ns
#define ETH_LATENCY (500 * 1000ULL) // 500ns
#define DMA_MAX_PENDING 64
...
...
@@ -395,14 +392,23 @@ int Runner::runMain(int argc, char *argv[])
{
uint64_t
next_ts
;
uint64_t
max_step
=
10000
;
uint64_t
sync_period
=
100
*
1000ULL
;
uint64_t
pci_latency
=
500
*
1000ULL
;
uint64_t
eth_latency
=
500
*
1000ULL
;
if
(
argc
!=
4
&&
argc
!=
5
)
{
if
(
argc
<
4
&&
argc
>
8
)
{
fprintf
(
stderr
,
"Usage: corundum_bm PCI-SOCKET ETH-SOCKET "
"SHM [START-TICK]
\n
"
);
"SHM [START-TICK]
[SYNC-PERIOD] [PCI-LATENCY] [ETH-LATENCY]
\n
"
);
return
EXIT_FAILURE
;
}
if
(
argc
=
=
5
)
if
(
argc
>
=
5
)
main_time
=
strtoull
(
argv
[
4
],
NULL
,
0
);
if
(
argc
>=
6
)
sync_period
=
strtoull
(
argv
[
5
],
NULL
,
0
)
*
1000ULL
;
if
(
argc
>=
7
)
pci_latency
=
strtoull
(
argv
[
6
],
NULL
,
0
)
*
1000ULL
;
if
(
argc
>=
8
)
eth_latency
=
strtoull
(
argv
[
7
],
NULL
,
0
)
*
1000ULL
;
signal
(
SIGINT
,
sigint_handler
);
...
...
@@ -416,9 +422,9 @@ int Runner::runMain(int argc, char *argv[])
nsparams
.
pci_socket_path
=
argv
[
1
];
nsparams
.
eth_socket_path
=
argv
[
2
];
nsparams
.
shm_path
=
argv
[
3
];
nsparams
.
pci_latency
=
PCI_LATENCY
;
nsparams
.
eth_latency
=
ETH_LATENCY
;
nsparams
.
sync_delay
=
SYNC_PERIOD
;
nsparams
.
pci_latency
=
pci_latency
;
nsparams
.
eth_latency
=
eth_latency
;
nsparams
.
sync_delay
=
sync_period
;
if
(
nicsim_init
(
&
nsparams
,
&
dintro
))
{
return
EXIT_FAILURE
;
}
...
...
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