Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp726645rdh; Thu, 26 Oct 2023 14:05:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqGk+MX5sLgZrqqYubABe/iFL3v2jQuKw3hY6I6lAk7yMT+sh4Kr1KvUCronPLzOOFUStm X-Received: by 2002:a05:6808:159c:b0:3ae:349:7c03 with SMTP id t28-20020a056808159c00b003ae03497c03mr614356oiw.27.1698354304818; Thu, 26 Oct 2023 14:05:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698354304; cv=pass; d=google.com; s=arc-20160816; b=pPkvqAgH5Jw3p6Pli99i7OeL9/RshGUyZxXkS/SH7bF+FcYN4DxeQuL6JF6PIvfe1s TjlYY8zcyBNH4Q95xYspNAZ317uDOLK6zhbHLjvu9zsPSBLyIZhFj/hHkR4zjMarJjsU IOU+hX2F9c111WIIRj+K0Yb7IRT5grUHfVKvAlqAdB57KY6KkxPvBqUdIieCHuEMxeaK xXi6TBnfmqkCqX6axkTmPXifvdP6JmaJR2jY5Ra8/P4alIc3dBkaSjsf9jqB+pm6QITg HIRwqfWzOuKzgQNw0smXnlDvn+0AK8raY29zht21fQMPIquBx0UMBnp4gvvkzImIgKy2 mjuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=DOkExkBFsJbVMSx7K889g30PSBmC7cm9s584MhEmJjQ=; fh=/NjTZvTxQEL6A/3ttNhrN/L1mx6QEN0kwfa5R34XTFo=; b=QvlRM8XoVbv+R5Zne9YhQIBT4TMSjH7JZtg07lDesjsu2COqLOIgJu+jATPIbhibLx vwmxEtUQLVPWN75EIaDAKATYoYc5MvLPkSxR6C0FeV1qUpS4roENyujeQnG8ZdUOcA0s ZkUx7mRgLK704Z5DIENISBEY9O/of7+x0Re1mXGVo292tPC+TBjyTpq8Uq44ODB5fSqz qcaVwphm8WzvrH3ms1TyRnvFYQO5LWZ+QbBhD4m3r5Nufd1WqXpp/yc88LuprbOOGyne zXKQ+gLQJ0mt0wzt10xDxl1wNX/yGuAA9ZMc0gZ0nco+E4UBRrPxpPak4pVbi2VS9GH3 mDhg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=IgWwhsm1; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p81-20020a257454000000b00d9a6b216e90si349380ybc.716.2023.10.26.14.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 14:05:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=IgWwhsm1; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0F49982A41F9; Thu, 26 Oct 2023 14:05:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232027AbjJZVEx (ORCPT + 99 others); Thu, 26 Oct 2023 17:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjJZVEw (ORCPT ); Thu, 26 Oct 2023 17:04:52 -0400 Received: from BN3PR00CU001.outbound.protection.outlook.com (mail-eastus2azon11020003.outbound.protection.outlook.com [52.101.56.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA3093; Thu, 26 Oct 2023 14:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iRQR6MX1wKUtoPiaZ6WhV9LnvSwVbahzvhYsObFE8ma34XMgAcTmRoOA5GOoieW5v2HDGSesn+XDIlnlQLF7OSs2Q++SEEd5bHyi+xmRpV/vwak5lSC1ClU9YgOCWytrrAH4cOPR99Y5WqS1PfYx/skOVh3fdX0WsVcgzOFgLVYoTzwx8F2Xube2KBBg9fQ/ePeo9TG0OG60dPOKf/jDpeoNMtqs4n5k4l5FHlqb/lLIDiV4NzKjBqO8gupn5IYzo/mNA0eqvSSFe19tuBJeTb7MLp07jIdq1dFcA85pLmUY7T6oQaFHgpw5neZEal91k5CZxyyKkoICpvr2HNYtZQ== 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=DOkExkBFsJbVMSx7K889g30PSBmC7cm9s584MhEmJjQ=; b=CT+hCJtwZR2FxUsvwYu8j2Sq9n4pdf9KpV1lTbW9U0MFFUd9NjKIZGM5iiVqAs2LELqm7ja1BP5u6yJtNmdcbMsCOlUz96DzbVyP+rZ/RsFBZWkRI8hru98NFi5iy4x4wVw+7HW/+quuCrzb5FFgaZURUPd80R5KIfu0qaMygb7OubeJBBD7hUQaQEQhhMaikOB6rd7tDrYumQtLIoGG6WCnStTt0SVLh6nOxdK9BATuegZk8kXReBYZptmD4hyCG4fJj3aA8ERY6R/kM1zjKPwDFEcPHMTWGD45pfwIJaPAu/Jo0ViefCF/njedhXiH5Q3JbOVAhevbTP93VrfgSQ== 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=DOkExkBFsJbVMSx7K889g30PSBmC7cm9s584MhEmJjQ=; b=IgWwhsm1I7e4pQQcfFLbuYgdu3bvdXyKlOJeqL319weOYqIwdFFjSvx6Voz7GOzC/tHgHhMBq3RxoBvBPvKvnuNAq/44TiZWsibxpyLxEZOLbDg/CDq00ROg/Mo/+IfQLmxwCIxPlpRNO39+MLkxDdFA78X9WmKud3MVTzHmQs0= Received: from MN0PR21MB3264.namprd21.prod.outlook.com (2603:10b6:208:37c::19) by DM4PR21MB3440.namprd21.prod.outlook.com (2603:10b6:8:ad::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.8; Thu, 26 Oct 2023 21:04:46 +0000 Received: from MN0PR21MB3264.namprd21.prod.outlook.com ([fe80::9f51:f462:e8d2:d242]) by MN0PR21MB3264.namprd21.prod.outlook.com ([fe80::9f51:f462:e8d2:d242%5]) with mapi id 15.20.6954.005; Thu, 26 Oct 2023 21:04:46 +0000 From: Long Li To: Stephen Hemminger , "longli@linuxonhyperv.com" CC: KY Srinivasan , Haiyang Zhang , Wei Liu , Dexuan Cui , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" Subject: RE: [PATCH] hv_netvsc: Mark VF as slave before exposing it to user-mode Thread-Topic: [PATCH] hv_netvsc: Mark VF as slave before exposing it to user-mode Thread-Index: AQHaB5W4U0Kx/aurvkOjV7lIJbHFdbBcSP+AgABHWaA= Date: Thu, 26 Oct 2023 21:04:46 +0000 Message-ID: References: <1698274250-653-1-git-send-email-longli@linuxonhyperv.com> <20231026094719.04cace95@hermes.local> In-Reply-To: <20231026094719.04cace95@hermes.local> 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=8f76e82a-7240-44a4-8a38-e096edef6efb;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=2023-10-26T21:02:41Z;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: MN0PR21MB3264:EE_|DM4PR21MB3440:EE_ x-ms-office365-filtering-correlation-id: 9b306999-15ac-43a9-e8e6-08dbd6672f32 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xkYdZjGgg5BN/cC9oHbXKA7YFS+OPJIbSlGToagttNfWj18QMJl3Pf22vJfm22mUMNMXGT5D/fwy8GSg/944r9yzrTWJYAtiY2Te3/hWrDxGelG3bmEtN4wDNtLwUO7r6kfEgYJCB5Ygwzx1FQ73GOu8S2mrmc2SFUxoicSx4hFLn9Q9V3HY7HyFmeCxIbBW94Om2w3jfg1iuulI45ZawiVsILHFILahfLuGSeSr1M0lAlCwkovgUJUqxIdVwyDiH4244sY8sCUhtwgKutqXWCIUD5/bqPAn/KIqcMeaMvweRmER+vYDCXIYjhr+TgghT3LVUbtIbY/X3i0RCNXnj+TSMFA/FCgbkzqX/ft2b2d3JwK86HNrSfQpYcgnTbFZzlOhOleOzvyz16su+0VJRuIYuleKxB7JDdg6YCWA227Vcmhf5/3N94o9mRB6SrdufCwkKYk0upRFF3zzGvB2L/gjYTwOgd5j/cEtFkYDdYfQZqpnyB4bFoETVFtmHFK1H1TdG0DBIEorayvLQQhswTqWwn22NKEf6httvBVgua3GS6qTmkKa520kAVb0YYCibrPWR7M/zEUBBGPa/CUjw9uv5fSMHSnub84QMchSWorjA4NOr/5iODTc38LRdFRphEA/BbVmG3FRLQunERg5Fay9DuFs72fGOPvUVKXHs18= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR21MB3264.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(64100799003)(1800799009)(451199024)(186009)(55016003)(71200400001)(7696005)(9686003)(6506007)(478600001)(10290500003)(66476007)(66556008)(38100700002)(33656002)(5660300002)(122000001)(82960400001)(86362001)(82950400001)(4744005)(41300700001)(7416002)(2906002)(66446008)(8990500004)(66946007)(76116006)(64756008)(83380400001)(26005)(38070700009)(316002)(52536014)(8676002)(110136005)(54906003)(4326008)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4tFp36DBMufgm8HU8mAX2TUWoehcQp5sQPDYfhwszefvqGFWulnMKor4dsFh?= =?us-ascii?Q?Ri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xhmhYPfBMfmPcy?= =?us-ascii?Q?5M9i7+SE8Zohcc0xU8OXoOdwd0ZPV5J50VqP8v1RFZU2+nNNBw7McJ472r5F?= =?us-ascii?Q?9SEWBH7hRqce2QM/SMtg7QJIK1zAgU4B1Wf5CAwayR6A0ey5g4EZ8TJ3cGgT?= =?us-ascii?Q?OehR22lnEwcY8t/xUdPumT7xVPlud9UscqcHjoJjBmZjEBnPW9DnzJghF6y9?= =?us-ascii?Q?amaOkxLsMc+T1Vuckip4OxQaWu5Ob4nZygTULTDwgX40Bv8acTaqZcige8M5?= =?us-ascii?Q?chPfa5E3+sjWNVS229tMycAywfunbMO6YXO56SX/YxFfaPZYQqVtYcevSfYK?= =?us-ascii?Q?6GGQax0WCx42ZVmsWUUMDNFh9Ks44UyTRDauo2U0V303Lg4igTd8eM2n+TJy?= =?us-ascii?Q?TfE/3ys6XiJyBxtVe8+U1A7XTuqZCZ5CLyRQGmuozxy121xy5wOgOXXoyLjQ?= =?us-ascii?Q?/DJR1IORizmz7TMkmMFhWVhDNoNuKXIxUE8yUN5CoerrEEIYf93tbcpb5teY?= =?us-ascii?Q?XfBWHtHRL155hWlGL+WG0RLzVO6njhVAIFxKqbRY05f1l/oiazAIXLIu8yCP?= =?us-ascii?Q?SGuxmz1PznEzjEF/BtsA5skJTO2akYXuYGK2K7LpYqF2v2t32ouLV0nbgsLZ?= =?us-ascii?Q?ySZpW+HwUy004ccO7mtsuS8RyK+5fgj9/MPqSQeL?= 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: MN0PR21MB3264.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b306999-15ac-43a9-e8e6-08dbd6672f32 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Oct 2023 21:04:46.4422 (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: vVJsWPo630wTRN5f4TZXN2KWPjm7cbaI6ljH3axYDyfARIlB2BTdaivoQZ9rXgIq5GLQdkeNmBTQRAhNO/8KKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR21MB3440 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 26 Oct 2023 14:05:02 -0700 (PDT) > Subject: Re: [PATCH] hv_netvsc: Mark VF as slave before exposing it to us= er-mode >=20 > On Wed, 25 Oct 2023 15:50:50 -0700 > longli@linuxonhyperv.com wrote: >=20 > > list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) { > > ndev =3D hv_get_drvdata(ndev_ctx->device_ctx); > > - if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr)) > { > > - netdev_notice(vf_netdev, > > - "falling back to mac addr based > matching\n"); > > + if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr) > || > > + ether_addr_equal(vf_netdev->dev_addr, ndev->perm_addr)) >=20 > This part looks like unrelated change. > The VF mac address shouldn't change, but if it did don't look at i. At the time of NETDEV_POST_INIT, the perm_addr is not assigned yet (last it= was copied from dev_addr when device is registered).