From: Chengchang Tang Date: Tue, 27 Apr 2021 00:54:22 +0000 (+0800) Subject: net/tap: check ioctl on restore X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8f3ca7f9a8b1df13f06236b8ab2dbed238b65ba4;p=dpdk.git net/tap: check ioctl on restore 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 Signed-off-by: Min Hu (Connor) Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 68baa18523..854abf4b30 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1133,8 +1133,11 @@ tap_dev_close(struct rte_eth_dev *dev) if (internals->remote_if_index) { /* Restore initial remote state */ - ioctl(internals->ioctl_sock, SIOCSIFFLAGS, + int ret = ioctl(internals->ioctl_sock, SIOCSIFFLAGS, &internals->remote_initial_flags); + if (ret) + TAP_LOG(ERR, "restore remote state failed: %d", ret); + } rte_mempool_free(internals->gso_ctx_mp);