Bug 2224653

Summary: OVS Mirror doesn't work as expected when both select-dst-port and select-src-port are selected
Product: Red Hat Enterprise Linux Fast Datapath Reporter: ovs-bugzilla <ovs-bugzilla>
Component: openvswitch3.1Assignee: Mike Pattrick <mpattric>
Status: MODIFIED --- QA Contact: Zhiqiang Fang <zfang>
Severity: high Docs Contact:
Priority: unspecified    
Version: RHEL 8.0CC: ctrautma, jhsiao, ralongi, zfang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openvswitch3.1-3.1.0-43.el8fdp Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ovs-bugzilla 2023-07-21 19:43:41 UTC
+++ This bug was initially created as a clone of Bug #2155579 +++

Created attachment 1933931 [details]
ovsmirrortest.diff

Created attachment 1933931 [details]
ovsmirrortest.diff

Description of problem:
While trying to add a test case related to OVS Mirror in OVN (ovn.at) we are seeing an issue when both 'select-dst-port' and 'select-src-port' are filled.

The test we are trying is very simple.

Send an ICMP echo request packet and expect an ICMP echo reply packet.
An OVS mirror is created and expected to mirror both the request and reply packets. (So both select-dst-port' and 'select-src-port' are filled appropriately)

While both ICMP request and reply we see are present (i.e. ping works fine)
But both packets are NOT getting mirrored. 
We see ONLY the ICMP request packet getting mirrored.

Alternatively if we select either 'select-dst-port' or 'select-src-port' those packets get mirrored separately well.
But when both are selected we see only the request packet getting mirrored.

I have attached the test case we used to test it and it has the OVS commands which is used to create mirrors. Please check it.

Further we also tried to create a similar environment on the actual HW setup and we do see the same issue there. So, its not just failing in test environment alone.

Version-Release number of selected component (if applicable):


How reproducible:
Please find attached the diff having the test case which uses OVS commands to create mirrors and verify it.

Actual results:
Only echo request packet is getting mirrored.

Expected results:
Both echo request and reply packets needs to be mirrored.

Additional info:

Comment 1 ovs-bugzilla 2023-07-21 19:43:44 UTC
* Fri Jul 21 2023 Open vSwitch CI <ovs-ci> - 3.1.0-43
- Merging upstream branch-3.1 [RH git: da1afee4f8]
    Commit list:
    cad4759fa1 ofproto-dpif-upcall: Mirror packets that are modified. (#2155579)