diff options
author | Jing Zhang <jing.c.zhang@nokia.com> | 2017-10-10 14:20:33 -0400 |
---|---|---|
committer | Jing Zhang <jing.c.zhang@nokia.com> | 2017-10-10 14:20:33 -0400 |
commit | 07644db4910643d6f6705c6a12c5ec612a99a33a (patch) | |
tree | a509abdad175bb3c827bade40343e33ea690f85f | |
parent | 25b1bb7046d079102f68081ce49e651e84666723 (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.py | 11 |
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: |