dev: Make sure the EtherTap device uses the right event queue.

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>
This commit is contained in:
Gabe Black
2018-03-28 16:23:26 -07:00
parent a82283ddbc
commit f97f8a2804

View File

@@ -79,7 +79,16 @@ class TapEvent : public PollEvent
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)