Commit 0ef964de authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

switch,corundum_bm: fix compiler warnings

parent fdcaff7c
...@@ -83,7 +83,7 @@ static void sigint_handler(int dummy) { ...@@ -83,7 +83,7 @@ static void sigint_handler(int dummy) {
} }
static void forward_pkt(volatile struct SimbricksProtoNetD2NSend *tx, static void forward_pkt(volatile struct SimbricksProtoNetD2NSend *tx,
int port) { size_t port) {
volatile union SimbricksProtoNetN2D *msg_to; volatile union SimbricksProtoNetN2D *msg_to;
msg_to = SimbricksNetIfN2DAlloc(&nsifs[port], cur_ts, eth_latency); msg_to = SimbricksNetIfN2DAlloc(&nsifs[port], cur_ts, eth_latency);
if (msg_to != NULL) { if (msg_to != NULL) {
...@@ -101,7 +101,7 @@ static void forward_pkt(volatile struct SimbricksProtoNetD2NSend *tx, ...@@ -101,7 +101,7 @@ static void forward_pkt(volatile struct SimbricksProtoNetD2NSend *tx,
} }
} }
static void switch_pkt(struct SimbricksNetIf *nsif, int iport) { static void switch_pkt(struct SimbricksNetIf *nsif, size_t iport) {
volatile union SimbricksProtoNetD2N *msg_from = volatile union SimbricksProtoNetD2N *msg_from =
SimbricksNetIfD2NPoll(nsif, cur_ts); SimbricksNetIfD2NPoll(nsif, cur_ts);
if (msg_from == NULL) { if (msg_from == NULL) {
...@@ -120,11 +120,11 @@ static void switch_pkt(struct SimbricksNetIf *nsif, int iport) { ...@@ -120,11 +120,11 @@ static void switch_pkt(struct SimbricksNetIf *nsif, int iport) {
} }
// L2 forwarding // L2 forwarding
if (mac_table.count(dst) > 0) { if (mac_table.count(dst) > 0) {
int eport = mac_table.at(dst); size_t eport = mac_table.at(dst);
forward_pkt(tx, eport); forward_pkt(tx, eport);
} else { } else {
// Broadcast // Broadcast
for (int eport = 0; eport < nsifs.size(); eport++) { for (size_t eport = 0; eport < nsifs.size(); eport++) {
if (eport != iport) { if (eport != iport) {
// Do not forward to ingress port // Do not forward to ingress port
forward_pkt(tx, eport); forward_pkt(tx, eport);
...@@ -205,7 +205,7 @@ int main(int argc, char *argv[]) { ...@@ -205,7 +205,7 @@ int main(int argc, char *argv[]) {
uint64_t min_ts; uint64_t min_ts;
do { do {
min_ts = ULLONG_MAX; min_ts = ULLONG_MAX;
for (int port = 0; port < nsifs.size(); port++) { for (size_t port = 0; port < nsifs.size(); port++) {
auto &nsif = nsifs.at(port); auto &nsif = nsifs.at(port);
switch_pkt(&nsif, port); switch_pkt(&nsif, port);
if (nsif.sync) { if (nsif.sync) {
......
...@@ -446,10 +446,10 @@ void Port::queueDisable() { ...@@ -446,10 +446,10 @@ void Port::queueDisable() {
} }
Corundum::Corundum() Corundum::Corundum()
: txCplRing(&this->eventRing), : txRing(&this->txCplRing),
rxCplRing(&this->eventRing), txCplRing(&this->eventRing),
txRing(&this->txCplRing),
rxRing(&this->rxCplRing), rxRing(&this->rxCplRing),
rxCplRing(&this->eventRing),
features(0) { features(0) {
this->port.setId(0); this->port.setId(0);
this->port.setFeatures(this->features); this->port.setFeatures(this->features);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment