Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp558236pxb; Fri, 16 Apr 2021 12:08:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6fF6fH8XCcxH5O3CX/GLMbZtOXxhKC0Zrk/Km5ZlUX4bSkz/qc4AoLFJci+AvnYlSKONc X-Received: by 2002:aa7:de8b:: with SMTP id j11mr11817478edv.363.1618600108558; Fri, 16 Apr 2021 12:08:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1618600108; cv=pass; d=google.com; s=arc-20160816; b=qkC98kK3Oc6Rz4TY07ukBJX5ZAbMomp5vIoW+LhBQKVh2NMqyY4+DFAd0BkScEXo9k sGr4+NDtFPLCsVhSC7WCpuMtChujVbtQDLpts/RHqNYuwpGP6Bmy9l6BwkrfoCbXRiN2 8vVPug37GunzYJTEBL/7pUU1kPG7FkP9R/6tt+m2ngbOysj+JrUfJqD5Vx1hBHIvdqXa RJGYX8G8owyu42hfvY+6H1oU82IP5SwgEr7Lq/rq4AZb8pAnfjBcsS/VVRoMUXWmLOUl 3VqMngT6p+vPDd1f6EQYVGgAZm+YBzVxncQcuVqKzo23evwRLfqhyrWggZDyPUI7uJod B8Bw== 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=7DDXFRNOPYdCJxVk73qmtNCOnX1IBgOU3oZwOR4kFEw=; b=MF2SRxth4BU7OdzMxc9OmkcKHSRC7IcaohfdyOUC0RzS5Eg3Xa6eNix/QzUedpwY7j nmEtqo3VVmIXq6GlDrulpO+MrKQu8duac9+UdQmwvMge7SNFWrwoKC7BH/wiFpJIyT/Z NyxtOvqUZyIVNagSNX/igstXYh3nyYq6Bioa5+0nMNKxDaf42av5oZk2w/UHNWdSdLUR 2gU1hJwhT3HzdD+Km4+nWwI5N7i6CFp5KR9TYrmzYzH8y/4I2NwsRy2K+YYWROs7rC8j JgXfASmpCRr/qqTgcDD3yXl4Dl72DdvfGgdQhm5vaYXBQXGchaPa4DhfiTq1O1s4ewBQ sHAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=CNWeTPm8; 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.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lc12si5283183ejc.79.2021.04.16.12.08.05; Fri, 16 Apr 2021 12:08:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=CNWeTPm8; 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.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244062AbhDPR7P (ORCPT + 99 others); Fri, 16 Apr 2021 13:59:15 -0400 Received: from mail-eopbgr680126.outbound.protection.outlook.com ([40.107.68.126]:27526 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243998AbhDPR7N (ORCPT ); Fri, 16 Apr 2021 13:59:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wv7XgsaNHuA1hsyNFCYRCn7g03qdzHZgVIw3j2P3x2zZae01fqd2lt/wHWfzQw4MiHAAHAA4BaIFKjKaEg21d2aJdIEC5TsRKoVNNlJuV8jvCtZDMu7/bZyCcaYm2RJsx1V+vWq6H+PE8kkpte66Qyb8gokcV6Cyc1QmWNiKz80ceAIuL8iXt9Ln2LYonkmYw3+XlaRR57H/+OC+jDcHkpA5z5G+IzEFEa6/+S4m/fk94ZSurTkziqv77MupI3gENxrtRUOwpW8k2MWwUW1Q6XJBE+uwkXVu3sRe0T3SYtIkC0tVLf70uuiw0RvyJzG5omWtPnEsK9HPEEp2xMeoow== 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-SenderADCheck; bh=7DDXFRNOPYdCJxVk73qmtNCOnX1IBgOU3oZwOR4kFEw=; b=g+SbBXte0vRV2cN2aBSl05xsXGnm+5G1z++eZ0wyHDKv4cEkFSjWHd+nkLMdDoyJIdYPUQNxBwhbkAuTThou6gRC3wdoq18qlKiVT6kVar8/Td/zQ2JzK+9wgHlSdVqjFkNh32uMPZCycILib5yho1mMB6cDLCrzRu74akGWFxXnLZDW2e+MMlzYPRIMUdeuO0AmlChCV1OwaUqJPWzTMLm/zz7BwID+oKzVUdY//iAuECayaSyFPwx3yAtNMPxB+FncpwC7dWZ9No+07BaNSChTSxKvr53Os8CJO5WW6GfQLpbrklDL3vq0/uUi+yfSAHyXFuckoLuZJZCOnNloWA== 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=7DDXFRNOPYdCJxVk73qmtNCOnX1IBgOU3oZwOR4kFEw=; b=CNWeTPm8uWyM3wWLji0Zc5MaLt4qo9Wk4LpcIKrPNDtwY1W2ExAdPbwqlXToWn3qKjhvtHw3+PQL8jn87L12Z4nf6JJZ1JeEVwLyRunrHH/oE3ZlhU3y1eZSHiQtALji19KiDbT8ev/U4Qqo5EJm7h2Sdz5kymo8guNTpNi5uLo= Received: from MW2PR2101MB0892.namprd21.prod.outlook.com (2603:10b6:302:10::24) by MW4PR21MB2076.namprd21.prod.outlook.com (2603:10b6:303:123::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.7; Fri, 16 Apr 2021 17:58:45 +0000 Received: from MW2PR2101MB0892.namprd21.prod.outlook.com ([fe80::5548:cbd8:43cd:aa3d]) by MW2PR2101MB0892.namprd21.prod.outlook.com ([fe80::5548:cbd8:43cd:aa3d%6]) with mapi id 15.20.4065.008; Fri, 16 Apr 2021 17:58:45 +0000 From: Dexuan Cui To: Haiyang Zhang , Stephen Hemminger CC: "davem@davemloft.net" , "kuba@kernel.org" , KY Srinivasan , Stephen Hemminger , "wei.liu@kernel.org" , Wei Liu , "netdev@vger.kernel.org" , "leon@kernel.org" , "andrew@lunn.ch" , "bernd@petrovitsch.priv.at" , "rdunlap@infradead.org" , Shachar Raindel , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" Subject: RE: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Thread-Topic: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Thread-Index: AQHXMuNz15KfoBlrkkekxhRrL9s2dqq3ZoJQ Date: Fri, 16 Apr 2021 17:58:45 +0000 Message-ID: References: <20210416060705.21998-1-decui@microsoft.com> <20210416094006.70661f47@hermes.local> In-Reply-To: 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=c3e4926e-6dad-4db1-bc63-cbf797964561;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=2021-04-16T17:07:41Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: microsoft.com; dkim=none (message not signed) header.d=none;microsoft.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2601:600:8b00:6b90:d56c:64b4:268d:aceb] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 53a3531e-b8b9-4ac7-24e7-08d90101478e x-ms-traffictypediagnostic: MW4PR21MB2076: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UuA1qI2ftj38NAgyFc0sN2RIznnHcIOKMsMOXABQx3BnFCagndYr49EDf4NJYQCgXnAhUtotplzDRnihVpjswxzQldddajhOTtevN90apjaNJtZklrVIQqfYjvRgspxSkeU1AFA0EDN6UiuvunCB6wNLS8pBaTRZhDIytA3N4rmfyUEUJdRiPXzpn8guKPzIhdzWL8C9NrGNmcmr0E/kA00ExQRY9ZDJVVmPYBtoemN7OEW/ty1gb9OFs70YB8t4PfNWvSs57vbdDBLYohkF2Jmotx/3/6J0D7CxJBAq3QCBtNjo76HJyAGKVCV5zIymL5u/6xbAMgfwnIUf0MteExvHGJq7fEeC0rEZvzwZBHv7bYsCpxNxXDvzzzCWi3CL26Tya/rOtWV9bYQlWsMbU2lw5ZKL+ZTKjNclZM1UxypnMoQLmu3Nnx+y316BMavRRg12AYCQLuG37LqHIVmtnBkfn+Y/LntB0Ew7oS7JanQ0lk4QmXsHvYWAyYFtwQY94VVMjOfM5c3FxSXzcgJIYemDIIyyxjsHpgzcWU5HUSmU8Kq4XTSorfcvIusCSD3/VJDfDJxNiuGu2fIH8ODx4Llplm4gM2CMS+JgdKWFuIk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW2PR2101MB0892.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(47530400004)(82960400001)(82950400001)(76116006)(8936002)(66946007)(33656002)(71200400001)(54906003)(186003)(38100700002)(5660300002)(122000001)(7416002)(8676002)(110136005)(2906002)(8990500004)(9686003)(10290500003)(55016002)(66556008)(66446008)(4326008)(66476007)(83380400001)(64756008)(6506007)(86362001)(7696005)(478600001)(316002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?T+BNOWPQ4f3RhMsyWyHXHjSRL6+iDsSc/E2XzxDvF4oSq4ApHF/AX3zTDt5t?= =?us-ascii?Q?1SxYn5oNJ400lcWZmkHjZy+Jet2BDCquDYaGL3YPZhKF/2U5T9gegtlYalO7?= =?us-ascii?Q?vTsQPEg6HE8/L8Xqd7CZrojofP4icuAfl173WVcbpW1quTH+COxA35IUmOII?= =?us-ascii?Q?NswsS4hmIby+I/DfajWdqZz9J4Cth+KFI2HQXJs3shYRhStUBaqhouFcJY88?= =?us-ascii?Q?mU1vHdkiehymPYu8A2w6FLIIgUmDK6N4z8TuvbQV3ozpzCV5QtkFSBZSHEqm?= =?us-ascii?Q?zqNA27JCjtGeswwZtYoiDXm8WB/ie/692P5jJ8i9vPBPGAEUyvxpT50AtsX1?= =?us-ascii?Q?p58Xhmm2GCCnT5vyRa6dzBx5TFHCtr1z867s4Itm6wLIezt+WyEJvk91MuY3?= =?us-ascii?Q?Y9Gv4MrtJ+oPC6Jp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EQ+E?= =?us-ascii?Q?jdixQNh3GjJwz2o4aCp+JGaUZwp8aM5j6U9KxZWFrgXdPdJJ9kBT+NQciepd?= =?us-ascii?Q?I5Yfr4Ts3dWFZKOFSwjfDKNIIlQh?= 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: MW2PR2101MB0892.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53a3531e-b8b9-4ac7-24e7-08d90101478e X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2021 17:58:45.5479 (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: 9dQi236H40Z+KU2NY0su0mdqOXem+HDz9GTQQG81xHYhk6KjHQwmb0r5g8gNNJyKO8tYVP0+qPUUoPlllZR/tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR21MB2076 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Haiyang Zhang > Sent: Friday, April 16, 2021 10:11 AM > > From: Stephen Hemminger > > > ... > > > @@ -2319,8 +2320,17 @@ static struct net_device > > *get_netvsc_byslot(const struct net_device *vf_netdev) > > > if (!ndev_ctx->vf_alloc) > > > continue; > > > > > > - if (ndev_ctx->vf_serial =3D=3D serial) > > > - return hv_get_drvdata(ndev_ctx->device_ctx); > > > + if (ndev_ctx->vf_serial !=3D serial) > > > + continue; > > > + > > > + ndev =3D hv_get_drvdata(ndev_ctx->device_ctx); > > > + if (ndev->addr_len !=3D vf_netdev->addr_len || > > > + memcmp(ndev->perm_addr, vf_netdev->perm_addr, > > > + ndev->addr_len) !=3D 0) > > > + continue; > > > + > > > + return ndev; > > > + > > > } > > > > > > netdev_notice(vf_netdev, > > > > > > This probably should be a separate patch. > > I think it is trying to address the case of VF discovery in Hyper-V/Azu= re where > > the reported > > VF from Hypervisor is bogus or confused. >=20 > This is for the Multi vPorts feature of MANA driver, which allows one VF = to > create multiple vPorts (NICs). They have the same PCI device and same VF > serial number, but different MACs. >=20 > So we put the change in one patch to avoid distro vendors missing this > change when backporting the MANA driver. >=20 > Thanks, > - Haiyang The netvsc change should come together in the same patch with this VF driver, otherwise the multi-vPorts functionality doesn't work properly. The netvsc change should not break any other existing VF drivers, because Hyper-V NIC SR-IOV implementation requires the the NetVSC network interface and the VF network interface should have the same MAC address, otherwise things won't work. Thanks, Dexuan