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
0ef964de
Commit
0ef964de
authored
Feb 15, 2021
by
Antoine Kaufmann
Browse files
switch,corundum_bm: fix compiler warnings
parent
fdcaff7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
sims/net/switch/net_switch.cc
sims/net/switch/net_switch.cc
+5
-5
sims/nic/corundum_bm/corundum_bm.cc
sims/nic/corundum_bm/corundum_bm.cc
+3
-3
No files found.
sims/net/switch/net_switch.cc
View file @
0ef964de
...
...
@@ -83,7 +83,7 @@ static void sigint_handler(int dummy) {
}
static
void
forward_pkt
(
volatile
struct
SimbricksProtoNetD2NSend
*
tx
,
in
t
port
)
{
size_
t
port
)
{
volatile
union
SimbricksProtoNetN2D
*
msg_to
;
msg_to
=
SimbricksNetIfN2DAlloc
(
&
nsifs
[
port
],
cur_ts
,
eth_latency
);
if
(
msg_to
!=
NULL
)
{
...
...
@@ -101,7 +101,7 @@ static void forward_pkt(volatile struct SimbricksProtoNetD2NSend *tx,
}
}
static
void
switch_pkt
(
struct
SimbricksNetIf
*
nsif
,
in
t
iport
)
{
static
void
switch_pkt
(
struct
SimbricksNetIf
*
nsif
,
size_
t
iport
)
{
volatile
union
SimbricksProtoNetD2N
*
msg_from
=
SimbricksNetIfD2NPoll
(
nsif
,
cur_ts
);
if
(
msg_from
==
NULL
)
{
...
...
@@ -120,11 +120,11 @@ static void switch_pkt(struct SimbricksNetIf *nsif, int iport) {
}
// L2 forwarding
if
(
mac_table
.
count
(
dst
)
>
0
)
{
in
t
eport
=
mac_table
.
at
(
dst
);
size_
t
eport
=
mac_table
.
at
(
dst
);
forward_pkt
(
tx
,
eport
);
}
else
{
// Broadcast
for
(
in
t
eport
=
0
;
eport
<
nsifs
.
size
();
eport
++
)
{
for
(
size_
t
eport
=
0
;
eport
<
nsifs
.
size
();
eport
++
)
{
if
(
eport
!=
iport
)
{
// Do not forward to ingress port
forward_pkt
(
tx
,
eport
);
...
...
@@ -205,7 +205,7 @@ int main(int argc, char *argv[]) {
uint64_t
min_ts
;
do
{
min_ts
=
ULLONG_MAX
;
for
(
in
t
port
=
0
;
port
<
nsifs
.
size
();
port
++
)
{
for
(
size_
t
port
=
0
;
port
<
nsifs
.
size
();
port
++
)
{
auto
&
nsif
=
nsifs
.
at
(
port
);
switch_pkt
(
&
nsif
,
port
);
if
(
nsif
.
sync
)
{
...
...
sims/nic/corundum_bm/corundum_bm.cc
View file @
0ef964de
...
...
@@ -446,10 +446,10 @@ void Port::queueDisable() {
}
Corundum
::
Corundum
()
:
txCplRing
(
&
this
->
eventRing
),
rxCplRing
(
&
this
->
eventRing
),
txRing
(
&
this
->
txCplRing
),
:
txRing
(
&
this
->
txCplRing
),
txCplRing
(
&
this
->
eventRing
),
rxRing
(
&
this
->
rxCplRing
),
rxCplRing
(
&
this
->
eventRing
),
features
(
0
)
{
this
->
port
.
setId
(
0
);
this
->
port
.
setFeatures
(
this
->
features
);
...
...
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