From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9FD4EA0C45; Wed, 1 Sep 2021 16:00:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32B884013F; Wed, 1 Sep 2021 16:00:54 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4B2D440041 for ; Wed, 1 Sep 2021 16:00:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630504851; 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=B9H5gVeOm9pfat3olO6wcPnV6bidd8usExgUSbu0mjI=; b=QI2KphSaL2sxyM0/UwDVX+eBtGzZ+AUYPQ06PcC1bUPhUDNXU8nlpr4WlpfDE7prw6Trec TGyRi/QzlLOI1dEgfTu0ZyfClq95EFDCMCLHAfmxQMueXkco7yn1tXFGw2F4pBsTwgq8+T ngkZ0m04Xn8H8bCvNu2OyZOimgtmeNU= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-524-eQpfLwbnNbW6R16yYMCNGQ-1; Wed, 01 Sep 2021 10:00:50 -0400 X-MC-Unique: eQpfLwbnNbW6R16yYMCNGQ-1 Received: by mail-oo1-f70.google.com with SMTP id t1-20020a4ad0a1000000b0028bbf04eae9so1442535oor.10 for ; Wed, 01 Sep 2021 07:00:50 -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=B9H5gVeOm9pfat3olO6wcPnV6bidd8usExgUSbu0mjI=; b=mQJP8fkSQgEKi5xST/UG9mvPkrhyImqvKVJ8GHAJtdqbyM5t2TnHb/3EdXnslYvF5b zKwnxBMTgITiHzEHklbV2VHdIV/AckAQFdS9Td6+LEPJ1vQWyexeA7itemc06TbjL3fP z2QAByRblWLQseWh49aSER/HtIfW0liiClHxcFHPXLmlj74OqDih4jwrGY7QUjRKfVTX PyneRb8Jpzf7lA4s3upsOMRQy8K6UhB84bnEYb1bTBqZrMBabQhmduC7sClU9yIcgIEh Cntrgh4rY1v2NLIhk07Hf5JownROxLvFmM9UNMpyW8WAoV6KgYSu907/w/H8IlZA++ND juzg== X-Gm-Message-State: AOAM531GAdqbZaau4SBek6fDpj5W/SDPKhC0jP+uo1/Tn4TlPAE456Ij SOYTBLdYqRlAgnwrg7VqJvmuEh+qUoiY4WYSjfEUShtUL3b/fLqCmT1bdRyO6CpW3z0EULWGzIx DRyE= X-Received: by 2002:a4a:45cc:: with SMTP id y195mr19284036ooa.52.1630504849421; Wed, 01 Sep 2021 07:00:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3dYNE+TYrFeFNzPxF/zv5rwK+xSp/CdTUQBjsDpcrM3K1JE5udzPhCn0SEZ6cSzps7nTMKg== X-Received: by 2002:a4a:45cc:: with SMTP id y195mr19283992ooa.52.1630504848856; Wed, 01 Sep 2021 07:00:48 -0700 (PDT) Received: from localhost.localdomain (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id y138sm4256895oie.22.2021.09.01.07.00.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Sep 2021 07:00:48 -0700 (PDT) To: Nicolas Chautru , dev@dpdk.org, gakhil@marvell.com Cc: thomas@monjalon.net, hemant.agrawal@nxp.com, mingshan.zhang@intel.com, arun.joshi@intel.com References: <1629407410-28822-1-git-send-email-nicolas.chautru@intel.com> <1629407410-28822-3-git-send-email-nicolas.chautru@intel.com> From: Tom Rix Message-ID: <84d57bd1-fd6e-135f-3554-bab6bc46fe19@redhat.com> Date: Wed, 1 Sep 2021 07:00:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <1629407410-28822-3-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; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v2 2/6] baseband/turbo_sw: add support for CRC16 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 8/19/21 2:10 PM, Nicolas Chautru wrote: > This is to support the case for operation > where CRC16 is to be appended or checked. > > Signed-off-by: Nicolas Chautru > --- > doc/guides/rel_notes/release_21_11.rst | 3 +++ > drivers/baseband/turbo_sw/bbdev_turbo_software.c | 17 +++++++++++++++++ > 2 files changed, 20 insertions(+) > > diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst > index 69dd518..8ca59b7 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -55,6 +55,9 @@ New Features > Also, make sure to start the actual text at the margin. > ======================================================= > > +* **Updated the turbo_sw bbdev PMD.** > + > + Added support for more comprehensive CRC options. > > Removed Items > ------------- > diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c > index 77e9a2e..e570044 100644 > --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c > +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c > @@ -199,6 +199,7 @@ struct turbo_sw_queue { > .cap.ldpc_enc = { > .capability_flags = > RTE_BBDEV_LDPC_RATE_MATCH | > + RTE_BBDEV_LDPC_CRC_16_ATTACH | > RTE_BBDEV_LDPC_CRC_24A_ATTACH | > RTE_BBDEV_LDPC_CRC_24B_ATTACH, > .num_buffers_src = > @@ -211,6 +212,7 @@ struct turbo_sw_queue { > .type = RTE_BBDEV_OP_LDPC_DEC, > .cap.ldpc_dec = { > .capability_flags = > + RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK | > RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | > RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | > RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP | > @@ -880,6 +882,12 @@ struct turbo_sw_queue { > crc_req.len = in_length_in_bits - 24; > crc_resp.data = q->enc_in; > bblib_lte_crc24b_gen(&crc_req, &crc_resp); > + } else if (enc->op_flags & RTE_BBDEV_LDPC_CRC_16_ATTACH) { The 'else if' assumes the new flag is mutually exclusive wrt the other crc flags. At least a debug check should be added to verify. > + rte_memcpy(q->enc_in, in, in_length_in_bytes - 2); > + crc_req.data = in; > + crc_req.len = in_length_in_bits - 16; > + crc_resp.data = q->enc_in; > + bblib_lte_crc16_gen(&crc_req, &crc_resp); > } else > rte_memcpy(q->enc_in, in, in_length_in_bytes); > > @@ -1492,6 +1500,15 @@ struct turbo_sw_queue { > if (!crc_resp.check_passed) > op->status |= 1 << RTE_BBDEV_CRC_ERROR; > } > + if (check_bit(dec->op_flags, RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK)) { The series of 'if-statements' means the new flag is not mutually exclusive wrt the other crc flags. doing both 24a and 16 would create a mess. this should likely change to an else-if-statement similar to above. Tom > + crc_req.data = adapter_input; > + crc_req.len = K - dec->n_filler - 16; > + crc_resp.check_passed = false; > + crc_resp.data = adapter_input; > + bblib_lte_crc16_check(&crc_req, &crc_resp); > + if (!crc_resp.check_passed) > + op->status |= 1 << RTE_BBDEV_CRC_ERROR; > + } > > #ifdef RTE_BBDEV_OFFLOAD_COST > q_stats->acc_offload_cycles += rte_rdtsc_precise() - start_time;