From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Kaijun Zeng <corezeng@gmail.com>, jbehrens@vmware.com
Cc: dev@dpdk.org
Subject: Re: [PATCH] drivers: fix vmxnet3 return wrong error code in initializing
Date: Thu, 1 Jun 2023 16:12:17 +0100 [thread overview]
Message-ID: <9c2780cc-2e8d-3d4a-5e43-cb2cd848b1a9@amd.com> (raw)
In-Reply-To: <20230528143734.145326-1-user@sklga>
On 5/28/2023 3:37 PM, root wrote:
> From: Kaijun Zeng <corezeng@gmail.com>
>
> In vmxnet3_dev_rxtx_init(), a wrong error code may be thrown after it invokes
> vmxnet3_post_rx_bufs() because it negates the error code before returning it.
> It causes rte_eth_dev_start() to give a positive number to the invoker, but it
> should be a negative number, as described in the comments.
>
> Bugzilla ID: 1239
>
> Signed-off-by: Kaijun Zeng <corezeng@gmail.com>
> ---
> drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> index a875ffec07..73ec1e4727 100644
> --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> @@ -1315,7 +1315,7 @@ vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev)
> PMD_INIT_LOG(ERR,
> "ERROR: Posting Rxq: %d buffers ring: %d",
> i, j);
> - return -ret;
> + return ret;
Hi Kaijun,
Thanks for the fix, it looks valid.
But 'ret' being 0 also seems problematic, mentioned code is as following:
```
ret = vmxnet3_post_rx_bufs(rxq, j);
if (ret <= 0) {
PMD_INIT_LOG(ERR,
"ERROR: Posting Rxq: %d buffers ring: %d", i, j);
return ret;
}
```
'vmxnet3_dev_rxtx_init()' can return 0 and failure, but caller will take
it as success.
Perhaps better to send an explicit error:
```
if (ret <= 0) {
...
return -EXXX
}
```
btw, for the next version of the patch, please use 'net/vmxnet3: '
prefix for patch title, like:
"net/vmxnet3: fix return code in initializing"
Also please include following Fixes tag in the commit log:
```
Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver
implementation")
Cc: stable@dpdk.org
```
For more details you can check contribution guide:
https://doc.dpdk.org/guides/contributing/patches.html#commit-messages-subject-line
next prev parent reply other threads:[~2023-06-01 15:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-28 14:37 root
2023-06-01 15:12 ` Ferruh Yigit [this message]
2023-06-02 16:44 ` [PATCH v2] net/vmxnet3: fix return " Kaijun Zeng
2023-06-06 9:08 ` Ferruh Yigit
2023-06-06 15:36 ` Stephen Hemminger
2023-06-07 15:49 ` Ferruh Yigit
2023-06-07 17:57 ` [PATCH v3] " Kaijun Zeng
2023-06-09 18:08 ` Ferruh Yigit
2023-06-07 16:54 ` [PATCH] " Kaijun Zeng
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=9c2780cc-2e8d-3d4a-5e43-cb2cd848b1a9@amd.com \
--to=ferruh.yigit@amd.com \
--cc=corezeng@gmail.com \
--cc=dev@dpdk.org \
--cc=jbehrens@vmware.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).