Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2377790rwd; Wed, 14 Jun 2023 01:48:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ofwye5hk3sljhjcLkdDUv7zTzEXhBPrQ39oYDzFRhlDPJUo0aRds5265LHZeuMCBzuwBa X-Received: by 2002:a17:903:234b:b0:1ae:50cc:45b with SMTP id c11-20020a170903234b00b001ae50cc045bmr12756113plh.36.1686732520319; Wed, 14 Jun 2023 01:48:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686732520; cv=pass; d=google.com; s=arc-20160816; b=pV/8nUv/5MmtgwfEjnZbAdHLxbmk+KXNMHacfmtCbD7GIemiX4tY23lhc8VRP6aBTG piCJz4G1ymzw/uzOACN3hW4ja8TkKNA3CWvoEmSqKvUZBQl6myzGSTWYGHoUDWfFtUGw FhuCa5H1AZyLWR33W0FTfrBUL9mcDKKZwUYmmxaMTi2jVFVHqev0wYxPvAKhHwNzVqxJ u7JvrfoMkHIV2XM82UvmIwop17CvtIZxAosgMD7mif2AwEPGdnoozfPXq0z49xIxc/Zk beRNtItTF4GTjbz1+6VyS++Xm0OINOMW/5zUTxKoQJPz02T1nfeEYaa0N1J21jmxh7MV XK/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pCKKjil58r0DFz2SbcSdYj2POnI55cwqCqmPRPzFl0c=; b=p7eUJsEcYqV5+k9P4TViPYeL29ruAW7Yjy2AhBDx8f4p5xdEgfcv5nsnD7VJksJJ6Y jdIutspb0L5wrzGSssEYhTmatN99FZIAzz1w7KaiSZlIlpLUwum/SrME5hPIj3P0EzWh w0MtxcYIlYY+BHonmL0Nepsb5vAxEYjvZEML51NxlBaAme+c2ozWDV5XYWKrwpS49yC6 xYelp3j/lOtd9ygIZohMRZ5U90UQHKfb90Ez7H5w/RsVFJMnZk2YgNDZlo0EEhtjOz8B J7G1i3F2uMXA92EAE9DtJeVJs2BnQsegZQOWLy3nAExfSKnbe0UNewT6Udsf9B8cd7gI HamA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=or371LSx; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a170902ea0400b001afe7fcb257si6645773plg.64.2023.06.14.01.48.28; Wed, 14 Jun 2023 01:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=or371LSx; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243379AbjFNI1O (ORCPT + 99 others); Wed, 14 Jun 2023 04:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243528AbjFNI1K (ORCPT ); Wed, 14 Jun 2023 04:27:10 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20714.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::714]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF3CD1BFB; Wed, 14 Jun 2023 01:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JiBeS9rZdW75o+3ywMh8k8leHb9S1V0Arus27Rw8tnBnA22MS/bpf0rsnl6vmk7oHqITPciDyZzdl16t2l0mWXNahEIcJdEGv0fD2zyeRJSnWorZE3dNvKIp7m/kDdCmVIDMBekdIq6vGJQrGT2FlAVoTxqWSauoX2NQSq7Zoy+7XBa18SB+C8aBBfIqe4BQaIDK0dTSHiYtULLJJCvUVJjH+YlrAhQkYCSQU8kSdUpbDbi8Wqn7iqp/Fri2CaORf8WXL8ceVU6uFA7GMdVEti02vSdTatHn6rVHs+S+P63v8WMMcWa6ilHsLNiXA8wxvnj3CaiCAN4D/VzznvFwYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=pCKKjil58r0DFz2SbcSdYj2POnI55cwqCqmPRPzFl0c=; b=EXNnGcCN/YBkMzMY/ZVQbFmFQXRIfOLSrg0ggMKI2hsVQDGdWvoUE7j7g76L0sRk6ekFgmMDahhhH4eU4LYQS+oA5Qte7hGYijHHLaZ9TyE9+G7DR3vlehChrArlmAFL4NGGZ4QQozsuPPntirbxnWH9Ln5n0ZGrYTEDheYQT2J4cPQ3nAC8z8x6d1rrhnaVKG33q7Y/gMFkeJKstj8KFlPXQbu9sBwkNpNB222HdqV2vUvI6mH8FPe85ME3AtMxQWLMhXu17MHWRV4OyqIy9TZQf8zWIxBj1atyuluXkaPH6jS5P6IWqw/Fm7VeCGezKyWkBaDUm4x0GjgHd3YWxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pCKKjil58r0DFz2SbcSdYj2POnI55cwqCqmPRPzFl0c=; b=or371LSx0Cjubrcv1aQQQfT89LcI5oGmmc+XAMEI7N2aL5fGGqDiKfzrbH8unpLgmcTIb/qkxEX4BDwsMlsJ8sLxeJWCXzx9JQiNsQPDE+tDY4hxluAv55l3Z/vbUcVB30R9L26rUwvvU/kiWp/inirvyJm2Q4/TiCzqPfqjCfQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by LV8PR13MB6350.namprd13.prod.outlook.com (2603:10b6:408:188::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Wed, 14 Jun 2023 08:26:38 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e%4]) with mapi id 15.20.6477.028; Wed, 14 Jun 2023 08:26:38 +0000 Date: Wed, 14 Jun 2023 10:26:31 +0200 From: Simon Horman To: Ivan Vecera Cc: netdev@vger.kernel.org, Ma Yuying , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "moderated list:INTEL ETHERNET DRIVERS" , open list Subject: Re: [PATCH net-next 2/2] i40e: Wait for pending VF reset in VF set callbacks Message-ID: References: <20230613121610.137654-1-ivecera@redhat.com> <20230613121610.137654-2-ivecera@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613121610.137654-2-ivecera@redhat.com> X-ClientProxiedBy: AM3PR03CA0060.eurprd03.prod.outlook.com (2603:10a6:207:5::18) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|LV8PR13MB6350:EE_ X-MS-Office365-Filtering-Correlation-Id: 73183385-f8a5-40e9-36d5-08db6cb11286 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 30eBGmSK42y5nLq5jK/gMBAWMid3W7a3YJdiNKByfrPxUMrqTVaj0vX9fDSHbN5+VXWGlroOzwO+l16pZJTnAWBDkJxzYHcg2x8AU80yt7Nhc9jliiUG+fNVs81lO4BnmDoOsWOCP5tfuVCp6LhSocYXqfSE0BOexBpgGyudQL5pCweXYvTr5Mt8QmrJ2px+nWN7m3BqRtb8LBBfYdP/c6oO374MHn/U84ZkKCYhsRuPVgC7L1MuT0s5BMyHj89JXSC4ABSHgfFEtG3G9KLU9PgkVdjwlOkXLotzWZ+WtCcmbHLUx6AbjOaB91n4cUYVdDDy9ocTsAjYCMfNcBsqR+rfLsfhGIy3HL0BB7yzgK8/8Oc/toH80I/juhIBIXs0bHDhqsD2qhj2WuaIiIgRzKxtBv2uxE0hpSdptHTAaxaEr2YkmrENvF3TulBXQRieHy+G+YQQxMF0kVSHD9pyuw9NKT/+NrUkesTOoR5MpSNtTSWQkyFlX1ZhrlOfR4ZmZ6v5fwHSG8mAMpyj8Cd3cunKOlGUrRp4UZKAB/TUf+1hyV4Z8fPXaU2Xoudb/yAU7Sutobhp1Kv/7gyFfqUdLXxRS2IqKbKdKm1VWqMXIv4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39840400004)(366004)(346002)(136003)(451199021)(36756003)(2906002)(86362001)(44832011)(7416002)(6666004)(6486002)(186003)(6512007)(6506007)(5660300002)(478600001)(54906003)(66946007)(6916009)(66556008)(66476007)(4326008)(2616005)(316002)(38100700002)(8936002)(8676002)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?H5LyY2chuz1ZDb/+p33IYg5WO12IPhl82Q+i8vYdMHQ3c2MhkR9MkQyYfpwQ?= =?us-ascii?Q?Zz7bHM1vwWMOac0bfNkZ82kAdxRdiRQkSYaevpI+IpCCdswTwIeSsnJNiU1f?= =?us-ascii?Q?JlKv8uqRa9msn3XemPOdG9maCffEIpJ7ThfrFk+rD/cQthLbcy9IbgOpMZGz?= =?us-ascii?Q?Qzenw2ssGVQXIA1vt+ZvOjT+KMAdHwFos4UrsfYNRc1NrCQYi9Cfk0/zpouw?= =?us-ascii?Q?5WWG7799wYmJlkViJlhEHBbFEbSzaAbu8hjX4cNWeEW7wVwYUdZL6sXqNMG+?= =?us-ascii?Q?pQDn2k4TNNUb6IQ9BzcPkqzBCwLK62czQUamRxXkXRug1etbhZJoxnkpVaN2?= =?us-ascii?Q?6lq1I7Nln/tOWuTuiNVhuHSjolsqULlpDfIvV/o2XHsJsYU0a2axHsdLAOtF?= =?us-ascii?Q?OysW10BjZL3qubIzBxkqH56qeTu9c09mvZfYWhDJSrT1RCRrtCwoHhzHKF2M?= =?us-ascii?Q?0ntWOPjRV87rEgYwqhuDjNZgC1cT/ng6apDZVABcPUh/5jw3eI5nQlsNfw1W?= =?us-ascii?Q?yLqHGSDDqnGvdTL53/pfe9ldEiUAgeYZhLllBkf0yWSdNBvcDccce1xBBjie?= =?us-ascii?Q?6ROceP15Au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?us-ascii?Q?oRjDwNwx96NX2V0nzTbtsgcbyl8cf3McFkAq6CM90+qr8SUuoI/0CqgPsBUU?= =?us-ascii?Q?vNuUX9sc3tM5WvMbXuFa7K+4vYPHXYWKtyrXX7ZF2pU0nAlKN9emZMYoG09p?= =?us-ascii?Q?M4LzB5SuN2q7fJfb3z6Z4OhTif+OTfslyyM9WUh9EIwqH+1dndPzE2o+DWZJ?= =?us-ascii?Q?viuHxQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73183385-f8a5-40e9-36d5-08db6cb11286 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2023 08:26:38.1101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 12bCrNKcIeB5Jd04yrELmpgrc2hoq2uGPlrrjGYWIEdL4I+thbS5WH6HWTYZHxoF/h0i1eJDwN0UkPqCQCcZCaHhF/EnGIyhUHdBsgzJ+uU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR13MB6350 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 13, 2023 at 02:16:10PM +0200, Ivan Vecera wrote: > Commit 028daf80117376 ("i40e: Fix attach VF to VM issue") fixed > a race between i40e_ndo_set_vf_mac() and i40e_reset_vf() during > an attachment of VF device to VM. This issue is not related to > setting MAC address only but also VLAN assignment to particular > VF because the newer libvirt sets configured MAC address as well > as an optional VLAN. The same behavior is also for i40e's > .ndo_set_vf_rate and .ndo_set_vf_spoofchk where the callbacks > just check if the VF was initialized but not wait for the finish > of pending reset. > > Reproducer: > [root@host ~]# virsh attach-interface guest hostdev --managed 0000:02:02.0 --mac 52:54:00:b4:aa:bb > error: Failed to attach interface > error: Cannot set interface MAC/vlanid to 52:54:00:b4:aa:bb/0 for ifname enp2s0f0 vf 0: Resource temporarily unavailable > > Fix this issue by using i40e_check_vf_init_timeout() helper to check > whether a reset of particular VF was finished in i40e's > .ndo_set_vf_vlan, .ndo_set_vf_rate and .ndo_set_vf_spoofchk callbacks. > > Tested-by: Ma Yuying > Signed-off-by: Ivan Vecera Reviewed-by: Simon Horman