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 79726456E5; Mon, 29 Jul 2024 19:43:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BCB440E24; Mon, 29 Jul 2024 19:43:33 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id 4B8AC40E78 for ; Mon, 29 Jul 2024 19:43:32 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52ed741fe46so4011327e87.0 for ; Mon, 29 Jul 2024 10:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722275012; x=1722879812; darn=dpdk.org; 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=NPvtifY5qxiWAT5uoaWOQgq813R63oHFOskXk4ukocc=; b=As/sqY3y/fF709FEbJE+zvZKdrP6fOW9ETge8xWWyXf/DupihG9tNONyqABMyZJxe+ HC89TljcvksmQ9X+W1kJMjJ9uMhbwnx+pYTol4hFg2IIVbCxW+KFXwNVGjlVzpVd3I6W ch1v84Fe54LdqpHDQpHitlUILqbZmaTVY+bddEiXDgWlAwWV3VjbI2yRrlfUqEtwo5PD eBfWGLu+VYOVT+xbBDUaoNg9ZYHKagm+7vwISUIhYrqjmpdqJJBBzB4FqXDsh7Krsa3I q1Og9ZAkl+muEiSjXEXMntGzaFkG5hwDgyQT5SFU44CrLtv1el0+1ofOvhBIFfLwh+FP KSvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722275012; x=1722879812; 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=NPvtifY5qxiWAT5uoaWOQgq813R63oHFOskXk4ukocc=; b=AaXsmxyiu/nuTkm6Y8BRxaHQMQtWWGuUgTsGu//oBQK9BTAGIGnYofLm6wTXeeHnKe GKLIHpnGLTMyQLwifSlznUqPvk7Q+navT8123zWnBK33DBREislPxzh/bGQ4qj11RK3E 7quJlENGN+/bCzaZ2M6Z2nIfnrZKr6GsgaEIn51kcN1MkhGmW5QuBXabxGHGC7HrQfcz 2p4sEGhZUlQSJnQ6tJfYyEWGGbt39PCtVh4V+XvT52p2oXd9dJbI2ky8U/BxOniukXzE 9sEOh4zhNU+rrOlF9ID7O3sIDxRMS134fcirgwjkdSfAm5BYZqVB0cg7iPaGUIrP5Ezw znAg== X-Gm-Message-State: AOJu0YytsjI8BEBUofwT60nK39V0Vw1kdeTFpvQ0YskxMf5fwOXn7Iuv 3+bgpE+kdftItboVgFzlbuOeAwJUtBt+BBg3vdkza+alDXET02w7pVZA5Q== X-Google-Smtp-Source: AGHT+IGTwiD3Aat7nCk/dPhtFo/E4ZV7CkaMHzAAG5KQzegXWN6x2kryhk49FK0AmzaiIf4vcUN5Ug== X-Received: by 2002:a19:f70b:0:b0:52c:9383:4c16 with SMTP id 2adb3069b0e04-5309b27a1bdmr5015595e87.22.1722275011135; Mon, 29 Jul 2024 10:43:31 -0700 (PDT) Received: from sovereign (broadband-109-173-110-33.ip.moscow.rt.ru. [109.173.110.33]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52fd5bc4159sm1565437e87.11.2024.07.29.10.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 10:43:30 -0700 (PDT) Date: Mon, 29 Jul 2024 20:43:29 +0300 From: Dmitry Kozlyuk To: Prashant Upadhyaya Cc: dev@dpdk.org Subject: Re: Regarding port numbers assigned by DPDK for PCI devices Message-ID: <20240729204329.58b888fe@sovereign> In-Reply-To: References: X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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 2024-07-29 22:18 (UTC+0530), Prashant Upadhyaya: > Hi, > > I have 4 ethernet interfaces available as PCI devices. > The PCI addresses are known. > When I start my DPDK application, it starts up properly and assigns the > port numbers to them as 0, 1, 2, 3 expectedly. > > However, is there a way I can force that a particular PCI address should be > identified as port 0 by DPDK, another one as port 1 and so forth ? > Does passing the arguments like -a -a to rte_eal_init > ensure that, or is there any other way, or is there no way ? > > I am on 24.03 > > Regards > -Prashant Hi, Why do you need specific port numbers assigned to devices? If you're going to use devices for different purposes, you'd better have an application-level configuration to specify PCI addresses to use for each purpose. Iterate devices to match the address and find the port number. It is also possible to disable automatic probing with "-a 0:0.0", then to use rte_dev_probe() + rte_dev_event_callback_register() to add devices and to get their port numbers. However, this API, strictly speaking, does not guarantee that the numbers will be assigned sequentially. One advantage of using hot-plug is that you can build devargs from within the application (or from configuration). Refer to "rte_dev.h" in any case. Multiple "-a" don't work the way you've described.