The EtherTap device may be called into from an event on the PollQueue when
some event queue other than its own is active. This change ensures that it
switches event queues if necessary before doing anything that may cause more
events to be scheduled.
Change-Id: If8666542d7664780c0b371230e1e5fba93fbc1c0
Reviewed-on: https://gem5-review.googlesource.com/9521
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
public:
TapEvent(EtherTapBase *_tap, int fd, int e)
: PollEvent(fd, e), tap(_tap) {}
- virtual void process(int revent) { tap->recvReal(revent); }
+
+ void
+ process(int revent) override
+ {
+ // Ensure that our event queue is active. It may not be since we get
+ // here from the PollQueue whenever a real packet happens to arrive.
+ EventQueue::ScopedMigration migrate(tap->eventQueue());
+
+ tap->recvReal(revent);
+ }
};
EtherTapBase::EtherTapBase(const Params *p)