[ovs-dev] [PATCH 1/1] [branch-1.4] [ofproto-dpif] Memory leak at specific PACKET_INs

Zoltan Kiss zoltan.kiss at citrix.com
Mon Apr 15 14:59:52 UTC 2013


When the packet is sent to the controller due to an userspace rule (and not
a kernel-space flow), execute_controller_action is invoked with clone=true,
so handle_flow_miss retains ownership of the packet buffer. But if it returns
true (which means the packet had only a PACKET_IN action), nothing frees up
the buffer.
The problem has seen only in 1.4 branch.
Tested with XenServer 6.1:
- set up the controller, DVSC is fine
- add a rule with high priority to force everything to the controller:
ovs-ofctl add-flow [mgmt int] priority=65535,actions=controller
- send a bunch of UDP packets to random ports to trigger misses in kernel:
mz -B [mgmt IP] -d 100m eth0 -t udp sp=3000,dp=1024-65535,iplen=1400
- track memory consumption over time

Signed-off-by: Zoltan Kiss <zoltan.kiss at citrix.com>
---
 ofproto/ofproto-dpif.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 2949085..0a4d0f4 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -2570,6 +2570,8 @@ handle_flow_miss(struct ofproto_dpif *ofproto, struct flow_miss *miss,
                    : xmemdup(subfacet->actions, subfacet->actions_len));
             execute->actions_len = subfacet->actions_len;
             execute->packet = packet;
+        } else {
+            ofpbuf_delete(packet);
         }
     }
 
-- 
1.7.0.4




More information about the dev mailing list