From patchwork Thu Sep 22 01:59:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 116612 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A9BDAA0540; Thu, 22 Sep 2022 03:58:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8646C40691; Thu, 22 Sep 2022 03:58:54 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id CA87C4067C for ; Thu, 22 Sep 2022 03:58:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663811934; x=1695347934; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YLxAfax4+q59yC0b8fiQp7CBTICOL+NhdoNwye5LXAo=; b=aAGCezS2FoGPiWLD3PSoxXsTMbP3cqpigdPkEahg9+tclxKSlUBWeYW5 yISOnseB3WJFpn+POfJEuDwkBThZXMEYU6kmjOvCyfYmc8iksgcTtvfUM sk0Jyez7x/Ci4PelmLeBL34mmSl5+LYR2SB6jlJxefibRDzuDHMcKVksd A9K+cQPjVvpuy68Y7xh5auchmxzWxk0/nrm1U17Z0BAMDwoEjhdb1E45r VIigSA124GDeElbRW807IU4PxbhUmG3QQ4FthN4E7YSiNWKkJQxyEs+V0 +X4vKcheyP3igL94JMkVKclv819UjfxmijLsMnP6D3GFoLKuucUas2tQg A==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="361935435" X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="361935435" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 18:58:52 -0700 X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="615031249" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 18:58:51 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li Subject: [dts][PATCH V1] tests/kernelpf_iavf: case vf_rss optimization test result check Date: Thu, 22 Sep 2022 09:59:10 +0800 Message-Id: <20220922015910.25797-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Optimize test result inspection according to test plan. Calculate whether the allocated queue result is correct according to the returned hash. Signed-off-by: Weiyuan Li Tested-by: Lingli Chen Acked-by: Peng, Yuan Signed-off-by: Weiyuan Li Acked-by: Lijuan Tu --- tests/TestSuite_kernelpf_iavf.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index a6d4d016..a8cc468a 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -528,11 +528,7 @@ class TestKernelpfIavf(TestCase): return pkt_info def verify_packet_number(self, out): - queue0_number = len(re.findall("port 0/queue 0", out)) - queue1_number = len(re.findall("port 0/queue 1", out)) - queue2_number = len(re.findall("port 0/queue 2", out)) - queue3_number = len(re.findall("port 0/queue 3", out)) - queue_numbers = [queue0_number, queue1_number, queue2_number, queue3_number] + queue_number = len(re.findall("port 0", out)) self.verify( "queue 0" in out and "queue 1" in out @@ -540,10 +536,19 @@ class TestKernelpfIavf(TestCase): and "queue 3" in out, "some queue can't receive packet when send ip packet", ) - self.verify( - max(queue_numbers) - min(queue_numbers) <= 3, - "packet number on each queue should be similar", - ) + p = re.compile("RSS\shash=(\w+)\s-\sRSS\squeue=(\w+)") + pkt_info = p.findall(out) + self.verify(len(pkt_info) == queue_number, "some packets no hash:{}".format(p.pattern)) + hit_rssHash = False + for rss_hash, rss_queue in pkt_info: + for i, j in zip(list(range(64)), [3, 2, 1, 0] * 16): + if int(rss_hash, 16) % 64 == i and int(rss_queue, 16) == j: + hit_rssHash = True + break + else: + hit_rssHash = False + self.verify(hit_rssHash, "some pkt not directed by rss.") + def send_packet(self, itf, tran_type): """