forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ofproto-dpif-xlate: Rewrite mirroring to better fit flow translation.
Until now, mirroring has been implemented by accumulating, across the whole translation process, a set of mirrors that should receive a mirrored packet. After translation was complete, mirroring restored the original version of the packet and sent that version to the mirrors. That implementation was ugly for multiple reasons. First, it means that we have to keep a copy of the original packet (or its headers, actually), which is expensive. Second, it doesn't really make sense to mirror a version of a packet that is different from the one originally output. Third, it interacted with recirculation; mirroring needed to happen only after recirculation was complete, but this was never properly implemented, so that (I think) mirroring never happened for packets that were recirculated. This commit changes how mirroring works. Now, a packet is mirrored at the point in translation when it becomes eligible for it: for mirrors based on ingress port, this is at ingress; for mirrors based on egress port, this is at egress. (Duplicates are dropped.) Mirroring happens on the version of the packet as it exists when it becomes eligible. Finally, since mirroring happens immediately, it interacts better with recirculation (it still isn't perfect, since duplicate mirroring will occur if a packet is eligible for mirroring both before and after recirculation; this is not difficult to fix and an upcoming commit later in this series will do so). Finally, this commit removes more code from xlate_actions() than it adds, which in my opinion makes it easier to understand. Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Jarno Rajahalme <[email protected]>
- Loading branch information
Showing
3 changed files
with
82 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters