Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4375583ybl; Tue, 20 Aug 2019 10:56:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjnWvCTZ5EDf1vJWeOHB1VhJw28bFopBtwNMQPVlCcD97mpsJl0q79/7o2+AXZ/S9kZ4HU X-Received: by 2002:a17:90a:1110:: with SMTP id d16mr1218856pja.29.1566323805426; Tue, 20 Aug 2019 10:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566323805; cv=none; d=google.com; s=arc-20160816; b=U36ecqBF+ud4uWZc6UR9KJu3Ooj/7VcDkRMxhQC+p+6/3EUs1wGUbw9DN4kJAF7hee 88TNkeXG2I5tlo711z8RrfoUSVxw46COGXyUV8An8qF1ydPEeVURQ42eHE6WrTVePIjm ar8FwTbGUdofmL2rDJ6MluiEApWKfOr529pZb96Bcgszie0VfRDOHRgOCMGpvv0Nu2qL J0Pkhd+AWociHdh2BYOC+Y4kTOuBDQOLXz8hGuIJkPjkEdFKsi4mWzIywm2r9pBQhfMl B9kTOS6SSO3Z/Cle0OPaWYHJdRoSeBe95JTy8ZYNsNOKc46JL7rLYiheO16m1AFHj6Kj Wqjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=qdLbGRH8Hw3IsMSZnPk69wzTAUpE5XRENQw5P+ksScY=; b=QoSG+cLqq+jGNWZs5QZfzq5Kwdpw1F5P9ExzJ6MDEkk7YgaVlfdP4WyYuipV+JQ0Fm 5W84cHvgRXh3vaXvdCRSvptotxsZvMoe7FReXXeF1qir2tqpX93B9nIOFtI8m5PPiOPK J3l/pvebNZnDZOb35DjpAWKjgsF4nErNEtepS2BxeplweeRmCS4rS1Hb6JXT8EQ9dGAo 8MowvOwC/SMHH24gH/TfaMD0FHMlEufzuitiSe/oQLFEUEKVH0E8Vbfy1RHHpfauz0sh CSzuZHqk9v8oyAui1uWOLtMuC4+lgEUpdxUelth7mSGiUpliF8+Yb7csUjfvURCRuQJ1 4UBA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si414517pjv.95.2019.08.20.10.56.28; Tue, 20 Aug 2019 10:56:45 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730586AbfHTRze (ORCPT + 99 others); Tue, 20 Aug 2019 13:55:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42162 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730423AbfHTRze (ORCPT ); Tue, 20 Aug 2019 13:55:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC99C308402D; Tue, 20 Aug 2019 17:55:33 +0000 (UTC) Received: from gondolin (ovpn-116-201.ams2.redhat.com [10.36.116.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 935161877E; Tue, 20 Aug 2019 17:55:25 +0000 (UTC) Date: Tue, 20 Aug 2019 19:55:19 +0200 From: Cornelia Huck To: Alex Williamson Cc: Parav Pandit , Jiri Pirko , "David S . Miller" , Kirti Wankhede , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "cjia@nvidia.com" , "netdev@vger.kernel.org" Subject: Re: [PATCH v2 0/2] Simplify mtty driver and mdev core Message-ID: <20190820195519.47d6fd6a.cohuck@redhat.com> In-Reply-To: <20190820111904.75515f58@x1.home> References: <20190802065905.45239-1-parav@mellanox.com> <20190808141255.45236-1-parav@mellanox.com> <20190808170247.1fc2c4c4@x1.home> <77ffb1f8-e050-fdf5-e306-0a81614f7a88@nvidia.com> <20190813085246.1d642ae5@x1.home> <20190813111149.027c6a3c@x1.home> <20190814100135.1f60aa42.cohuck@redhat.com> <20190814150911.296da78c.cohuck@redhat.com> <20190814085746.26b5f2a3@x1.home> <20190820111904.75515f58@x1.home> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 20 Aug 2019 17:55:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Aug 2019 11:19:04 -0600 Alex Williamson wrote: > What about an alias based on the uuid? For example, we use 160-bit > sha1s daily with git (uuids are only 128-bit), but we generally don't > reference git commits with the full 20 character string. Generally 12 > characters is recommended to avoid ambiguity. Could mdev automatically > create an abbreviated sha1 alias for the device? If so, how many > characters should we use and what do we do on collision? The colliding > device could add enough alias characters to disambiguate (we likely > couldn't re-alias the existing device to disambiguate, but I'm not sure > it matters, userspace has sysfs to associate aliases). Ex. > > UUID=$(uuidgen) > ALIAS=$(echo $UUID | sha1sum | colrm 13) > > 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, > > Alex I really like that idea, and it seems the best option proposed yet, as we don't need to create a secondary identifier.