diff mbox series

[ovs-dev,v6,4/8] dpif-netdev: Support flow_get() with partial-action-offload

Message ID 20200712192625.7359-5-sriharsha.basavapatna@broadcom.com
State New
Headers show
Series netdev datapath: Partial action offload | expand

Commit Message

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

Reviewed-by: Hemal Shah <hemal.shah@broadcom.com>
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 c75a07c5e..2c20e6d5e 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3197,8 +3197,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;
     }