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 DD74345648; Thu, 18 Jul 2024 21:35:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AE63410EA; Thu, 18 Jul 2024 21:35:26 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6D26240DCB; Thu, 18 Jul 2024 21:35:24 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1202) id 9E0EA20B7165; Thu, 18 Jul 2024 12:35:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9E0EA20B7165 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1721331323; bh=i1DN9V8VxY09E2bQ6pxpdr+pXO+pzPXYEcqwMB4p6y0=; h=From:To:Cc:Subject:Date:From; b=p4YZ3difHHsk074YyhQJ1Z5NKR/wLsySnZK7L9BBkS1GvYwIBlTeaBOYV8HVH3zC0 GIjw3a6UK/8FGxZVkp1NgTZNykooKh/ycxr1bVguHqJPpkrvg9evpeHZIaZ7MU/Xk9 Hi22mbNe1HK6/MFj4VJ2N9+uUv5DXbES+l3GLktI= From: longli@linuxonhyperv.com To: Ferruh Yigit , Andrew Rybchenko , Wei Hu Cc: dev@dpdk.org, Stephen Hemminger , stable@dpdk.org, Long Li Subject: [PATCH] net/netvsc: use rte_eth_dev_set_mtu to set VF MTU Date: Thu, 18 Jul 2024 12:35:16 -0700 Message-Id: <1721331316-8821-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 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 From: Stephen Hemminger The current code uses unnecessary locking to set VF MTU, resulting in deadlock on hot add/remove path. Fix this by using rte_eth_dev_set_mtu() to set VF MTU. Signed-off-by: Stephen Hemminger Fixes: 45c83603087e ("net/netvsc: support MTU set") Cc: stable@dpdk.org Signed-off-by: Long Li --- drivers/net/netvsc/hn_vf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index 6b3d0eb0c8..b664beaa5d 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -264,7 +264,7 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) goto exit; } - ret = hn_vf_mtu_set(dev, dev->data->mtu); + ret = rte_eth_dev_set_mtu(port, dev->data->mtu); if (ret) { PMD_DRV_LOG(ERR, "Failed to set VF MTU"); goto exit; @@ -796,7 +796,7 @@ int hn_vf_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (hv->vf_ctx.vf_vsc_switched && vf_dev) - ret = vf_dev->dev_ops->mtu_set(vf_dev, mtu); + ret = rte_eth_dev_set_mtu(vf_dev->data->port_id, mtu); rte_rwlock_read_unlock(&hv->vf_lock); return ret; -- 2.43.0