From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 553D4A04B4; Wed, 26 Aug 2020 17:04:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 389DD2986; Wed, 26 Aug 2020 17:04:35 +0200 (CEST) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by dpdk.org (Postfix) with ESMTP id A078DA3 for ; Wed, 26 Aug 2020 17:04:34 +0200 (CEST) Received: by mail-qt1-f196.google.com with SMTP id k18so1569658qtm.10 for ; Wed, 26 Aug 2020 08:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nRY4XvnzgQcVvjgtpgNDfaNkxwOyWBqU3PNBTW3URd0=; b=bioFnXj/xCtZeSygn1uBuYojeYBC1Zdif2oy8/+x2WpwtMfrq4a+T54IwYnOA+DL2D giS9DNCr/9vdQdAtVlc4oLf6UtNQhIBAKZnD7Ryh26DsynD3BiN8ExiYwjtuDyD2FoLw h4ZCStYjrQ62c+W+JLMCvvpPOhI17C0z0YESk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nRY4XvnzgQcVvjgtpgNDfaNkxwOyWBqU3PNBTW3URd0=; b=H3Wl5gx6f2LjBujKNoowunuDLeAhLDvhege1Ap3B/6j4bSYjTx2JB0OeFq5cWxinr6 /qndQsX/BwaNAEbSf5wIKRJJvyh6uz0gauGG3N65NiQ5ETpgDGQbQtFAyruoZsoBD3EQ eEUAokYu0Yj4e7yl+99LxmNW9/zjeym/aaxeVzwEJ9gLxl5YHiYyuiYLHZjhsJayWbll SuRhUFq+qt0HnOWauPYPUbtZIRJZ/zOUbOfRKSizwF1WxnSLApxBxaRcZs9yvbS0tbbD uDKAi+7/ixpkLh/Xe9OBHlgWyCPVzl2WW7fojbb67ZTCdTCZ8m212TSe1M8LPqYnWRrv KSjw== X-Gm-Message-State: AOAM530kXsTyi2wPg6XVl6MvjWYMEKTe/P9fxA6hfQ/ePv6WyOXt4q63 7Okn6zcCEob4MCNjes5w+27w99GHm2SioNDvzwSESRlPk0aUR5lGFXcVF9KL6pGMKB6+Y6gc9Y4 Jg+lCLC4ARmRYr2U71dKjsH3kE1NIGY+DmECZ45VMZwOHtImAksEJEFZ5z1hw X-Google-Smtp-Source: ABdhPJzEwpKIkq1GwpFT8AD3NU0ZqxWuv6mQEB+BuRomk/1zYev15040CueWJH6ItkywtXqZAIuA7g== X-Received: by 2002:ac8:7609:: with SMTP id t9mr14342202qtq.158.1598454273494; Wed, 26 Aug 2020 08:04:33 -0700 (PDT) Received: from ohilyard-Alienware-m17.iol.unh.edu ([2601:187:8401:4970:f8e8:dd1e:d6df:dd32]) by smtp.gmail.com with ESMTPSA id k63sm1332410qkf.33.2020.08.26.08.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 08:04:33 -0700 (PDT) From: Owen Hilyard To: dts@dpdk.org Cc: yuwei1.zhang@intel.com, changqingx.wu@intel.com, qimaix.xiao@intel.com, david.hunt@intel.com, lylavoie@iol.unh.edu, Owen Hilyard Date: Wed, 26 Aug 2020 11:04:28 -0400 Message-Id: <20200826150429.278284-1-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH] rx interrupt: Fixed test case X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" fixed test case issues with eal params removed extra instances of l3fwd-power Signed-off-by: Owen Hilyard --- test_plans/interrupt_pmd_test_plan.rst | 58 +++++++++----------- tests/TestSuite_interrupt_pmd.py | 73 ++++++++++++++------------ 2 files changed, 64 insertions(+), 67 deletions(-) diff --git a/test_plans/interrupt_pmd_test_plan.rst b/test_plans/interrupt_pmd_test_plan.rst index cb8b2f1..1f8816d 100644 --- a/test_plans/interrupt_pmd_test_plan.rst +++ b/test_plans/interrupt_pmd_test_plan.rst @@ -1,4 +1,5 @@ .. Copyright (c) <2017>, Intel Corporation + Copyright © 2018[, 2019] The University of New Hampshire. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -63,47 +64,36 @@ in bios. When used vfio, requested to insmod two drivers vfio and vfio-pci. Test Case1: PF interrupt pmd with different queue ================================================= -Run l3fwd-power with one queue per port:: - - l3fwd-power -c 0x7 -n 4 -- -p 0x3 -P --config="(0,0,1),(1,0,2)" - -Send one packet to Port0 and Port1, check that thread on core1 and core2 -waked up:: - - L3FWD_POWER: lcore 1 is waked up from rx interrupt on port1,rxq0 - L3FWD_POWER: lcore 2 is waked up from rx interrupt on port1,rxq0 - -Check the packet has been normally forwarded. - -After the packet forwarded, thread on core1 and core 2 will return to sleep:: +Run l3fwd-power with each port having an lcore assigned to it and 4 queues per core :: - L3FWD_POWER: lcore 1 sleeps until interrupt on port0,rxq0 triggers - L3FWD_POWER: lcore 2 sleeps until interrupt on port0,rxq0 triggers + l3fwd-power -l 1,2,3,4 -n 4 -w 0000:88:00.0 -w 0000:88:00.1 -- -p 0x3 -P \ + --config='(0, 0, 1),(0, 1, 1),(0, 2, 1),(0, 3, 1),(1, 0, 2),(1, 1, 2),(1, 2, 2),(1, 3, 2)' -Send packet flows to Port0 and Port1, check that thread on core1 and core2 will -keep up awake. +Send one packet per option in the config flag :: -Run l3fwd-power with random number queue per port, if is 4:: + L3FWD_POWER: lcore 1 is waked up from rx interrupt on port 0 queue 1 + L3FWD_POWER: lcore 1 sleeps until interrupt triggers + L3FWD_POWER: lcore 1 is waked up from rx interrupt on port 0 queue 0 + L3FWD_POWER: lcore 1 sleeps until interrupt triggers + L3FWD_POWER: lcore 1 is waked up from rx interrupt on port 0 queue 3 + L3FWD_POWER: lcore 1 sleeps until interrupt triggers + L3FWD_POWER: lcore 1 is waked up from rx interrupt on port 0 queue 2 + L3FWD_POWER: lcore 1 sleeps until interrupt triggers + L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 1 queue 1 + L3FWD_POWER: lcore 2 sleeps until interrupt triggers + L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 1 queue 0 + L3FWD_POWER: lcore 2 sleeps until interrupt triggers + L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 1 queue 3 + L3FWD_POWER: lcore 2 sleeps until interrupt triggers + L3FWD_POWER: lcore 2 is waked up from rx interrupt on port 1 queue 2 + L3FWD_POWER: lcore 2 sleeps until interrupt triggers - l3fwd-power -c 0x7 -n 4 -- -p 0x3 -P --config="0,0,0),(0,1,1),\ - (0,2,2),(0,3,3),(0,4,4)" +Check that all configured combinations of port, queue and lcore have been used. -Send packet with increased dest IP to Port0, check that all threads waked up - -Send packet flows to Port0 and Port1, check that thread on core1 and core2 will -keep up awake. - -Run l3fwd-power with 15 queues per port:: - - l3fwd-power -c 0xffffff -n 4 -- -p 0x3 -P --config="(0,0,0),(0,1,1),\ - (0,2,2),(0,3,3),(0,4,4),(0,5,5),(0,6,6),(0,7,7),(1,0,8),\ - (1,1,9),(1,2,10),(1,3,11),(1,4,12),(1,5,13),(1,6,14)" - -Send packet with increased dest IP to Port0, check that all threads waked up +Check that all cores went back to sleep. igb_uio driver only uses one queue 0 - Test Case2: PF lsc interrupt with vfio ====================================== @@ -135,4 +125,4 @@ Compare latency(l3fwd-power PF interrupt pmd with uio) with l3fwd latency. Setup validation scenario the case as test2 Send burst packet flow to Port0 and Port1, use IXIA capture the maximum -latency. +latency. \ No newline at end of file diff --git a/tests/TestSuite_interrupt_pmd.py b/tests/TestSuite_interrupt_pmd.py index 17a58af..3fb43e4 100644 --- a/tests/TestSuite_interrupt_pmd.py +++ b/tests/TestSuite_interrupt_pmd.py @@ -1,6 +1,7 @@ # BSD LICENSE # -# Copyright(c) 2010-2019 Intel Corporation. All rights reserved. +# Copyright(c) 2020 Intel Corporation. All rights reserved. +# Copyright © 2018[, 2019] The University of New Hampshire. All rights reserved. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -46,20 +47,15 @@ class TestInterruptPmd(TestCase): """ Run at the start of each test suite. """ + self.dut.send_expect("modprobe msr", "# ") + self.num_queues = 4 self.dut_ports = self.dut.get_ports(self.nic) self.verify(len(self.dut_ports) >= 2, "Insufficient ports") - cores = self.dut.get_core_list("1S/4C/1T") - self.coremask = utils.create_mask(cores) + self.cores = self.dut.get_core_list("1S/4C/1T") + self.coremask = utils.create_mask(self.cores) self.path = "./examples/l3fwd-power/build/l3fwd-power" - - self.trafficFlow = { - "Flow1": [[0, 0, 1], [1, 0, 2]], - "Flow2": [[0, 0, 0], [0, 1, 1], [0, 2, 2], [0, 3, 3], [0, 4, 4]], - "Flow3": [[0, 0, 0], [0, 1, 1], [0, 2, 2], [0, 3, 3], [0, 4, 4], [0, 5, 5], [0, 6, 6], [0, 7, 7], - [1, 0, 8], [1, 1, 9], [1, 2, 10], [1, 3, 11], [1, 4, 12], [1, 5, 13], [1, 6, 14]], - } # build sample app out = self.dut.build_dpdk_apps("./examples/l3fwd-power") self.verify("Error" not in out, "compilation error 1") @@ -88,35 +84,45 @@ class TestInterruptPmd(TestCase): pass def test_different_queue(self): - cmd = "%s -c %s -n 4 -- -p 0x3 -P --config='(0,0,1),(1,0,2)' "% (self.path, self.coremask) - self.dut.send_expect(cmd, "L3FWD_POWER", 60) - portQueueLcore = self.trafficFlow["Flow1"] - self.verifier_result(2, 2, portQueueLcore) + lcore_configs = [ + (port, queue, lcore + 1) for lcore, port in enumerate(self.dut_ports) for queue in + range(self.num_queues) + ] - self.dut.kill_all() - cmd = "%s -c 0x3f -n 4 -- -p 0x3 -P --config='(0,0,0),(0,1,1),(0,2,2),(0,3,3),(0,4,4)' "% self.path - self.dut.send_expect(cmd, "L3FWD_POWER", 120) - portQueueLcore = self.trafficFlow["Flow2"] - self.verifier_result(20, 1, portQueueLcore) + port_mask = utils.create_mask(self.dut_ports) + config = ','.join(str(cfg_group) for cfg_group in lcore_configs) - self.dut.kill_all() - cmd = "%s -c 0xffffff -n 4 -- -p 0x3 -P --config='(0,0,0),(0,1,1),(0,2,2),(0,3,3),\ - (0,4,4),(0,5,5),(0,6,6),(0,7,7),(1,0,8),(1,1,9),(1,2,10),(1,3,11),\ - (1,4,12),(1,5,13),(1,6,14)' "% self.path + eal_config = { + 'cores': self.cores, + 'ports': [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))] + } + + all_eal_param = self.dut.create_eal_parameters(**eal_config) + + cmd = f"{self.path} {all_eal_param} -- -p {port_mask} -P --config='{config}'" self.dut.send_expect(cmd, "L3FWD_POWER", 60) - portQueueLcore = self.trafficFlow["Flow3"] - self.verifier_result(40, 2, portQueueLcore) + + self.verifier_result(self.num_queues, len(self.dut_ports), lcore_configs) + + self.dut.kill_all() def verifier_result(self, num, portnum, portQueueLcore): self.scapy_send_packet(num, portnum) - result = self.dut.get_session_output(timeout=5) - for i in range(len(portQueueLcore)): - lcorePort = portQueueLcore[i] - self.verify("FWD_POWER: lcore %d is waked up from rx interrupt on port %d queue %d" %(lcorePort[2], - lcorePort[0], lcorePort[1]) in result, "Wrong: lcore %d is waked up failed" % lcorePort[2]) - self.verify("L3FWD_POWER: lcore %d sleeps until interrupt triggers" %( - lcorePort[2]) in result, "Wrong: lcore %d not sleeps until interrupt triggers" % lcorePort[2]) + result: str = self.dut.get_session_output(timeout=5) + for lcorePort in portQueueLcore: + wake_index = result.rfind( + f"FWD_POWER: lcore {lcorePort[2]:d} is waked up from rx interrupt on port " + f"{lcorePort[0]:d} queue {lcorePort[1]:d}") + + self.verify(wake_index >= 0, f"Wrong: lcore {lcorePort[2]:d} is waked up failed") + + sleep_index = result.rfind(f"L3FWD_POWER: lcore {lcorePort[2]:d} sleeps until interrupt triggers") + self.verify(sleep_index >= 0, f"Wrong: lcore {lcorePort[2]:d} not sleeps until interrupt triggers") + + # Make sure that the sleep statement is after the last wake statement + self.verify(sleep_index > wake_index, + f"Wrong: lcore {lcorePort[2]:d} not sleeps until interrupt triggers") def scapy_send_packet(self, num, portnum): """ @@ -128,7 +134,7 @@ class TestInterruptPmd(TestCase): mac = self.dut.get_mac_address(self.dut_ports[i]) txItf = self.tester.get_interface(txport) self.tester.scapy_append( - 'sendp([Ether()/IP(dst="198.0.0.%d")/UDP()/Raw(\'X\'*18)], iface="%s")' % (j, txItf)) + f'sendp([Ether(dst="{mac}")/IP(dst="198.0.0.{j:d}")/UDP()/Raw(\'X\'*18)], iface="{txItf}")') self.tester.scapy_execute() def tear_down(self): @@ -141,5 +147,6 @@ class TestInterruptPmd(TestCase): """ Run after each test suite. """ + self.dut.send_expect("rmmod msr", "# ") self.dut.kill_all() self.set_nic_driver(self.default_driver) -- 2.25.1