DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Lijun Ou <oulijun@huawei.com>
Cc: dev@dpdk.org, linuxarm@huawei.com
Subject: Re: [dpdk-dev] [PATCH v2 4/5] net/hns3: check PCI config space writes
Date: Fri, 6 Nov 2020 16:45:18 +0000
Message-ID: <ebbd1a47-8fa7-e151-cdd1-753e18d5941b@intel.com> (raw)
In-Reply-To: <1604634716-43484-5-git-send-email-oulijun@huawei.com>

On 11/6/2020 3:51 AM, Lijun Ou wrote:
> Here adds a check for the return value when calling
> rte_pci_write_config.
> 
> Coverity issue: 363714
> Fixes: cea37e513329 ("net/hns3: fix FLR reset")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> ---
> V1->V2:
> - rte_pci_wirte_config -> rte_pci_write_config
> ---
>   drivers/net/hns3/hns3_ethdev_vf.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
> index 2e9bfda..2f6d91b 100644
> --- a/drivers/net/hns3/hns3_ethdev_vf.c
> +++ b/drivers/net/hns3/hns3_ethdev_vf.c
> @@ -139,7 +139,7 @@ hns3vf_enable_msix(const struct rte_pci_device *device, bool op)
>   		ret = rte_pci_read_config(device, &control, sizeof(control),
>   				    (pos + PCI_MSIX_FLAGS));
>   		if (ret < 0) {
> -			PMD_INIT_LOG(ERR, "Failed to read PCI offset 0x%x",
> +			PMD_INIT_LOG(ERR, "failed to read PCI offset 0x%x",

Can you please drop this unrelated change from the patch?

>   				     (pos + PCI_MSIX_FLAGS));
>   			return -ENXIO;
>   		}
> @@ -148,8 +148,12 @@ hns3vf_enable_msix(const struct rte_pci_device *device, bool op)
>   			control |= PCI_MSIX_FLAGS_ENABLE;
>   		else
>   			control &= ~PCI_MSIX_FLAGS_ENABLE;
> -		rte_pci_write_config(device, &control, sizeof(control),
> -				     (pos + PCI_MSIX_FLAGS));
> +		ret = rte_pci_write_config(device, &control, sizeof(control),
> +					  (pos + PCI_MSIX_FLAGS));
> +		if (ret < 0) {
> +			PMD_INIT_LOG(ERR, "failed to write PCI offset 0x%x",
> +				    (pos + PCI_MSIX_FLAGS));
> +		}
>   		return 0;
>   	}
>   	return -ENXIO;
> 


  reply	other threads:[~2020-11-06 16:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 14:23 [dpdk-dev] [PATCH 0/5] bugfix and cleanups for hns3 Lijun Ou
2020-11-05 14:23 ` [dpdk-dev] [PATCH 1/5] net/hns3: use correct logging format symbol Lijun Ou
2020-11-05 14:23 ` [dpdk-dev] [PATCH 2/5] net/hns3: use unsigned types for bit operator Lijun Ou
2020-11-05 14:23 ` [dpdk-dev] [PATCH 3/5] net/hns3: adjust some code style Lijun Ou
2020-11-05 14:23 ` [dpdk-dev] [PATCH 4/5] net/hns3: check PCI config space writes Lijun Ou
2020-11-05 14:23 ` [dpdk-dev] [PATCH 5/5] net/hns3: fix queue enabling status not store after FLR Lijun Ou
2020-11-06  3:51 ` [dpdk-dev] [PATCH v2 0/5] bugfix and cleanups for hns3 Lijun Ou
2020-11-06  3:51   ` [dpdk-dev] [PATCH v2 1/5] net/hns3: use correct logging format symbol Lijun Ou
2020-11-06  3:51   ` [dpdk-dev] [PATCH v2 2/5] net/hns3: use unsigned types for bit operator Lijun Ou
2020-11-06 16:38     ` Ferruh Yigit
2020-11-09  9:21       ` oulijun
2020-11-09  9:28       ` oulijun
2020-11-06  3:51   ` [dpdk-dev] [PATCH v2 3/5] net/hns3: adjust some code style Lijun Ou
2020-11-06 16:44     ` Ferruh Yigit
2020-11-09  9:32       ` oulijun
2020-11-09 10:51         ` Ferruh Yigit
2020-11-06  3:51   ` [dpdk-dev] [PATCH v2 4/5] net/hns3: check PCI config space writes Lijun Ou
2020-11-06 16:45     ` Ferruh Yigit [this message]
2020-11-09 13:44       ` oulijun
2020-11-06  3:51   ` [dpdk-dev] [PATCH v2 5/5] net/hns3: fix queue enabling status not store after FLR Lijun Ou
2020-11-06 16:57     ` Ferruh Yigit
2020-11-09 14:27       ` oulijun
2020-11-09 14:28   ` [dpdk-dev] [PATCH V3 0/6] bugfix and cleanups for hns3 Lijun Ou
2020-11-09 14:28     ` [dpdk-dev] [PATCH V3 1/6] net/hns3: use correct logging format symbol Lijun Ou
2020-11-09 14:28     ` [dpdk-dev] [PATCH V3 2/6] net/hns3: use unsigned types for bit operator Lijun Ou
2020-11-09 14:28     ` [dpdk-dev] [PATCH V3 3/6] net/hns3: adjust code style for initial struct Lijun Ou
2020-11-09 14:29     ` [dpdk-dev] [PATCH V3 4/6] net/hns3: check PCI config space writes Lijun Ou
2020-11-09 14:29     ` [dpdk-dev] [PATCH V3 5/6] net/hns3: fix queue enabling state not store after FLR Lijun Ou
2020-11-09 14:29     ` [dpdk-dev] [PATCH V3 6/6] net/hns3: remove some unnecessary blank lines Lijun Ou
2020-11-10 10:17     ` [dpdk-dev] [PATCH V3 0/6] bugfix and cleanups for hns3 Ferruh Yigit

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=ebbd1a47-8fa7-e151-cdd1-753e18d5941b@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=linuxarm@huawei.com \
    --cc=oulijun@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git