> On May 18, 2016, 3 p.m., Gabor Dozsa wrote: > > src/dev/net/etherswitch.cc, line 95 > > <http://reviews.gem5.org/r/3465/diff/2/?file=55331#file55331line95> > > > > 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.
Good point:). I added a check whether the fifo is empty or not. If it's empty we return false and don't schedule any event. > On May 18, 2016, 3 p.m., Gabor Dozsa wrote: > > src/dev/net/etherswitch.cc, line 83 > > <http://reviews.gem5.org/r/3465/diff/2/?file=55331#file55331line83> > > > > 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.) Thanks for the good suggestions. I fixed it. > On May 18, 2016, 3 p.m., Gabor Dozsa wrote: > > src/dev/net/etherswitch.cc, line 87 > > <http://reviews.gem5.org/r/3465/diff/2/?file=55331#file55331line87> > > > > You can replace std::prev(fifo.end()) by fifo.rbegin() (in the next > > line, too). I think we cannot use reverse pointers in std::set to erase an object. I get error and this is my understanding after doing some google search. Please let me know if there is still a better way to handle this. - Mohammad ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/3465/#review8311 ----------------------------------------------------------- On May 18, 2016, 8:06 p.m., Mohammad Alian wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/3465/ > ----------------------------------------------------------- > > (Updated May 18, 2016, 8:06 p.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 11472:1d2b55391506 > --------------------------- > 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