aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJing Zhang <jing.c.zhang@nokia.com>2017-10-10 14:20:33 -0400
committerRoss Brattain <ross.b.brattain@intel.com>2017-10-10 15:51:33 -0700
commitd6b148980fb78d99ed99985bf578ce285ead51d6 (patch)
treee9d1057b049e044cf02f702c5c6146da8450e4bc
parente26fbfde326ebed2d6b8702e5939cd424eef523d (diff)
TC008 Interrupt Affinity Fix
The smp_affinity takes hex mask, currently it is given hex number. Change-Id: Id738bfe10551dad1f5df48910a230b12f50d1b3d JIRA: YARDSTICK-818 Signed-off-by: Jing Zhang <jing.c.zhang@nokia.com>
-rw-r--r--yardstick/benchmark/scenarios/networking/pktgen.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/yardstick/benchmark/scenarios/networking/pktgen.py b/yardstick/benchmark/scenarios/networking/pktgen.py
index a9e7aa6a3..b79b91539 100644
--- a/yardstick/benchmark/scenarios/networking/pktgen.py
+++ b/yardstick/benchmark/scenarios/networking/pktgen.py
@@ -180,6 +180,9 @@ class Pktgen(base.Scenario):
return
for i in range(1, queue_number):
+
+ smp_affinity_mask = format(1 << i, 'x')
+
cmd = "grep 'virtio0-input.%s' /proc/interrupts |" \
"awk '{match($0,/ +[0-9]+/)} " \
"{print substr($1,RSTART,RLENGTH-1)}'" % (i)
@@ -188,7 +191,7 @@ class Pktgen(base.Scenario):
raise RuntimeError(stderr)
cmd = "echo %s | sudo tee /proc/irq/%s/smp_affinity" \
- % (1 << i, int(stdout))
+ % (smp_affinity_mask, int(stdout))
status, stdout, stderr = self.server.execute(cmd)
status, stdout, stderr = self.client.execute(cmd)
if status:
@@ -202,7 +205,7 @@ class Pktgen(base.Scenario):
raise RuntimeError(stderr)
cmd = "echo %s | sudo tee /proc/irq/%s/smp_affinity" \
- % (1 << i, int(stdout))
+ % (smp_affinity_mask, int(stdout))
status, stdout, stderr = self.server.execute(cmd)
status, stdout, stderr = self.client.execute(cmd)
if status:
@@ -226,6 +229,8 @@ class Pktgen(base.Scenario):
return
for i in range(1, queue_number):
+ smp_affinity_mask = format(1 << i, 'x')
+
cmd = "grep '%s-TxRx-%s' /proc/interrupts |" \
"awk '{match($0,/ +[0-9]+/)} " \
"{print substr($1,RSTART,RLENGTH-1)}'" % (self.vnic_name, i)
@@ -234,7 +239,7 @@ class Pktgen(base.Scenario):
raise RuntimeError(stderr)
cmd = "echo %s | sudo tee /proc/irq/%s/smp_affinity" \
- % (1 << i, int(stdout))
+ % (smp_affinity_mask, int(stdout))
status, stdout, stderr = self.server.execute(cmd)
status, stdout, stderr = self.client.execute(cmd)
if status: