From b448fd6ce4df3265b3bc140b2c6f46e58bb4fb57 Mon Sep 17 00:00:00 2001 From: Benjamin Hesmans Date: Mon, 23 Feb 2015 12:26:32 +0100 Subject: [PATCH] wip userspace pm Signed-off-by: Benjamin Hesmans --- src/mpExperience.py | 28 ++++++++++++++++++++++++++++ src/mpParamXp.py | 5 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/mpExperience.py b/src/mpExperience.py index cba2fb2..09ee609 100644 --- a/src/mpExperience.py +++ b/src/mpExperience.py @@ -16,10 +16,37 @@ class MpExperience: def prepare(self): self.setupSysctl() + self.runUserspacePM() self.runTcpDump() self.runNetemAt() pass + def runUserspacePM(self): + if self.xpParam.getParam(MpParamXp.KERNELPMC) != "netlink": + print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !") + else: + upmc = self.xpParam.getParam(MpParamXp.USERPMC) + self.mpConfig.commandTo(self.mpConfig.client, upmc + \ + "&>upmc.log &") + if self.xpParam.getParam(MpParamXp.KERNELPMS) != "netlink": + print("Server : Error, I can't change the userspace pm if the kernel pm is not netlink !") + else: + upms = self.xpParam.getParam(MpParamXp.USERPMS) + self.mpConfig.commandTo(self.mpConfig.server, upms + \ + "&>upms.log &") + + def cleanUserspacePM(self): + if self.xpParam.getParam(MpParamXp.KERNELPMC) != "netlink": + print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !") + else: + upmc = self.xpParam.getParam(MpParamXp.USERPMC) + self.mpConfig.commandTo(self.mpConfig.client, "killall " + upmc) + if self.xpParam.getParam(MpParamXp.KERNELPMS) != "netlink": + print("Server : Error, I can't change the userspace pm if the kernel pm is not netlink !") + else: + upms = self.xpParam.getParam(MpParamXp.USERPMS) + self.mpConfig.commandTo(self.mpConfig.server, "killall " + upms) + def runNetemAt(self): if not self.mpTopo.changeNetem == "yes": print("I don't need to change netem") @@ -54,6 +81,7 @@ class MpExperience: self.mpTopo.commandTo(self.mpConfig.server, "killall tcpdump") self.backUpSysctl() + self.cleanUserspacePM() pass def setupSysctl(self): diff --git a/src/mpParamXp.py b/src/mpParamXp.py index 0b7b70d..147a4aa 100644 --- a/src/mpParamXp.py +++ b/src/mpParamXp.py @@ -7,6 +7,8 @@ class MpParamXp(MpParam): KERNELPM = "kpm" KERNELPMC = "kpmc" #kernel path manager client / server KERNELPMS = "kpms" + USERPMC = "upmc" + USERPMS = "upms" #userspace path manager client / server CLIENTPCAP = "clientPcap" SERVERPCAP = "serverPcap" XPTYPE = "xpType" @@ -38,7 +40,8 @@ class MpParamXp(MpParam): defaultValue[RMEM] = "10240 87380 16777216" defaultValue[KERNELPM] = "fullmesh" defaultValue[KERNELPMC] = "fullmesh" - defaultValue[KERNELPMS] = "fullmesh" + defaultValue[USERPMC] = "fullmesh" + defaultValue[USERPMS] = "fullmesh" defaultValue[SCHED] = "default" defaultValue[CLIENTPCAP] = "no"