DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: keivinwang <keivinwang@126.com>
Cc: <dev@dpdk.org>, <xuanziyang2@huawei.com>,
	<cloud.wangxiaoyun@huawei.com>,  <zhouguoyang@huawei.com>
Subject: Re: [PATCH] net/ixgbe: add param check when tx_queue or rx_queqe is null
Date: Thu, 4 Apr 2024 16:57:11 +0100	[thread overview]
Message-ID: <Zg7N14X0fkSLDh5D@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20240323144842.12331-1-keivinwang@126.com>

On Sat, Mar 23, 2024 at 10:48:42PM +0800, keivinwang wrote:
> add param check when tx_queue or rx_queqe is null.
> 

Hi,

trying to get some context on this patch. Have you encountered a situation
where there are actually NULL parameters getting passed to the functions,
or where an rx queue is unexpectedly NULL? If so, while adding NULL checks
is not a big issue in itself, the values being NULL may indicate a more
serious underlying issue we need to investigate.

> Signed-off-by: keivinwang <keivinwang@126.com>

For a sign-off, the general format is to have both firstname and
second/family name given as separate words.

Thanks,
/Bruce

> ---
>  drivers/net/ixgbe/ixgbe_rxtx.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index f6c17d4efb..245b3527db 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -2539,6 +2539,8 @@ static const struct ixgbe_txq_ops def_txq_ops = {
>  void __rte_cold
>  ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq)
>  {
> +	if (txq == NULL)
> +		return;

Have you encountered a situation where this function can be given a null
parameter?

>  	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
>  	if ((txq->offloads == 0) &&
>  #ifdef RTE_LIB_SECURITY
> @@ -4953,12 +4955,13 @@ ixgbe_set_rx_function(struct rte_eth_dev *dev)
>  
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		struct ixgbe_rx_queue *rxq = dev->data->rx_queues[i];
> -

Similarly here, if nb_rx_queues == X, is it possible a queue between
0..X-1 to be NULL?

> -		rxq->rx_using_sse = rx_using_sse;
> +		if (rxq) {
> +			rxq->rx_using_sse = rx_using_sse;
>  #ifdef RTE_LIB_SECURITY
> -		rxq->using_ipsec = !!(dev->data->dev_conf.rxmode.offloads &
> -				RTE_ETH_RX_OFFLOAD_SECURITY);
> +			rxq->using_ipsec = !!(dev->data->dev_conf.rxmode.offloads &
> +					RTE_ETH_RX_OFFLOAD_SECURITY);
>  #endif
> +		}
>  	}


      reply	other threads:[~2024-04-04 15:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-23 14:48 keivinwang
2024-04-04 15:57 ` Bruce Richardson [this message]

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=Zg7N14X0fkSLDh5D@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=dev@dpdk.org \
    --cc=keivinwang@126.com \
    --cc=xuanziyang2@huawei.com \
    --cc=zhouguoyang@huawei.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).