From: Tom Rix <trix@redhat.com>
To: "Chautru, Nicolas" <nicolas.chautru@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"akhil.goyal@nxp.com" <akhil.goyal@nxp.com>
Cc: "david.marchand@redhat.com" <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v5 3/7] app/bbdev: include explicit HARQ preloading
Date: Wed, 28 Oct 2020 13:33:57 -0700 [thread overview]
Message-ID: <c8783dc2-295f-5ef3-53d3-3f76628fe41f@redhat.com> (raw)
In-Reply-To: <BY5PR11MB44517E6ABF75088F5D5EA4F9F8190@BY5PR11MB4451.namprd11.prod.outlook.com>
On 10/26/20 9:50 AM, Chautru, Nicolas wrote:
>> -----Original Message-----
>> From: Tom Rix <trix@redhat.com>
>> Sent: Monday, October 26, 2020 6:32 AM
>> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
>> akhil.goyal@nxp.com
>> Cc: david.marchand@redhat.com
>> Subject: Re: [PATCH v5 3/7] app/bbdev: include explicit HARQ preloading
>>
>>
>> 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 <nicolas.chautru@intel.com>
>>> Acked-by: Liu Tianjiao <tianjiao.liu@intel.com>
>>> ---
>>> 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.
> Thanks I missed it. I will change this now.
>
>>> #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.
> This is keeping same coding style as rest of file. So keeping as is.
Ugh. Add to a cleanup list.
>
>>> @@ -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
> This cannot be <0. uint16_t
ok
Tom
>
>> 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;) {
next prev parent reply other threads:[~2020-10-28 20:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 23:42 [dpdk-dev] [PATCH v5 0/7] BBDEV test updates Nicolas Chautru
2020-10-23 23:42 ` [dpdk-dev] [PATCH v5 1/7] app/bbdev: add explicit ut for latency vs validation Nicolas Chautru
2020-10-26 12:55 ` Tom Rix
2020-10-26 17:30 ` Chautru, Nicolas
2020-10-28 20:37 ` Tom Rix
2020-10-23 23:42 ` [dpdk-dev] [PATCH v5 2/7] app/bbdev: add explicit check for counters Nicolas Chautru
2020-10-26 13:05 ` Tom Rix
2020-10-26 16:29 ` Chautru, Nicolas
2020-10-28 20:31 ` Tom Rix
2020-10-23 23:42 ` [dpdk-dev] [PATCH v5 3/7] app/bbdev: include explicit HARQ preloading Nicolas Chautru
2020-10-26 13:31 ` Tom Rix
2020-10-26 16:50 ` Chautru, Nicolas
2020-10-28 20:33 ` Tom Rix [this message]
2020-10-23 23:42 ` [dpdk-dev] [PATCH v5 4/7] app/bbdev: define wait for offload Nicolas Chautru
2020-10-26 13:33 ` Tom Rix
2020-10-26 16:04 ` Chautru, Nicolas
2020-10-28 20:24 ` Tom Rix
2020-10-23 23:42 ` [dpdk-dev] [PATCH v5 5/7] app/bbdev: skip bler ut when compression is used Nicolas Chautru
2020-10-26 13:35 ` Tom Rix
2020-10-23 23:43 ` [dpdk-dev] [PATCH v5 6/7] app/bbdev: reduce duration of throughput test Nicolas Chautru
2020-10-26 13:39 ` Tom Rix
2020-10-23 23:43 ` [dpdk-dev] [PATCH v5 7/7] app/bbdev: update offload test to dequeue full ring Nicolas Chautru
2020-10-26 13:55 ` Tom Rix
2020-10-26 16:27 ` Chautru, Nicolas
2020-10-28 20:28 ` Tom Rix
2020-10-24 7:47 ` [dpdk-dev] [PATCH v5 0/7] BBDEV test updates David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8783dc2-295f-5ef3-53d3-3f76628fe41f@redhat.com \
--to=trix@redhat.com \
--cc=akhil.goyal@nxp.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=nicolas.chautru@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).