From patchwork Fri Aug 12 15:51:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 114855 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 C75A8A0543; Fri, 12 Aug 2022 09:34:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A73C406A2; Fri, 12 Aug 2022 09:34:23 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 4A45C40697 for ; Fri, 12 Aug 2022 09:34:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660289662; x=1691825662; h=from:to:cc:subject:date:message-id; bh=vw2pUgLSs7sWvnZTm2exRYaALEDyFm0PhgtUmW2gXoE=; b=jq1D4Xjh29lx/ud77hhmY+wj9L+ZomCkk5v3G9UMFafoeg2Nj84HpWir Zq6UmLH2nTOk3gD2xzyaxvLM2LT09EYWKEvzfiQV+SSu4UPlbEKEnTc9A N1i0EqVBbs0QUH1GMGK5sQa+pZ6h+MY2TjZwgmRutQg9I3+6Uk4GSFE88 LAVGcskkUM9soCFMb2eLb7Vwo2lmcIw4J8QFRNBvn9Ak9hHllFuMKsfXc 44H1SaGxMNFQmtReAyE2V3Wn8C+JQQhXxqWDIe/s9jnbd+4h00OduFdAA W5+FfYP98YT9+4sPLYEJaDI9c6M6whQ3QJ/1CelNIgljicfJ5PjXwY0s2 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10436"; a="353285547" X-IronPort-AV: E=Sophos;i="5.93,231,1654585200"; d="scan'208";a="353285547" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2022 00:34:21 -0700 X-IronPort-AV: E=Sophos;i="5.93,231,1654585200"; d="scan'208";a="634551217" Received: from unknown (HELO DPDK-CVL-tetser102.icx.intel.com) ([10.239.252.92]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2022 00:34:19 -0700 From: Hongbo Li To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Hongbo Li Subject: [PATCH V1] tests/TestSuite_macsec_for_ixgbe:adapt to different CPUs Date: Fri, 12 Aug 2022 15:51:52 +0000 Message-Id: <20220812155152.17733-1-hongbox.li@intel.com> X-Mailer: git-send-email 2.17.1 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 According to the explanation of the DPDK developer, setting the same PN value on different CPUs will have different behaviors. This patch is used to help case adapt different CPUs. Signed-off-by: Hongbo Li Acked-by: Lijuan Tu --- test_plans/macsec_for_ixgbe_test_plan.rst | 8 ++++-- tests/TestSuite_macsec_for_ixgbe.py | 32 ++++++++++++++++------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/test_plans/macsec_for_ixgbe_test_plan.rst b/test_plans/macsec_for_ixgbe_test_plan.rst index 22218bb8..b2c8ecda 100644 --- a/test_plans/macsec_for_ixgbe_test_plan.rst +++ b/test_plans/macsec_for_ixgbe_test_plan.rst @@ -223,10 +223,14 @@ Test Case 3: MACsec send and receive with different parameters It can't be set successfully. 3. Set "pn" to 0xffffffec on both rx and tx sides. - Rx port can receive four packets. + Rx port can receive four packets.But the expected number + of packets is 3/4/5 While the explanation that DPDK developers + gave is that it's hardware's behavior. Set "pn" to 0xffffffed on both rx and tx sides. - Rx port can receive three packets. + Rx port can receive three packets.But the expected number + of packets is 3/4. While the explanation that DPDK developers + gave is that it's hardware's behavior. Set "pn" to 0xffffffee/0xffffffef on both rx and tx sides. Rx port can receive three packets too. But the expected number diff --git a/tests/TestSuite_macsec_for_ixgbe.py b/tests/TestSuite_macsec_for_ixgbe.py index 643b3dee..ade31e0b 100644 --- a/tests/TestSuite_macsec_for_ixgbe.py +++ b/tests/TestSuite_macsec_for_ixgbe.py @@ -236,6 +236,26 @@ class TestMacsecForIxgbe(TestCase): "MACsec pkts receive failed", ) + def check_pn_boundary_value(self, i, pkt_num): + if i == "0xffffffec": + try: + self.verify(int(pkt_num) == 4, "Rx port can't receive 4 pkts") + except: + self.verify( + int(pkt_num) in [3, 4, 5], "Rx port can't receive the expected pkts" + ) + msg = ( + str(pkt_num) + + " packages received, the hardware behavior is different on each series of CPUs" + ) + self.logger.warning(msg) + finally: + self.clear_port_xstats() + else: + self.verify( + int(pkt_num) in [1, 2, 3, 4], "Rx port can't receive the expected pkts" + ) + def test_MACsec_pkts_tx_and_rx(self): """ MACsec packets send and receive @@ -364,15 +384,9 @@ class TestMacsecForIxgbe(TestCase): 0, 0, 0, i, "00112200000000000000000000000000" ) pkt_num = self.packets_receive_num() - if i == "0xffffffec": - self.verify(int(pkt_num[0]) == 4, "Rx port can't receive four pkts") - self.clear_port_xstats() - else: - self.verify( - int(pkt_num[0]) == 3, "Rx port can't receive three pkts" - ) - self.session_sec.send_expect("quit", "#") - self.dut.send_expect("quit", "#") + self.check_pn_boundary_value(i, int(pkt_num[0])) + self.session_sec.send_expect("quit", "#") + self.dut.send_expect("quit", "#") # subcase4:set various key on rx and tx port for i in [