From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0BE022BBE; Mon, 10 Apr 2017 16:55:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491836134; x=1523372134; h=from:to:cc:subject:date:message-id; bh=poJWglU7zVs6YZ+p/jubFjh+RTXMGby/HJpmCH8u7mo=; b=ZiKdlOrmnR3lDaxz9y4s7ApMMMLhQ7JfaqxENvb8oMzHyrxgJwDpDNZs GYxpBTNntkDlckto5qBrYQt3zwy4LQ==; Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2017 07:55:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,182,1488873600"; d="scan'208";a="86953487" Received: from silpixa00381633.ir.intel.com (HELO silpixa00381633.ger.corp.intel.com) ([10.237.222.114]) by fmsmga005.fm.intel.com with ESMTP; 10 Apr 2017 07:55:31 -0700 From: Fan Zhang To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, stable@dpdk.org Date: Mon, 10 Apr 2017 15:57:22 +0100 Message-Id: <1491836242-124659-1-git-send-email-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: fix crypto operation resubmission X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 14:55:34 -0000 This patch fixes the crypto operation resubmission problem in crypto perferformance test. Originally, when needed crypto ops amount is smaller than the enqueued crypto ops in the last round, one or more processed crypto operations will be re-enqueued. Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Signed-off-by: Fan Zhang --- app/test-crypto-perf/cperf_test_throughput.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index 70ec4ff..0f635b9 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -348,6 +348,16 @@ cperf_throughput_test_runner(void *test_ctx) ops_needed, ctx->sess, ctx->options, ctx->test_vector); + /** + * When ops_needed is smaller than ops_enqd, the + * unused ops need to be moved to the front for + * next round use. + */ + if (unlikely(ops_enqd > ops_needed)) + memmove(&ops[ops_needed], + &ops[ops_enqd - ops_needed], + burst_size - ops_needed); + #ifdef CPERF_LINEARIZATION_ENABLE if (linearize) { /* PMD doesn't support scatter-gather and source buffer -- 2.7.4