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 94A49A04DC; Mon, 26 Oct 2020 14:32:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0318A1E2B; Mon, 26 Oct 2020 14:32:11 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 3FA591D9E for ; Mon, 26 Oct 2020 14:32:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603719126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HdM2sCh38NBMroXuqXmQcaWOqSo+89Yjlb/pFKaGzgk=; b=PVbLQenOvTcVAr7OXmd2SmZzt+lycdRJlFEPK6rBmdrlnLpXnUYu5Ku0OmcR/IipBkUrSY aJB2GHXGrYrOKN1CRc4KiIY1npxroQVE+81R2MWGz/i93J9sAO2B9RtBNg9afS4P3/O3DU OKg78IOaqrRWgkHqiNfLGocq1yKaQac= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-532-zHZk4nB3Np-drkRreb-WHA-1; Mon, 26 Oct 2020 09:32:04 -0400 X-MC-Unique: zHZk4nB3Np-drkRreb-WHA-1 Received: by mail-qt1-f199.google.com with SMTP id g11so552506qto.11 for ; Mon, 26 Oct 2020 06:32:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=HdM2sCh38NBMroXuqXmQcaWOqSo+89Yjlb/pFKaGzgk=; b=dI69r6rwvst13yx6hq1yI3B9ohjG2uzD2/dlEejVVyeJviDZ32XmuGCDgwUpLtGz0u XGR0NUJ6ErloW+jGG7ebYA7+hZdIH/ErQHImJkkQBvqgmgwquYowtBwG3YtZfdURz/ov tWgtRl/zb8nPozByZAmywThcECiaGci0Ibtvhg2ho0rt+Pafw9UxgZYGhDQGBfTvPgYd rZ2fddEdXOR3g8P2jjoacM078vcSpRHJvu9dUGoOmuQlps7e/G/5NXVGzHQZJsgFoaEz HqIqlmACRYnFypbrwqG3gZHpO78C2clTHWVpoxl2L7rpCjngolvmjO01bzo5uSx4FJJp quHA== X-Gm-Message-State: AOAM533gk4hiw2IuarOwNytgB93rP4yaV2ke6tCMNORjrJlnpcYX4e4G jnRMx7Kn9g/ZAHoB6CUKihEhNIYP7G/VU5VI8JItABLZbcFSauqWk+8g+av70QWzIrEBEeHG3Kv TsjM= X-Received: by 2002:a05:6214:180f:: with SMTP id o15mr13354860qvw.16.1603719124247; Mon, 26 Oct 2020 06:32:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVDKy1eQWfHpSrHM5bpJilzdg0s5OvLLWUw43+O4rJjyw8BLVjiIeFpMzFgYZubkKB/3IWOg== X-Received: by 2002:a05:6214:180f:: with SMTP id o15mr13354819qvw.16.1603719123937; Mon, 26 Oct 2020 06:32:03 -0700 (PDT) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id m15sm6887813qtc.90.2020.10.26.06.32.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Oct 2020 06:32:03 -0700 (PDT) To: Nicolas Chautru , dev@dpdk.org, akhil.goyal@nxp.com Cc: david.marchand@redhat.com References: <1603496581-35966-1-git-send-email-nicolas.chautru@intel.com> <1603496581-35966-4-git-send-email-nicolas.chautru@intel.com> From: Tom Rix Message-ID: <6863b163-cab4-7c60-750b-d96c7d59172c@redhat.com> Date: Mon, 26 Oct 2020 06:31:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1603496581-35966-4-git-send-email-nicolas.chautru@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=trix@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v5 3/7] app/bbdev: include explicit HARQ preloading 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/23/20 4:42 PM, Nicolas Chautru wrote: > Run preloading explicitly for unit tests. Load each code block > by reusing existing input op then restore for the actual test. > > Signed-off-by: Nicolas Chautru > Acked-by: Liu Tianjiao > --- > app/test-bbdev/main.h | 1 + > app/test-bbdev/test_bbdev_perf.c | 51 +++++++++++++++++++++------------------- > 2 files changed, 28 insertions(+), 24 deletions(-) > > diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h > index fb3dec8..dc10a50 100644 > --- a/app/test-bbdev/main.h > +++ b/app/test-bbdev/main.h > @@ -17,6 +17,7 @@ > #define TEST_SKIPPED 1 > > #define MAX_BURST 512U > +#define MAX_OPS 1024U This #define is not consistently used. ex/ see retrieve_harq_ddr, the old 1024 is still being used. > #define DEFAULT_BURST 32U > #define DEFAULT_OPS 64U > #define DEFAULT_ITER 6U > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index b62848e..f30cbdb 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -2513,20 +2513,20 @@ typedef int (test_case_function)(struct active_device *ad, > bool preload) > { > uint16_t j; > - int ret; > - uint32_t harq_offset = (uint32_t) queue_id * HARQ_INCR * 1024; > - struct rte_bbdev_op_data save_hc_in, save_hc_out; > - struct rte_bbdev_dec_op *ops_deq[MAX_BURST]; > + int deq; > + uint32_t harq_offset = (uint32_t) queue_id * HARQ_INCR * MAX_OPS; > + struct rte_bbdev_op_data save_hc_in[MAX_OPS], save_hc_out[MAX_OPS]; > + struct rte_bbdev_dec_op *ops_deq[MAX_OPS]; > uint32_t flags = ops[0]->ldpc_dec.op_flags; > bool mem_in = flags & RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE; > bool hc_in = flags & RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE; > bool mem_out = flags & RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE; > bool hc_out = flags & RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE; > bool h_comp = flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION; > - for (j = 0; j < n; ++j) { > - if ((mem_in || hc_in) && preload) { > - save_hc_in = ops[j]->ldpc_dec.harq_combined_input; > - save_hc_out = ops[j]->ldpc_dec.harq_combined_output; > + if ((mem_in || hc_in) && preload) { > + for (j = 0; j < n; ++j) { > + save_hc_in[j] = ops[j]->ldpc_dec.harq_combined_input; > + save_hc_out[j] = ops[j]->ldpc_dec.harq_combined_output; > ops[j]->ldpc_dec.op_flags = > RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK + > RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE; flags are usually handled with bit operators, not arithmetic. this seems to be a general issue. > @@ -2536,16 +2536,23 @@ typedef int (test_case_function)(struct active_device *ad, > ops[j]->ldpc_dec.harq_combined_output.offset = > harq_offset; > ops[j]->ldpc_dec.harq_combined_input.offset = 0; > - rte_bbdev_enqueue_ldpc_dec_ops(dev_id, queue_id, > - &ops[j], 1); > - ret = 0; > - while (ret == 0) > - ret = rte_bbdev_dequeue_ldpc_dec_ops( > - dev_id, queue_id, &ops_deq[j], 1); > + harq_offset += HARQ_INCR; > + } > + rte_bbdev_enqueue_ldpc_dec_ops(dev_id, queue_id, &ops[0], n); Add check the return is 'n' > + deq = 0; > + while (deq != n) > + deq += rte_bbdev_dequeue_ldpc_dec_ops( > + dev_id, queue_id, &ops_deq[deq], > + n - deq); Add check the return >= 0 Tom > + /* Restore the operations */ > + for (j = 0; j < n; ++j) { > ops[j]->ldpc_dec.op_flags = flags; > - ops[j]->ldpc_dec.harq_combined_input = save_hc_in; > - ops[j]->ldpc_dec.harq_combined_output = save_hc_out; > + ops[j]->ldpc_dec.harq_combined_input = save_hc_in[j]; > + ops[j]->ldpc_dec.harq_combined_output = save_hc_out[j]; > } > + } > + harq_offset = (uint32_t) queue_id * HARQ_INCR * MAX_OPS; > + for (j = 0; j < n; ++j) { > /* Adjust HARQ offset when we reach external DDR */ > if (mem_in || hc_in) > ops[j]->ldpc_dec.harq_combined_input.offset > @@ -3231,11 +3238,9 @@ typedef int (test_case_function)(struct active_device *ad, > mbuf_reset( > ops_enq[j]->ldpc_dec.harq_combined_output.data); > } > - if (extDdr) { > - bool preload = i == (TEST_REPETITIONS - 1); > + if (extDdr) > preload_harq_ddr(tp->dev_id, queue_id, ops_enq, > - num_ops, preload); > - } > + num_ops, true); > start_time = rte_rdtsc_precise(); > > for (enq = 0, deq = 0; enq < num_ops;) { > @@ -3362,11 +3367,9 @@ typedef int (test_case_function)(struct active_device *ad, > mbuf_reset( > ops_enq[j]->ldpc_dec.harq_combined_output.data); > } > - if (extDdr) { > - bool preload = i == (TEST_REPETITIONS - 1); > + if (extDdr) > preload_harq_ddr(tp->dev_id, queue_id, ops_enq, > - num_ops, preload); > - } > + num_ops, true); > start_time = rte_rdtsc_precise(); > > for (enq = 0, deq = 0; enq < num_ops;) {