dev: add an ethernet switch model
Review Request #2305 - Created June 26, 2014 and submitted
| Information | |
|---|---|
| Tony Gutierrez | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10259:eb23219d83a4 --------------------------- dev: add an ethernet switch model this patch adds a very simple ethernet switch model. the basic design behind the switch is to modularize the interface, fabric, and overall switch model as much as possible. The switch model: 1) buffers incoming/outgoing packets in the ports 2) utilizes Links from EtherLink as the point-to-point connections in the switch fabric 3) uses a simple least-recently-granted arbitration policy to forward packets, and doesn't provide any support for things like flow control. it also does not provide any features outside the link layer, which some switches may support e.g., ARP, filtering, etc. * * * junk
Successfully ran 3 systems with 1 memcached server and 2 memcached clients simultaneously issuing requests.
Issue Summary
26
3
19
4
| Description | From | Last Updated | Status |
|---|---|---|---|
| has it gotten to a point where it's worth adding a src/dev/ether directory? | Andreas Hansson | July 10, 2014, 5:48 a.m. | Open |
| safe_cast? Somehow this seems a bit dubious | Andreas Hansson | July 10, 2014, 5:48 a.m. | Open |
| is this not just the length of the vector? | Andreas Hansson | July 10, 2014, 5:48 a.m. | Open |
Review request changed
Updated (June 27, 2014, 11:24 a.m.)
Testing Done: |
|
|---|
Posted (July 10, 2014, 5:48 a.m.)
-
src/dev/Ethernet.py (Diff revision 1) -
port speed?
-
src/dev/Ethernet.py (Diff revision 1) -
Seem to be a duplicate
-
src/dev/SConscript (Diff revision 1) -
has it gotten to a point where it's worth adding a src/dev/ether directory?
-
src/dev/etherlink.hh (Diff revision 1) -
whitespace
-
src/dev/etherlink.cc (Diff revision 1) -
safe_cast? Somehow this seems a bit dubious
-
src/dev/etherswitch.hh (Diff revision 1) -
dev
-
src/dev/etherswitch.hh (Diff revision 1) -
Should it really be ticked?
-
src/dev/etherswitch.hh (Diff revision 1) -
const
-
src/dev/etherswitch.hh (Diff revision 1) -
const
-
src/dev/etherswitch.hh (Diff revision 1) -
const
-
src/dev/etherswitch.hh (Diff revision 1) -
is this not just the length of the vector?
-
src/dev/etherswitch.hh (Diff revision 1) -
should this be public?
-
src/dev/etherswitch.hh (Diff revision 1) -
const?
-
src/dev/etherswitch.hh (Diff revision 1) -
const?
-
src/dev/etherswitch.cc (Diff revision 1) -
if you want: for (auto i: interfaces) delete i; -
src/dev/etherswitch.cc (Diff revision 1) -
fatal? even fatal_if
-
src/dev/etherswitch.cc (Diff revision 1) -
why + 10?
-
src/dev/etherswitch.cc (Diff revision 1) -
why 1000? Should this whole thing not be event driven rather than ticked?
-
src/dev/etherswitch.cc (Diff revision 1) -
perhaps i just don't understand the rules here, should this not return true when successfully sending something?
-
src/dev/etherswitch.cc (Diff revision 1) -
auto and range-based for is your friend :-)
-
src/dev/etherswitch.cc (Diff revision 1) -
auto
-
src/dev/etherswitch.cc (Diff revision 1) -
seems like a bug to me...
This looks like a great start. There are plenty places where auto and range-based for loops will make the code a lot easier to read. In general I am a bit surprised to see the ticked interface being used, as the switch clearly just does what ever it is asked to do, and should be able to rely on events scheduled when something arrives.
Review request changed
Updated (July 22, 2014, 11:25 a.m.)
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+573 -14) |
Review request changed
Updated (July 22, 2014, 11:36 a.m.)
Description: |
|
|---|
Posted (July 22, 2014, 3:12 p.m.)
-
src/dev/etherswitch.cc (Diff revision 2) -
Not sure what the style guide says about the spacing here, but I've been using for (auto i: list) Does anyone have a strong opinion?
-
src/dev/etherswitch.cc (Diff revision 2) -
Could merge these
-
src/dev/etherswitch.cc (Diff revision 2) -
seems a bit excessive :-)
-
src/dev/etherswitch.cc (Diff revision 2) -
Why is the copy needed? Could you add a comment?
Some very minor things. Thanks for all the changes.
Review request changed
Updated (July 24, 2014, 12:44 p.m.)
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+577 -14) |
Ship It!
Ship It!
Posted (Jan. 6, 2015, 7:58 a.m.)
-
src/dev/etherint.hh (Diff revision 3) -
I don't understand why this needs to be virtual... I mean, I see that you override it on EtherSwitch::Interface, but part of the idea behind these port objects is that you only pay for the virtual function dispatch once. I'm not sure why this broke down here, but I'd like to figure that out before we commit this code.
