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 C9FC745651; Fri, 19 Jul 2024 06:40:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC21340A6B; Fri, 19 Jul 2024 06:40:12 +0200 (CEST) Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11020087.outbound.protection.outlook.com [52.101.128.87]) by mails.dpdk.org (Postfix) with ESMTP id 3995E40267; Fri, 19 Jul 2024 06:37:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QtSITC3rX7+/buZzXZ6+MO0ukVYlMRkiE+PPjS01F3CKjqsn/6NiGjjSC4YxNT4QOLDYD47/fx5mIGeYuZeFE+posKbQnFEtZWDSinnelDKSN5eXFJq/+t8wXkhqyva3uhsTTZrxvmm/eOAYxY0bqtFF5j0ORTYaVx5i/D8ShlI+tuAHtlqUOSzx+kbsTVOQLdreVszf1EAzL6jgsHPi8nAKjxABVbs9QLP9zN5Oe3PKiutDNQkjbNxHtYI4eRrBDqN7IEGzSofGrNR+kqlQOxc9fgO2FHdzTFobVQqM0yu2AzEVbjcViNJRrr+gcEo1asHF5VnmyJ1q4hdXqOEQbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GHRH+X82QpLF/W7o0uMTn/KRL9PnVWwVsjg3UyO34m0=; b=PaKtPzM4QAv9LM6VmExpz0ifsCKjdo30Q5xkLnM9Me3pAXi6zvR1lNIgRhahDQ/NUFw1hmWXaC3cpoaOZ6f9K7cX9TBUUPsKWONjwqu4QjjEWYDAXcJASJTOJEjEC0rbOo22a2uqN1CLnh9yScPwudjIqh36q4vTyMs2QE1uOG8W9c3JI8J/4ozwQPU3jCZ97Q4MHGr0z0BqRt9vnHREObKkpfA9EDp8ugAJAJY47BF+D48wlNBJCLrhLdRiFaE5ZOjRdn6vXQq7pyTIw5EQ3xHHZgYMnmoBp3Chd3tQCYAUlUeERySIuwLF+EC0yqtgHUq/Z+blJp8pnyCMZgOIBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GHRH+X82QpLF/W7o0uMTn/KRL9PnVWwVsjg3UyO34m0=; b=ZH5qWxvWQo/yQ4XHpZ35T8qmJcScH7R8qwShHJH/R7Jb927COp8B/pqTCfWhoZGmR4ZDgvVrZLkTscTZ53KKEccBsAKXbEzI8imIy4uDdh/FqezxbR6+IiEv/HYoRc2ujEZyRqIjMjTK3JjZvgRZ9FrmZMO2KV5Z6imAnWTVMaE= Received: from TYZP153MB0399.APCP153.PROD.OUTLOOK.COM (2603:1096:400:21::12) by PUZP153MB0750.APCP153.PROD.OUTLOOK.COM (2603:1096:301:db::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.8; Fri, 19 Jul 2024 04:37:17 +0000 Received: from TYZP153MB0399.APCP153.PROD.OUTLOOK.COM ([fe80::5281:1f4e:3d98:4f8d]) by TYZP153MB0399.APCP153.PROD.OUTLOOK.COM ([fe80::5281:1f4e:3d98:4f8d%6]) with mapi id 15.20.7807.005; Fri, 19 Jul 2024 04:37:17 +0000 From: Wei Hu To: "longli@linuxonhyperv.com" , Ferruh Yigit , Andrew Rybchenko CC: "dev@dpdk.org" , Stephen Hemminger , "stable@dpdk.org" , Long Li Subject: RE: [PATCH] net/netvsc: use rte_eth_dev_set_mtu to set VF MTU Thread-Topic: [PATCH] net/netvsc: use rte_eth_dev_set_mtu to set VF MTU Thread-Index: AQHa2Umlh5MAOWs79kmkO0kQjfOuPLH9d2Rg Date: Fri, 19 Jul 2024 04:37:17 +0000 Message-ID: References: <1721331316-8821-1-git-send-email-longli@linuxonhyperv.com> In-Reply-To: <1721331316-8821-1-git-send-email-longli@linuxonhyperv.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=711808cd-0a71-45e8-8412-485f3ceb90bd; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-07-19T04:34:46Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZP153MB0399:EE_|PUZP153MB0750:EE_ x-ms-office365-filtering-correlation-id: a753b3e0-c318-45cc-cc7d-08dca7ac786a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?XFxWcg4DuPeLxXSsBu+vxNODXLt+ykyt9FFzYdlzKOv5Wf3k/KIeUJEgPeyb?= =?us-ascii?Q?ipSWNnD1SMWIZuEJcHL/hzO2WHLAkXrwaTKfSkZ3kW9plE6G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ckDFowJFa0kr7V6WPvyFIlF+f7HfNQu2+HH9b3C6S2AS?= =?us-ascii?Q?AC7lK0GaCDHsDxdSua/N7MzuH76l0GipQ6RUHWiSBK4jqq8EkorAbM7X8H3V?= =?us-ascii?Q?bjgYPHzOMTEMt2CsxPe67CdTWiSq672VSmNv81d9hON1LYnD3alVUkRmZt0X?= =?us-ascii?Q?qx7oT6z0Mdz25l155MzA6wGVs1R5a5PmUxbvK3tC50b+ZaJjvtlQxjuIxGSW?= =?us-ascii?Q?t4Bu3RLKnPZo2IId7M/Vq23AqD2+E+YwpbE5D9D3PFE3+eDIJZfr+Mfg1pB4?= =?us-ascii?Q?+MK+rYyR5AuLKdqaFRdzYFfix8MZd6Ox2U6cT4UfIXSYBQIG69fMVgr83+Pn?= =?us-ascii?Q?UEfMV8i8uPhZz/zohlhr3gGtP4M9144Gg6SAb8S/k/kVFaRcV2zdIzUU/WtW?= =?us-ascii?Q?0XDS0OTkzdmWW+h0vYRthXb3LoIXSu/BT7NeLylNbzr9nqVLYQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZP153MB0399.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?l7WT/URKg0FiAHATZxHakNV5i1zS1wTt8g2nlXyYrNLdWeG/2ee/QW31DBUY?= =?us-ascii?Q?6MlcF/K+GeY4qzxauwuAWIg7ViXKdZG4e2M+CaC/1luvBBukT1pATLsCfHZ4?= =?us-ascii?Q?QKA/tKj0gsqRsFnonHgZO+mvhVAX7R6EqImjIwFwJ+Zbt/6ISlsfYFK7pzr6?= =?us-ascii?Q?jvYYfWj6KNZ1V/pb327Wb/wS1o8Q7gwy0gLPNvghUiKdJpeC7Xt/oeogFQKH?= =?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rqYFRrr++/hUcNwp4GT?= =?us-ascii?Q?iV+EYC//0etGxnuEGkD3wzBGr2DAneqvKiQZ0AbD1ibvAvjmZ3d/xjhkvRjx?= =?us-ascii?Q?SY9N9rzx2ADU5knW95UTHiliZ0q9YfCpvGuIRDEryy/pN1XBk7galdjgUvw9?= =?us-ascii?Q?zq3V/Zhh5YJlV0bikKmZgcwsx3FBHtAFVBNClWEns06EUy0W8BzpizfQmyiI?= =?us-ascii?Q?FXQ44vB/HT7iz6cfqV8RT7S0TZvrwfifY9CgDfuvW0y0DWIhnxQcA82p5pek?= =?us-ascii?Q?RES11AdzajWo7JbYQ4s+KGN/4g7xry2vGfBOyY5ZWdRZhqaFSMLZ8Exp91Ce?= =?us-ascii?Q?5cvC8Td1ODy7yxovkr8ww7PevXhDiR+YeM5smRX6vw8jCw1ZlLJkL1BDmOe4?= =?us-ascii?Q?aIN0HCZDCuDM4zxrHKJRhiV5Ge2/3i4rPt84lPVtokOSAL99sYUaL29vWBKK?= =?us-ascii?Q?Goz2k/u9y7g4Xo804Bk=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZP153MB0399.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: a753b3e0-c318-45cc-cc7d-08dca7ac786a X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2024 04:37:17.5811 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EUcXkeUNn7bL0RAMo299OEMSWHk854DiGcbiBAvWxZW7XDOcYzTNTRnKEwfG6hPhhti746fa4hhrCRVHh4l5XA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZP153MB0750 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 > Subject: [PATCH] net/netvsc: use rte_eth_dev_set_mtu to set VF MTU >=20 > From: Stephen Hemminger >=20 > 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. >=20 > Signed-off-by: Stephen Hemminger >=20 > Fixes: 45c83603087e ("net/netvsc: support MTU set") > Cc: stable@dpdk.org > Signed-off-by: Long Li Reviewed-by: Wei Hu > --- > drivers/net/netvsc/hn_vf.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c inde= x > 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; > } >=20 > - ret =3D hn_vf_mtu_set(dev, dev->data->mtu); > + ret =3D 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 =3D hn_get_vf_dev(hv); > if (hv->vf_ctx.vf_vsc_switched && vf_dev) > - ret =3D vf_dev->dev_ops->mtu_set(vf_dev, mtu); > + ret =3D rte_eth_dev_set_mtu(vf_dev->data->port_id, mtu); > rte_rwlock_read_unlock(&hv->vf_lock); >=20 > return ret; > -- > 2.43.0