Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1264184ybl; Fri, 23 Aug 2019 16:29:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3+iB/Xe+1s8pwMpOtsiTtxCAlQhK0NWztlxjw4jhLL0zxkFP/O/dS1nDCSfYO5QppPHgz X-Received: by 2002:a17:90a:a897:: with SMTP id h23mr7851249pjq.44.1566602978733; Fri, 23 Aug 2019 16:29:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566602978; cv=pass; d=google.com; s=arc-20160816; b=HPqyS63HdfNJI+6/dd3fDhfYDNFWnh2eC8m7TAIdvzGRcFHOY350TFVpEm9emYrpOo rGTChqV243FONHZSicb8itwJVGdQelrxoYc7jtY6d9Add9iZwcbRUuVkI7PFsGXSSppK u2M7xK6prq6PB6mrMIuUK7No/8BmHS2puurupfXwAMChFHO0LkaxL6pf8QnkQsA2bnWW 8W2/NAuGENklcMZj5jSssHbv7UBksNXtgdDIc+d6Umkl55Ye7PFEkltiKjDqWsWP7x5I ampO7WGfqYLBiayLmJqP32p2Vdqd8vStNQ0ixUF4vmKtaPFL5AK70GUJTFaKbkgv3HHo m8bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=LR5oPBZ0AnRu2lpuX9hdO6CmfCI5fpnSgIagu0L8s1s=; b=hm/BC+YUsWxa9sSgg4KiDDQpuxA5XcAq7LVkwotIZw8fFaj7cMEwqsHVfmdAB0Aerr QTCJL5EwZMHyR0bspBoCKWAsZuaMk+XCCPDDXm5FsotRM0pgUdDFlL6RWjohMMtGUzAX R4YuLdQXgBD6X04/Mojgm2+p2DubSyEOtqjWEcnTl8dfI26t/nf0M2YdYatp9UKz5m+B 8V2oJSrAZhF7ThmVxav8boTHR1XDXHfe/3REdH2gS36V0qjp6bGQdm5H/9zFgxo6+1ep skDDdMOnFDUonqE6abr5wLwzn6cUbV2TX+bs9Oudz8WASrC5S/NAHbTMRoePhWGLiMFy xTcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector2 header.b=ipr3DGEF; arc=pass (i=1 spf=pass spfdomain=mellanox.com dkim=pass dkdomain=mellanox.com dmarc=pass fromdomain=mellanox.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si3621901ply.279.2019.08.23.16.29.23; Fri, 23 Aug 2019 16:29:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector2 header.b=ipr3DGEF; arc=pass (i=1 spf=pass spfdomain=mellanox.com dkim=pass dkdomain=mellanox.com dmarc=pass fromdomain=mellanox.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395442AbfHWOxN (ORCPT + 99 others); Fri, 23 Aug 2019 10:53:13 -0400 Received: from mail-eopbgr60049.outbound.protection.outlook.com ([40.107.6.49]:59878 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388352AbfHWOxN (ORCPT ); Fri, 23 Aug 2019 10:53:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n6gl4Rvu0sJ9YWTgu3Fcp7jMLsHeoisiFUckSluQ7vdc5sYkeLnowqn9xdGDgs6V8QJC1FY5SVLH367fZMXDmdpzGVLyokn9/J+S57LjBCPz34cXN3DN9Z7F2o+V3n99QQR1Ec7cehCvVw9Td1Yta65gxG6EpOM45jm2W1cHtQT3i00UQWNAsa51XJssjWuy/mXYH9wWqntxGdS8PxZjrHdj8Ztd+Z705VKdM7998xBpM07elUHoUzdzHvdSYmKIGUv2+vPrW4/GFXgodqV9XHMKJPXeEGcrYv8w5w+120Ya5lB7b+ZkXeCHfEWyMWD4/J32xthcxh/FSwjpiIWCzQ== 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=LR5oPBZ0AnRu2lpuX9hdO6CmfCI5fpnSgIagu0L8s1s=; b=nBeKJ2a5xzwr7WU+vhByRc8P1NPHFwo0u1bH+OYxyXrZzYcZIhqPEJjzbeALeJUnD5Lpq43LP1to/+UWXbn1xqqi2tVY2lBkOzmyMTkO1Bj+M34nHyOj6Tawbuu/cDYzbdBYUD3tXBu+E6pYGRc5zqAc7w4dkRImTDbHlM18+DWIyoApk0qUJVGwkF5IADlomwP7HDkhf/Fvp6lYkfd9HDyAiGd3UPDRTgXw+qTmefFm+ccYRjJMBZy6ebaqNFR10BGc/qqeg0c8Ha70TxCuec6sA1+qV4V6GtCIAZgbLC+6BsGJEbrusWbdLnIPzi4i7YsgAx7k0Lsp2n3Y/8OUeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LR5oPBZ0AnRu2lpuX9hdO6CmfCI5fpnSgIagu0L8s1s=; b=ipr3DGEFdPwaolo3BezY2CgFyO5mZ9sN0bqiBwF1kAmNUiPs49Y8UND6fjGx2gSmmx+HKLBDYsaaeF4QWmTizLvis3lSoMqwIolF8wryp2ea4h7v+V9wXWSF0/WWvqzZvz6RUEt8y6fddY9GoZkq3mkICHiPp3+/pG6MB7nZFp4= Received: from AM0PR05MB4866.eurprd05.prod.outlook.com (20.176.214.160) by AM0PR05MB6561.eurprd05.prod.outlook.com (20.179.36.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.18; Fri, 23 Aug 2019 14:53:06 +0000 Received: from AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::216f:f548:1db0:41ea]) by AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::216f:f548:1db0:41ea%6]) with mapi id 15.20.2178.020; Fri, 23 Aug 2019 14:53:06 +0000 From: Parav Pandit To: Alex Williamson CC: Jiri Pirko , Jiri Pirko , "David S . Miller" , Kirti Wankhede , Cornelia Huck , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , cjia , "netdev@vger.kernel.org" Subject: RE: [PATCH v2 0/2] Simplify mtty driver and mdev core Thread-Topic: [PATCH v2 0/2] Simplify mtty driver and mdev core Thread-Index: AQHVTfNxjgfwJJG2ZUiuOAmKCwQvf6bx3uKAgAWJU4CAAcVCEIAABCsAgAAWVtCAABCDgIAAzoewgAAqE4CAAECFQIAAFWyAgAAGbNCAABfqAIAAErcwgAjpulCAAJkHAIAAnVNggAAbk4CAAAOYgIAABpwAgAAAVrCAAAfEAIAADNCggAHJU4CAAAIMEIAABiaAgAAA2ACAACadAIAAFGdwgAE42YCAAABasIAAaLIAgAAC1QA= Date: Fri, 23 Aug 2019 14:53:06 +0000 Message-ID: References: <20190820225722.237a57d2@x1.home> <20190820232622.164962d3@x1.home> <20190822092903.GA2276@nanopsycho.orion> <20190822095823.GB2276@nanopsycho.orion> <20190822121936.GC2276@nanopsycho.orion> <20190823081221.GG2276@nanopsycho.orion> <20190823082820.605deb07@x1.home> In-Reply-To: <20190823082820.605deb07@x1.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=parav@mellanox.com; x-originating-ip: [106.51.18.188] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c89c3969-7092-4515-588e-08d727d99ba3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:AM0PR05MB6561; x-ms-traffictypediagnostic: AM0PR05MB6561: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0138CD935C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(136003)(39860400002)(366004)(396003)(346002)(376002)(13464003)(199004)(189003)(476003)(52536014)(102836004)(55236004)(6246003)(66066001)(25786009)(3846002)(316002)(71200400001)(71190400001)(4326008)(53546011)(6506007)(6916009)(6436002)(478600001)(99286004)(8676002)(76176011)(81166006)(81156014)(55016002)(6116002)(74316002)(7696005)(229853002)(9686003)(86362001)(8936002)(14454004)(5660300002)(486006)(186003)(30864003)(305945005)(561944003)(9456002)(33656002)(54906003)(2906002)(64756008)(66446008)(446003)(11346002)(66556008)(66476007)(76116006)(7736002)(53936002)(66946007)(26005)(14444005)(256004);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR05MB6561;H:AM0PR05MB4866.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: uI+7vo3NYo7KoccN3rphehY8+BsriFigJZSXwapHx0I2/267J4a6KRBOW0cVGmwFxDM0MtPIM+hvh5C4uQZ7x8BI1URkHgBm5sA20ZhwLJSiHfYZlGETMwJaCV9k0Sh1zYZfRQEJuEQ/sKZWHZE+ZjEmbgwbwu6x5SpMhREuSZytdk6rTnW67vQcBkTbiLt3IItCToAyWoIY5wNJ6iWqPxyuyCvQiZqi/Hxx2i172Ye+SdQ1Od6MKNYPzD5qfR9/VuxMOI+bjEpL1MW3R8jSifKQIKsXUVzI0SOp/yaCpFUwsA/2qbl3fZS1HHiLck/N+0mlfhs2xf7OZPBNg+PZ335LCoPe2fx+JEsy9ec1YFNogSQmjG/e5NA5g8UJ/8gl67E5WwGGSGcQGRkcu9jOqakupJD95VBAAd5HCr/MbGI= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c89c3969-7092-4515-588e-08d727d99ba3 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Aug 2019 14:53:06.7595 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Bj0+0U+mLGY+IgtDJmf/asbzL3WHfGoR2wB/EqBwucBQeLi4YKfdgk2arUlAuwLOmTEUscXv7L/ncmQsFoNwCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6561 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Alex Williamson > Sent: Friday, August 23, 2019 7:58 PM > To: Parav Pandit > Cc: Jiri Pirko ; Jiri Pirko ; David = S . Miller > ; Kirti Wankhede ; Cornelia > Huck ; kvm@vger.kernel.org; linux- > kernel@vger.kernel.org; cjia ; netdev@vger.kernel.org > Subject: Re: [PATCH v2 0/2] Simplify mtty driver and mdev core >=20 > On Fri, 23 Aug 2019 08:14:39 +0000 > Parav Pandit wrote: >=20 > > Hi Alex, > > > > > > > -----Original Message----- > > > From: Jiri Pirko > > > Sent: Friday, August 23, 2019 1:42 PM > > > To: Parav Pandit > > > Cc: Alex Williamson ; Jiri Pirko > > > ; David S . Miller ; Kirti > > > Wankhede ; Cornelia Huck > ; > > > kvm@vger.kernel.org; linux-kernel@vger.kernel.org; cjia > > > ; netdev@vger.kernel.org > > > Subject: Re: [PATCH v2 0/2] Simplify mtty driver and mdev core > > > > > > Thu, Aug 22, 2019 at 03:33:30PM CEST, parav@mellanox.com wrote: > > > > > > > > > > > >> -----Original Message----- > > > >> From: Jiri Pirko > > > >> Sent: Thursday, August 22, 2019 5:50 PM > > > >> To: Parav Pandit > > > >> Cc: Alex Williamson ; Jiri Pirko > > > >> ; David S . Miller ; > > > >> Kirti Wankhede ; Cornelia Huck > > > ; > > > >> kvm@vger.kernel.org; linux-kernel@vger.kernel.org; cjia > > > >> ; netdev@vger.kernel.org > > > >> Subject: Re: [PATCH v2 0/2] Simplify mtty driver and mdev core > > > >> > > > >> Thu, Aug 22, 2019 at 12:04:02PM CEST, parav@mellanox.com wrote: > > > >> > > > > >> > > > > >> >> -----Original Message----- > > > >> >> From: Jiri Pirko > > > >> >> Sent: Thursday, August 22, 2019 3:28 PM > > > >> >> To: Parav Pandit > > > >> >> Cc: Alex Williamson ; Jiri Pirko > > > >> >> ; David S . Miller ; > > > >> >> Kirti Wankhede ; Cornelia Huck > > > >> ; > > > >> >> kvm@vger.kernel.org; linux-kernel@vger.kernel.org; cjia > > > >> >> ; netdev@vger.kernel.org > > > >> >> Subject: Re: [PATCH v2 0/2] Simplify mtty driver and mdev core > > > >> >> > > > >> >> Thu, Aug 22, 2019 at 11:42:13AM CEST, parav@mellanox.com wrote: > > > >> >> > > > > >> >> > > > > >> >> >> -----Original Message----- > > > >> >> >> From: Jiri Pirko > > > >> >> >> Sent: Thursday, August 22, 2019 2:59 PM > > > >> >> >> To: Parav Pandit > > > >> >> >> Cc: Alex Williamson ; Jiri > > > >> >> >> Pirko ; David S . Miller > > > >> >> >> ; Kirti Wankhede > > > >> >> >> ; Cornelia Huck > > > >> >> ; > > > >> >> >> kvm@vger.kernel.org; linux-kernel@vger.kernel.org; cjia > > > >> >> >> ; netdev@vger.kernel.org > > > >> >> >> Subject: Re: [PATCH v2 0/2] Simplify mtty driver and mdev > > > >> >> >> core > > > >> >> >> > > > >> >> >> Wed, Aug 21, 2019 at 08:23:17AM CEST, parav@mellanox.com > wrote: > > > >> >> >> > > > > >> >> >> > > > > >> >> >> >> -----Original Message----- > > > >> >> >> >> From: Alex Williamson > > > >> >> >> >> Sent: Wednesday, August 21, 2019 10:56 AM > > > >> >> >> >> To: Parav Pandit > > > >> >> >> >> Cc: Jiri Pirko ; David S . Miller > > > >> >> >> >> ; Kirti Wankhede > > > >> >> >> >> ; Cornelia Huck > > > >> >> >> >> ; kvm@vger.kernel.org; > > > >> >> >> >> linux-kernel@vger.kernel.org; cjia ; > > > >> >> >> >> netdev@vger.kernel.org > > > >> >> >> >> Subject: Re: [PATCH v2 0/2] Simplify mtty driver and > > > >> >> >> >> mdev core > > > >> >> >> >> > > > >> >> >> >> > > > > Just an example of the alias, not proposing how i= t's set. > > > >> >> >> >> > > > > In fact, proposing that the user does not set > > > >> >> >> >> > > > > it, mdev-core provides one > > > >> >> >> >> > > automatically. > > > >> >> >> >> > > > > > > > >> >> >> >> > > > > > > Since there seems to be some prefix > > > >> >> >> >> > > > > > > overhead, as I ask about above in how many > > > >> >> >> >> > > > > > > characters we actually have to work with in > > > >> >> >> >> > > > > > > IFNAMESZ, maybe we start with > > > >> >> >> >> > > > > > > 8 characters (matching your "index" > > > >> >> >> >> > > > > > > namespace) and expand as necessary for > > > >> >> >> disambiguation. > > > >> >> >> >> > > > > > > If we can eliminate overhead in IFNAMESZ, > > > >> >> >> >> > > > > > > let's start with > > > >> 12. > > > >> >> >> >> > > > > > > Thanks, > > > >> >> >> >> > > > > > > > > > >> >> >> >> > > > > > If user is going to choose the alias, why does > > > >> >> >> >> > > > > > it have to be limited to > > > >> >> >> >> sha1? > > > >> >> >> >> > > > > > Or you just told it as an example? > > > >> >> >> >> > > > > > > > > >> >> >> >> > > > > > It can be an alpha-numeric string. > > > >> >> >> >> > > > > > > > >> >> >> >> > > > > No, I'm proposing a different solution where > > > >> >> >> >> > > > > mdev-core creates an alias based on an > > > >> >> >> >> > > > > abbreviated sha1. The user does not provide the > > > >> >> >> >> alias. > > > >> >> >> >> > > > > > > > >> >> >> >> > > > > > Instead of mdev imposing number of characters > > > >> >> >> >> > > > > > on the alias, it should be best > > > >> >> >> >> > > > > left to the user. > > > >> >> >> >> > > > > > Because in future if netdev improves on the > > > >> >> >> >> > > > > > naming scheme, mdev will be > > > >> >> >> >> > > > > limiting it, which is not right. > > > >> >> >> >> > > > > > So not restricting alias size seems right to me= . > > > >> >> >> >> > > > > > User configuring mdev for networking devices > > > >> >> >> >> > > > > > in a given kernel knows what > > > >> >> >> >> > > > > user is doing. > > > >> >> >> >> > > > > > So user can choose alias name size as it finds = suitable. > > > >> >> >> >> > > > > > > > >> >> >> >> > > > > That's not what I'm proposing, please read again. > > > >> >> >> >> > > > > Thanks, > > > >> >> >> >> > > > > > > >> >> >> >> > > > I understood your point. But mdev doesn't know how > > > >> >> >> >> > > > user is going to use > > > >> >> >> >> > > udev/systemd to name the netdev. > > > >> >> >> >> > > > So even if mdev chose to pick 12 characters, it > > > >> >> >> >> > > > could result in > > > >> >> collision. > > > >> >> >> >> > > > Hence the proposal to provide the alias by the > > > >> >> >> >> > > > user, as user know the best > > > >> >> >> >> > > policy for its use case in the environment its using. > > > >> >> >> >> > > > So 12 character sha1 method will still work by user= . > > > >> >> >> >> > > > > > >> >> >> >> > > Haven't you already provided examples where certain > > > >> >> >> >> > > drivers or subsystems have unique netdev prefixes? > > > >> >> >> >> > > If mdev provides a unique alias within the > > > >> >> >> >> > > subsystem, couldn't we simply define a netdev prefix > > > >> >> >> >> > > for the mdev subsystem and avoid all other > > > >> >> >> >> > > collisions? I'm not in favor of the user providing > > > >> >> >> >> > > both a uuid and an alias/instance. Thanks, > > > >> >> >> >> > > > > > >> >> >> >> > For a given prefix, say ens2f0, can two UUID->sha1 > > > >> >> >> >> > first 9 characters have > > > >> >> >> >> collision? > > > >> >> >> >> > > > >> >> >> >> I think it would be a mistake to waste so many chars on > > > >> >> >> >> a prefix, but > > > >> >> >> >> 9 characters of sha1 likely wouldn't have a collision > > > >> >> >> >> before we have 10s of thousands of devices. Thanks, > > > >> >> >> >> > > > >> >> >> >> Alex > > > >> >> >> > > > > >> >> >> >Jiri, Dave, > > > >> >> >> >Are you ok with it for devlink/netdev part? > > > >> >> >> >Mdev core will create an alias from a UUID. > > > >> >> >> > > > > >> >> >> >This will be supplied during devlink port attr set such > > > >> >> >> >as, > > > >> >> >> > > > > >> >> >> >devlink_port_attrs_mdev_set(struct devlink_port *port, > > > >> >> >> >const char *mdev_alias); > > > >> >> >> > > > > >> >> >> >This alias is used to generate representor netdev's > phys_port_name. > > > >> >> >> >This alias from the mdev device's sysfs will be used by > > > >> >> >> >the udev/systemd to > > > >> >> >> generate predicable netdev's name. > > > >> >> >> >Example: enm > > > >> >> >> > > > >> >> >> What happens in unlikely case of 2 UUIDs collide? > > > >> >> >> > > > >> >> >Since users sees two devices with same phys_port_name, user > > > >> >> >should destroy > > > >> >> recently created mdev and recreate mdev with different UUID? > > > >> >> > > > >> >> Driver should make sure phys port name wont collide, > > > >> >So when mdev creation is initiated, mdev core calculates the > > > >> >alias and if there > > > >> is any other mdev with same alias exist, it returns -EEXIST error > > > >> before progressing further. > > > >> >This way user will get to know upfront in event of collision > > > >> >before the mdev > > > >> device gets created. > > > >> >How about that? > > > >> > > > >> Sounds fine to me. Now the question is how many chars do we want t= o > have. > > > >> > > > >12 characters from Alex's suggestion similar to git? > > > > > > Ok. > > > > > > > Can you please confirm this scheme looks good now? I like to get patche= s > started. >=20 > My only concern is your comment that in the event of an abbreviated > sha1 collision (as exceptionally rare as that might be at 12-chars), we'd= fail the > device create, while my original suggestion was that vfio-core would add = an > extra character to the alias. For non-networking devices, the sha1 is > unnecessary, so the extension behavior seems preferred. The user is only > responsible to provide a unique uuid. Perhaps the failure behavior could= be > applied based on the mdev device_api. A module option on mdev to specify= the > default number of alias chars would also be useful for testing so that we= can set > it low enough to validate the collision behavior. Thanks, >=20 Idea is to have mdev alias as optional. Each mdev_parent says whether it wants mdev_core to generate an alias or no= t. So only networking device drivers would set it to true. For rest, alias won't be generated, and won't be compared either during cre= ation time. User continue to provide only uuid. I am tempted to have alias collision detection only within children mdevs o= f the same parent, but doing so will always mandate to prefix in netdev nam= e. And currently we are left with only 3 characters to prefix it, so that may = not be good either. Hence, I think mdev core wide alias is better with 12 characters. I do not understand how an extra character reduces collision, if that's wha= t you meant. Module options are almost not encouraged anymore with other subsystems/driv= ers. For testing collision rate, a sample user space script and sample mtty is e= asy and get us collision count too. We shouldn't put that using module option in production kernel. I practically have the code ready to play with; Changing 12 to smaller valu= e is easy with module reload. #define MDEV_ALIAS_LEN 12 > Alex >=20 > > > >> >> in this case that it does > > > >> >> not provide 2 same attrs for 2 different ports. > > > >> >> Hmm, so the order of creation matters. That is not good. > > > >> >> > > > >> >> >> > > > >> >> >> >I took Ethernet mdev as an example. > > > >> >> >> >New prefix 'm' stands for mediated device. > > > >> >> >> >Remaining 12 characters are first 12 chars of the mdev alia= s. > > > >> >> >> > > > >> >> >> Does this resolve the identification of devlink port represe= ntor? > > > >> >> >Not sure if I understood your question correctly, attemping > > > >> >> >to answer > > > >> below. > > > >> >> >phys_port_name of devlink port is defined by the first 12 > > > >> >> >characters of mdev > > > >> >> alias. > > > >> >> >> I assume you want to use the same 12(or so) chars, don't you= ? > > > >> >> >Mdev's netdev will also use the same mdev alias from the > > > >> >> >sysfs to rename > > > >> >> netdev name from ethX to enm, where en=3DEtherenet, > > > >> m=3Dmdev. > > > >> >> > > > > >> >> >So yes, same 12 characters are use for mdev's netdev and mdev > > > >> >> >devlink port's > > > >> >> phys_port_name. > > > >> >> > > > > >> >> >Is that what are you asking? > > > >> >> > > > >> >> Yes. Then you have 3 chars to handle the rest of the name (pci,= pf)...