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
4a78389a
Commit
4a78389a
authored
Aug 30, 2021
by
Antoine Kaufmann
Browse files
sims/net/switch: Retry on full queue in sync mode
parent
07530e39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
sims/net/switch/net_switch.cc
sims/net/switch/net_switch.cc
+13
-12
No files found.
sims/net/switch/net_switch.cc
View file @
4a78389a
...
@@ -144,11 +144,8 @@ class NetPort : public Port {
...
@@ -144,11 +144,8 @@ class NetPort : public Port {
}
}
virtual
void
Sync
(
uint64_t
cur_ts
)
override
{
virtual
void
Sync
(
uint64_t
cur_ts
)
override
{
if
(
SimbricksNetIfN2DSync
(
&
netif_
,
cur_ts
,
eth_latency
,
sync_period
,
while
(
SimbricksNetIfN2DSync
(
&
netif_
,
cur_ts
,
eth_latency
,
sync_period
,
sync_mode
)
!=
0
)
{
sync_mode
));
fprintf
(
stderr
,
"SimbricksNetIfN2DSync failed
\n
"
);
abort
();
}
}
}
virtual
void
AdvanceEpoch
(
uint64_t
cur_ts
)
override
{
virtual
void
AdvanceEpoch
(
uint64_t
cur_ts
)
override
{
...
@@ -191,9 +188,12 @@ class NetPort : public Port {
...
@@ -191,9 +188,12 @@ class NetPort : public Port {
const
void
*
data
,
size_t
len
,
uint64_t
cur_ts
)
override
{
const
void
*
data
,
size_t
len
,
uint64_t
cur_ts
)
override
{
volatile
union
SimbricksProtoNetN2D
*
msg_to
=
volatile
union
SimbricksProtoNetN2D
*
msg_to
=
SimbricksNetIfN2DAlloc
(
&
netif_
,
cur_ts
,
eth_latency
);
SimbricksNetIfN2DAlloc
(
&
netif_
,
cur_ts
,
eth_latency
);
if
(
!
msg_to
)
if
(
!
msg_to
&&
!
sync_
)
{
return
false
;
return
false
;
}
else
if
(
!
msg_to
&&
sync_
)
{
while
(
!
msg_to
)
msg_to
=
SimbricksNetIfN2DAlloc
(
&
netif_
,
cur_ts
,
eth_latency
);
}
volatile
struct
SimbricksProtoNetN2DRecv
*
rx
;
volatile
struct
SimbricksProtoNetN2DRecv
*
rx
;
rx
=
&
msg_to
->
recv
;
rx
=
&
msg_to
->
recv
;
rx
->
len
=
len
;
rx
->
len
=
len
;
...
@@ -251,10 +251,7 @@ class NetHostPort : public Port {
...
@@ -251,10 +251,7 @@ class NetHostPort : public Port {
}
}
virtual
void
Sync
(
uint64_t
cur_ts
)
override
{
virtual
void
Sync
(
uint64_t
cur_ts
)
override
{
if
(
SimbricksNicIfSync
(
&
nicif_
,
cur_ts
)
!=
0
)
{
while
(
SimbricksNicIfSync
(
&
nicif_
,
cur_ts
));
fprintf
(
stderr
,
"SimbricksNicIfSync failed
\n
"
);
abort
();
}
}
}
virtual
void
AdvanceEpoch
(
uint64_t
cur_ts
)
override
{
virtual
void
AdvanceEpoch
(
uint64_t
cur_ts
)
override
{
...
@@ -298,8 +295,12 @@ class NetHostPort : public Port {
...
@@ -298,8 +295,12 @@ class NetHostPort : public Port {
const
void
*
data
,
size_t
len
,
uint64_t
cur_ts
)
override
{
const
void
*
data
,
size_t
len
,
uint64_t
cur_ts
)
override
{
volatile
union
SimbricksProtoNetD2N
*
msg_to
=
volatile
union
SimbricksProtoNetD2N
*
msg_to
=
SimbricksNicIfD2NAlloc
(
&
nicif_
,
cur_ts
);
SimbricksNicIfD2NAlloc
(
&
nicif_
,
cur_ts
);
if
(
!
msg_to
)
if
(
!
msg_to
&&
!
sync_
)
{
return
false
;
return
false
;
}
else
if
(
!
msg_to
&&
sync_
)
{
while
(
!
msg_to
)
msg_to
=
SimbricksNicIfD2NAlloc
(
&
nicif_
,
cur_ts
);
}
volatile
struct
SimbricksProtoNetD2NSend
*
rx
;
volatile
struct
SimbricksProtoNetD2NSend
*
rx
;
rx
=
&
msg_to
->
send
;
rx
=
&
msg_to
->
send
;
...
...
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