All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Min Hu (Connor)" <humin29@huawei.com>, dev@dpdk.org
Cc: keith.wiles@intel.com
Subject: Re: [dpdk-dev] [PATCH 1/2] net/tap: fix log loss when state fails to be restored
Date: Mon, 26 Apr 2021 16:30:02 +0100	[thread overview]
Message-ID: <7a033aca-b3d4-fce8-91e0-6b7e6c4a5c7f@intel.com> (raw)
In-Reply-To: <1619090834-14643-2-git-send-email-humin29@huawei.com>

On 4/22/2021 12:27 PM, Min Hu (Connor) wrote:
> From: Chengchang Tang <tangchengchang@huawei.com>
> 
> After restoring the remote states, the return value of ioctl() is not
> checked. Therefore, users cannot know whether the remote state is
> restored successfully.
> 
> This patch add log for restoring failure.
> 
> Fixes: 4810d3af8343 ("net/tap: restore state of remote device when closing")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  drivers/net/tap/rte_eth_tap.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index 68baa18..6007c78 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -1101,6 +1101,7 @@ tap_dev_close(struct rte_eth_dev *dev)
>  	struct pmd_internals *internals = dev->data->dev_private;
>  	struct pmd_process_private *process_private = dev->process_private;
>  	struct rx_queue *rxq;
> +	int ret;
>  
>  	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
>  		rte_free(dev->process_private);
> @@ -1133,8 +1134,11 @@ tap_dev_close(struct rte_eth_dev *dev)
>  
>  	if (internals->remote_if_index) {
>  		/* Restore initial remote state */
> -		ioctl(internals->ioctl_sock, SIOCSIFFLAGS,
> +		ret = ioctl(internals->ioctl_sock, SIOCSIFFLAGS,
>  				&internals->remote_initial_flags);
> +		if (ret)
> +			TAP_LOG(ERR, "restore remote state failed: %d", ret);
> +

'ret' is used only in this scope, can you please move the variable declaration
at the beginning of the this if block?
You can do something like "int ret = ioctl(...."


>  	}
>  
>  	rte_mempool_free(internals->gso_ctx_mp);
> 


  reply	other threads:[~2021-04-26 15:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 11:27 [dpdk-dev] [PATCH 0/2] bugfix for tap device Min Hu (Connor)
2021-04-22 11:27 ` [dpdk-dev] [PATCH 1/2] net/tap: fix log loss when state fails to be restored Min Hu (Connor)
2021-04-26 15:30   ` Ferruh Yigit [this message]
2021-04-27  0:54     ` Min Hu (Connor)
2021-04-27  0:54   ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
2021-04-29 13:36     ` Ferruh Yigit
2021-04-22 11:27 ` [dpdk-dev] [PATCH 2/2] net/tap: fix tap interrupt vector array size Min Hu (Connor)
2021-04-22 15:20   ` Stephen Hemminger
2021-04-23  9:34     ` Min Hu (Connor)
2021-04-26 15:31   ` 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=7a033aca-b3d4-fce8-91e0-6b7e6c4a5c7f@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=humin29@huawei.com \
    --cc=keith.wiles@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.