Skip to content

Commit

Permalink
net/tap: check ioctl on restore
Browse files Browse the repository at this point in the history
[ upstream commit 8f3ca7f ]

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: 4810d3a ("net/tap: restore state of remote device when closing")

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
Chengchang Tang authored and steevenlee committed Jun 8, 2021
1 parent 6af34d2 commit 3caffc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/tap/rte_eth_tap.c
Expand Up @@ -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);
Expand Down

0 comments on commit 3caffc5

Please sign in to comment.