diff mbox series

[ovs-dev,RFC,v2,5/5] dpif-netdev: Support flow_get() with partial-action-offload

Message ID 20200518192731.30804-6-sriharsha.basavapatna@broadcom.com
State New
Headers show
Series RFC for Partial action offload | expand

Commit Message

Sriharsha Basavapatna May 18, 2020, 7:27 p.m. UTC
For flows that offload partial actions in egress direction,
provide the right netdev to fetch statistics.

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
---
 lib/dpif-netdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 07d16ad61..6b7075641 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3420,8 +3420,14 @@  dpif_netdev_get_flow_offload_status(const struct dp_netdev *dp,
         return false;
     }
 
-    netdev = netdev_ports_get(netdev_flow->flow.in_port.odp_port,
-                              dpif_normalize_type(dp->class->type));
+    if (netdev_flow->partial_actions_offloaded &&
+        netdev_flow->egress_offload_port != ODPP_NONE) {
+            netdev = netdev_ports_get(netdev_flow->egress_offload_port,
+                                      dpif_normalize_type(dp->class->type));
+    } else {
+        netdev = netdev_ports_get(netdev_flow->flow.in_port.odp_port,
+                                  dpif_normalize_type(dp->class->type));
+    }
     if (!netdev) {
         return false;
     }