From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 086C9A0548; Tue, 27 Apr 2021 02:54:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8782F40142; Tue, 27 Apr 2021 02:54:20 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id 4EC804003E for ; Tue, 27 Apr 2021 02:54:19 +0200 (CEST) Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FTjsD57yrzlb1d for ; Tue, 27 Apr 2021 08:52:16 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Tue, 27 Apr 2021 08:54:13 +0800 From: "Min Hu (Connor)" To: CC: Date: Tue, 27 Apr 2021 08:54:22 +0800 Message-ID: <1619484862-48907-1-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619090834-14643-2-git-send-email-humin29@huawei.com> References: <1619090834-14643-2-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2] net/tap: fix log loss when state fails to be restored X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Chengchang Tang 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) --- v2: * move the variable declaration. --- drivers/net/tap/rte_eth_tap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 68baa18..854abf4 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); -- 2.7.4