From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id D99912C8 for ; Thu, 29 Jun 2017 09:56:31 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id u23so939644wma.2 for ; Thu, 29 Jun 2017 00:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=seqJRmeMNHq2Q32/ulhQaubJxaNeM/HgcWJbPe5k0Us=; b=tzsNTB57+puRcmUDCej6nml+Nef79e8vrnemeUAt9rcFfRQhDJqbed7vc5d8ZrF0zG Ryus1ZuPcSHM7Wx/CgA71+WVROWlV3Kfp0pFuKNBtKCHpEyy9kEKFO02WfrWZ7E3rBcX u3zZYd1obYt3Ji4Q4GfRjRnXXGLVYA3oktSYPekb3jVa0M4wcD1nVeYLOZvXPVIrA+X3 c4FOu6+UI197whLxIoz4hYHzASjj0NQcA2w0+KPaH3ARG3Lx/VJ9Tkd5OczcUGZWydGQ bC6O6TtPeYHH8eJvcPQ4QZ2bj2lWf9s3tvWzxUtQWZ58BtwSDVDqfFm6M2hFuoPsXoS+ iJow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=seqJRmeMNHq2Q32/ulhQaubJxaNeM/HgcWJbPe5k0Us=; b=UOvlOM+McAN3wrGlGSniHGclSJbnk64UYxcF0pfhKft/D3lCGanckJ8jx/qIAi69Tg xRwil9NkPPZrDtksp+fxnpFf5SoKTVvhICByE/zgm7LZe07qAYh5fsFnrx2aTC3C0nHX dad8JLfhc9xFEAgKuh2D5S17z7r6zB3qFpryMcQb7ERQpv7r72OBxPy1/lsgOY7I0IXW e3fhTspC2X/u2TQ/Lx+sdXHGmPWAeXY3hIrgJeyXJq24/6vhD3NT7hfKV6E2eQmDIO/2 1+r9rEak5QkxOzjGpJMycN1HNo4/BImH72hnd+hBhuP0iaDBEOJcTGclJy24eddgGrHe /ihA== X-Gm-Message-State: AKS2vOwJKH9yC25AA6eYJJebGvWzUqZQTHRdJHzZgNXm1ILqr8QPlnI/ uu6IJqwpN9uy/+Dczz4aliHnflfbKVAD X-Received: by 10.28.134.79 with SMTP id i76mr753220wmd.108.1498722991470; Thu, 29 Jun 2017 00:56:31 -0700 (PDT) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.5.136 with HTTP; Thu, 29 Jun 2017 00:56:30 -0700 (PDT) In-Reply-To: <2359359.ae4fqFO3lF@xps> References: <2359359.ae4fqFO3lF@xps> From: Jan Blunck Date: Thu, 29 Jun 2017 09:56:30 +0200 X-Google-Sender-Auth: F5-xY2JBrYsXt9bb4mVPUcpkf6w Message-ID: To: Thomas Monjalon Cc: dev , Gaetan Rivet Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5 5/7] bus: add helper to find a bus from a device name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 07:56:32 -0000 On Wed, Jun 28, 2017 at 7:03 PM, Thomas Monjalon wrote: > 27/06/2017 20:55, Jan Blunck: >> On Wed, Jun 21, 2017 at 1:30 AM, Gaetan Rivet wrote: >> > /** >> > + * Find a bus capable of identifying a device. >> > + * >> > + * @param str >> > + * A device identifier (PCI address, virtual PMD name, ...). >> > + * >> > + * @return >> > + * A valid bus handle if found. >> > + * NULL if no bus is able to parse this device. >> > + */ >> > +struct rte_bus *rte_bus_from_dev(const char *str); >> >> I still don't agree with this. The bus name should be passed >> explicitly by the user of the API. >> >> NAK. > > Please explain why you think the bus name should be explicit. > If the bus is ambiguous, it can be explicited by the user. > > I see some good benefits in being tolerant with the bus/device > representation. It provides a smooth transition to the bus model. > We build libraries. The applications we build with the help of those libraries get notified by the OS about device events. Those devices are chields of their parent bus. At the time the event is fired the OS already knows about: - the bus name (parent) - the device name (child) - additional event parameters (environment) Blame me that I probably spent too much time with Kay Sievers and GregKH to understand that device naming is easy to get wrong. Just look at the hyperv device names and how they switched to the UUID scheme. I don't think that hyperv is the only bus that uses UUID as device identification. We should not codify a policy of how to deduce a bus name from a given device name if that is knowledge that is already present externally. Otherwise I fear this part of the EAL will be subject to constant churn.