From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EDB2042C40; Tue, 6 Jun 2023 17:32:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 785CC4067B; Tue, 6 Jun 2023 17:32:10 +0200 (CEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 592F840223 for ; Tue, 6 Jun 2023 17:32:09 +0200 (CEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-651e298be3fso6092417b3a.2 for ; Tue, 06 Jun 2023 08:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1686065528; x=1688657528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=flH/csnpqgb7Cw0nvVpW09++mKagLO0pDYbBqllNFUk=; b=P1ZGxihzH570Ikl3NWZ0dmxiqrwVMHmiJy0MlCfOVrFwnJRiMVtQ02AtYPZNw1Z38t fNcu1xqqD8VjLvMcQafaC9GwBrKZlRJK2v41C6lcgdIaSJjRrlQ7diffr/o964QcaMFR kJgXn48J3cb/VY/Nbsf9C0UwuRRtRNk58OnhJ7oFCmhiKJvOKQ3OToiMQFA7AwAj0fvA IjBi0VbXDwlo1mBx+BVrq1RHbUHjALTKWK1WgConhOLWaHcfU27QmMEO0bvI8lLpkVo+ zR0tOeDx1dj7Nb9nDN6ZxfYq4olBKDe+ZoY3nUu4Cn81gJ08NvI+B/xvAN0idVqpwhLQ 8uSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686065528; x=1688657528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=flH/csnpqgb7Cw0nvVpW09++mKagLO0pDYbBqllNFUk=; b=lzj/dSb0DFupBBHWjN5eZ0YmGRD5B0IAigY9uGwU2sY03otLcMxiraSdDa9dUu6OPw hP3nRHkMcNWJXTitHyInGD1MmASXH/qaeg+SFjxLzbRRyzuA+H01FEDZaGEK2rcCWpRB jg4RvmI3xN9qlCHso3ucm3yyDAajXMMRUGDjRyjc5EMXKbvLfpFFuIIb72c2VBJ6Cg1N v4d59Yo0K3Q/81GsCdFX7F+Mpd1QE/YRJCU+vJEOtAjbcmzayrZQQRgjHczQMj9QIgUU npy4/US+ztPP9hMqlMkYFynlFNn6gOZm9Yu22v7y9cbgA1NqnRz31P1IWZrg9NqL80zf 5oVQ== X-Gm-Message-State: AC+VfDx1+f2Ge7CHOJYaSFaZHgKBcWPSGlAsLAhLJYkUgGWBzLYtFD5x Ijzk/rtfjoiyNsIC5c1jXmKGLA== X-Google-Smtp-Source: ACHHUZ7M0Vi9/mCo9wShYqpdkICvCUoIm+hPsKX4J1TFRnFrE0H+Th5zkA5ln2dfNxasGi61nxrCRg== X-Received: by 2002:a05:6a20:1447:b0:116:99fe:e674 with SMTP id a7-20020a056a20144700b0011699fee674mr125449pzi.9.1686065528394; Tue, 06 Jun 2023 08:32:08 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id k71-20020a63844a000000b00543f7538d64sm1218863pgd.31.2023.06.06.08.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 08:32:08 -0700 (PDT) Date: Tue, 6 Jun 2023 08:32:06 -0700 From: Stephen Hemminger To: Ivan Malov Cc: Thomas Monjalon , dev@dpdk.org, Andrei Izrailev , Ferruh Yigit Subject: Re: Getting network port ID by ethdev port ID Message-ID: <20230606083206.7ff84ecf@hermes.local> In-Reply-To: <9283e499-fc1a-2e68-8b3f-ba6d2e340b5@arknetworks.am> References: <19381599.sIn9rWBj0N@thomas> <42152109.doPnVEEUbh@thomas> <20230605115054.62cdc8e2@hermes.local> <20230605153906.0b7912b0@hermes.local> <9283e499-fc1a-2e68-8b3f-ba6d2e340b5@arknetworks.am> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 6 Jun 2023 11:16:21 +0400 (+04) Ivan Malov wrote: > In general, I agree that there might not be too many vendors > that provide multi-port adapters. But in what comes to > bifurcated model = I'm not sure that I understand why > we confine our discussion to it. What I mean is not > Linux interface IDs. I mean enumerating physical > ports on the network card and providing mappings > to the application, like "physical port 0 maps > to PF 0". My hunch is that this information > can be available in vendors that do not use > the bifurcated model; they might be able to > retrieve it from their internals just like > any other aspect of card configuration. > > When you suggest that I stick with using PCI information, do > you mean precisely "/sys/class/net//dev_port" et al? > If yes, unfortunately, it seems like these fields are not > filled the same way for different vendors, sometimes they > aren't supported at all. So, I'm not pushing to add such > means to DPDK, but it might be useful to applications. I meant look in /sys/devices/pci0000:00/0000:00:01.1/ etc. But after looking deeper, it gets messy, so probably does need to be in EAL to handle FreeBSD and Windows. There is a multitude of different values possible. - acpi_index - which comes from BIOS - dev_port - only available if device has multiple ports - pci_slot - comes from hotplug - dev_id - old kernels with ipoib These all do not depend on a bifurcated driver. All devices even dedicated ones will have this. Probably more likely to see a dual port dedicated NIC. If some one makes a new API (rte_ethdev_slot_info_get)? it could provide both slot and port in slot information.