----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/3465/#review8311 -----------------------------------------------------------
src/dev/net/etherswitch.cc (line 83) <http://reviews.gem5.org/r/3465/#comment7183> You can avoid the extra copy by using fifo.emplace(...) instead of fifo.insert(). Even better would be to use fifo.emplace_hint(fifo.rbegin(), ...) which can make the common case insertion path faster. (I guess the common case is when the packet gets inserted at the end of the fifo.) src/dev/net/etherswitch.cc (line 87) <http://reviews.gem5.org/r/3465/#comment7181> You can replace std::prev(fifo.end()) by fifo.rbegin() (in the next line, too). src/dev/net/etherswitch.cc (line 91) <http://reviews.gem5.org/r/3465/#comment7185> *Return* src/dev/net/etherswitch.cc (line 92) <http://reviews.gem5.org/r/3465/#comment7186> *return* src/dev/net/etherswitch.cc (line 95) <http://reviews.gem5.org/r/3465/#comment7184> The check could be simpler by comparing only the (shared) packet pointer (EthPacketPtr). However, can there be a problem here in the pathological case when the fifo is empty originally but the size of the current packet is larger then max_size ? Then, at this point the fifo would be empty. src/dev/net/etherswitch.cc (line 335) <http://reviews.gem5.org/r/3465/#comment7187> _maxsize is also serialized but it is not unserialized here - Gabor Dozsa On May 17, 2016, 3:22 a.m., Mohammad Alian wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/3465/ > ----------------------------------------------------------- > > (Updated May 17, 2016, 3:22 a.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 11472:c7242a550140 > --------------------------- > dist, dev: Fixed the packet ordering in etherswitch > This patch fixes the order that packets gets pushed into the output fifo > of etherswitch. If two packets arrive at the same tick to the etherswitch, > we sort and push them based on their source port id. > In dist-gem5 simulations, if there is no ordering inforced while two > packets arrive at the same tick, it can lead to non-deterministic simulations > > > Diffs > ----- > > src/dev/net/etherswitch.hh 954d3014f7f0 > src/dev/net/etherswitch.cc 954d3014f7f0 > > Diff: http://reviews.gem5.org/r/3465/diff/ > > > Testing > ------- > > > Thanks, > > Mohammad Alian > > _______________________________________________ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev