DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Nicolas Chautru <nicolas.chautru@intel.com>,
	hernan.vargas@intel.com, dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [PATCH v2 1/9] baseband/acc: protection for TB negative scenario
Date: Thu, 23 Feb 2023 09:56:49 +0100	[thread overview]
Message-ID: <e5c5da4c-dbd3-32cf-d7e1-35cc67fdb4c0@redhat.com> (raw)
In-Reply-To: <20230210175841.303450-2-nicolas.chautru@intel.com>



On 2/10/23 18:58, Nicolas Chautru wrote:
> Adding handling of negative scenario for malformed
> Transport Block mode operations.
> 
> Fixes: bec597b78a0 ("baseband/acc200: add LTE processing")

The format is invalid, the sha-1 should be 12B long, checkpatch
complains about it:

WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12 chars 
of sha1> ("<title line>")' - ie: 'Fixes: bec597b78a0e ("baseband/acc200: 
add LTE processing")'
#9:
Fixes: bec597b78a0 ("baseband/acc200: add LTE processing")


I will fix it here and in other patches.
To avoid such issues, you can add an alias in your git global config
file (e.g. ~/.gitconfig):

[alias]
	fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'

With this, to generate a Fixes tag, you just have to do:

$ git fixline bec597b78a0e347f7a82a0d51e4a9fc61dea0a16
Fixes: bec597b78a0e ("baseband/acc200: add LTE processing")
Cc: nicolas.chautru@intel.com

Hernan, this issue is also present in "baseband/acc: fix check after
deref and dead code", I will also fix it while applying, but please
consider adding the git alias.

Thanks,
Maxime

> Cc: stable@dpdk.org
> 
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>   drivers/baseband/acc/rte_vrb_pmd.c | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
> index 34e42d1f6e..3afaea71a3 100644
> --- a/drivers/baseband/acc/rte_vrb_pmd.c
> +++ b/drivers/baseband/acc/rte_vrb_pmd.c
> @@ -1820,6 +1820,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
>   	r = op->turbo_enc.tb_params.r;
>   
>   	while (mbuf_total_left > 0 && r < c) {
> +		if (unlikely((input == NULL) || (output == NULL)))
> +			return -1;
> +
>   		seg_total_left = rte_pktmbuf_data_len(input) - in_offset;
>   		/* Set up DMA descriptor */
>   		desc = acc_desc(q, total_enqueued_cbs);
> @@ -1854,6 +1857,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
>   		r++;
>   	}
>   
> +	/* In case the number of CB doesn't match, the configuration was invalid. */
> +	if (unlikely(current_enqueued_cbs != cbs_in_tb))
> +		return -1;
> +
>   	/* Set SDone on last CB descriptor for TB mode. */
>   	desc->req.sdone_enable = 1;
>   
> @@ -2100,6 +2107,9 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
>   	}
>   
>   	while (mbuf_total_left > 0 && r < c) {
> +		if (unlikely((input == NULL) || (h_output == NULL)))
> +			return -1;
> +
>   		if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_DEC_SCATTER_GATHER))
>   			seg_total_left = rte_pktmbuf_data_len(input) - in_offset;
>   		else
> @@ -2145,6 +2155,10 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
>   		r++;
>   	}
>   
> +	/* In case the number of CB doesn't match, the configuration was invalid. */
> +	if (unlikely(current_enqueued_cbs != cbs_in_tb))
> +		return -1;
> +
>   #ifdef RTE_LIBRTE_BBDEV_DEBUG
>   	if (check_mbuf_total_left(mbuf_total_left) != 0)
>   		return -EINVAL;
> @@ -2187,6 +2201,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
>   	r = op->turbo_dec.tb_params.r;
>   
>   	while (mbuf_total_left > 0 && r < c) {
> +		if (unlikely((input == NULL) || (h_output == NULL)))
> +			return -1;
>   
>   		seg_total_left = rte_pktmbuf_data_len(input) - in_offset;
>   
> @@ -2237,6 +2253,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
>   		r++;
>   	}
>   
> +	/* In case the number of CB doesn't match, the configuration was invalid. */
> +	if (unlikely(current_enqueued_cbs != cbs_in_tb))
> +		return -1;
> +
>   	/* Set SDone on last CB descriptor for TB mode */
>   	desc->req.sdone_enable = 1;
>   


  reply	other threads:[~2023-02-23  8:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 22:19 [PATCH v1 0/9] baseband/acc: VRB PMD fixes Nicolas Chautru
2023-02-09 22:19 ` [PATCH v1 1/9] baseband/acc: protection for TB negative scenario Nicolas Chautru
2023-02-10  8:17   ` Maxime Coquelin
2023-02-10 17:28     ` Chautru, Nicolas
2023-02-10 17:58   ` [PATCH v2 0/9] baseband/acc: VRB PMD fixes Nicolas Chautru
2023-02-10 17:58     ` [PATCH v2 1/9] baseband/acc: protection for TB negative scenario Nicolas Chautru
2023-02-23  8:56       ` Maxime Coquelin [this message]
2023-02-23 17:25         ` Chautru, Nicolas
2023-02-10 17:58     ` [PATCH v2 2/9] baseband/acc: remove interrupt support on VRB1 Nicolas Chautru
2023-02-10 17:58     ` [PATCH v2 3/9] baseband/acc: add explicit mbuf append for soft output Nicolas Chautru
2023-02-22 11:20       ` Maxime Coquelin
2023-02-10 17:58     ` [PATCH v2 4/9] baseband/acc: prevent to dequeue more than requested Nicolas Chautru
2023-02-10 17:58     ` [PATCH v2 5/9] baseband/acc: fix iteration counter in TB mode Nicolas Chautru
2023-02-10 17:58     ` [PATCH v2 6/9] baseband/acc: fix potential arithmetic overflow Nicolas Chautru
2023-02-10 17:58     ` [PATCH v2 7/9] baseband/acc: add support for 4GUL CRC drop in VRB PMD Nicolas Chautru
2023-02-10 17:58     ` [PATCH v2 8/9] baseband/acc: add support for 4GUL with SO and TB Nicolas Chautru
2023-02-10 17:58     ` [PATCH v2 9/9] baseband/acc: remove printf from PMD function Nicolas Chautru
2023-02-23  9:28     ` [PATCH v2 0/9] baseband/acc: VRB PMD fixes Maxime Coquelin
2023-02-09 22:19 ` [PATCH v1 2/9] baseband/acc: add support for 4GUL with SO and TB Nicolas Chautru
2023-02-10  8:30   ` Maxime Coquelin
2023-02-10 17:29     ` Chautru, Nicolas
2023-02-09 22:19 ` [PATCH v1 3/9] baseband/acc: remove interrupt support on VRB1 Nicolas Chautru
2023-02-10  8:31   ` Maxime Coquelin
2023-02-09 22:19 ` [PATCH v1 4/9] baseband/acc: add explicit mbuf apend for soft output Nicolas Chautru
2023-02-10  8:40   ` Maxime Coquelin
2023-02-10 17:35     ` Chautru, Nicolas
2023-02-09 22:19 ` [PATCH v1 5/9] baseband/acc: prevent to dequeue more than requested Nicolas Chautru
2023-02-10  9:39   ` Maxime Coquelin
2023-02-09 22:19 ` [PATCH v1 6/9] baseband/acc: fix iteration counter in TB mode Nicolas Chautru
2023-02-10  9:40   ` Maxime Coquelin
2023-02-09 22:19 ` [PATCH v1 7/9] baseband/acc: fix potential arithmetic overflow Fix potential issue of overflow causing coverity warning Nicolas Chautru
2023-02-10  9:41   ` Maxime Coquelin
2023-02-09 22:19 ` [PATCH v1 8/9] baseband/acc: add support for 4GUL CRC drop in VRB PMD Nicolas Chautru
2023-02-10  9:43   ` Maxime Coquelin
2023-02-09 22:19 ` [PATCH v1 9/9] baseband/acc: remove printf from PMD function Nicolas Chautru
2023-02-10  9:45   ` Maxime Coquelin
2023-02-10 17:46     ` Chautru, Nicolas

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=e5c5da4c-dbd3-32cf-d7e1-35cc67fdb4c0@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hernan.vargas@intel.com \
    --cc=nicolas.chautru@intel.com \
    --cc=stable@dpdk.org \
    /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).