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 3E528454DF; Mon, 24 Jun 2024 12:56:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 158554026E; Mon, 24 Jun 2024 12:56:29 +0200 (CEST) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mails.dpdk.org (Postfix) with ESMTP id 8C35D4026C for ; Mon, 24 Jun 2024 12:56:27 +0200 (CEST) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-57d26a4ee65so3835612a12.2 for ; Mon, 24 Jun 2024 03:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netgate.com; s=google; t=1719226587; x=1719831387; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l6IYJxBcYKTxCM9Fp/WO1sJKGWNg2L7Q4ryLnz9veG8=; b=rn0HiA2VLZhgn0vG3D08Qp9OSKYJcDepQavKTHc6eh4Izm40FfE83rle/hf9Y5kc0W 8ib9tk7nto2WUvfRUtTS6nJx/x+vD98/QemOEx5EVVPfCad1BoiGxSEfDV4SAWmXWv6I 69dzc4zJ990YNNvf8sziK6xf3rk5omHcavunY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719226587; x=1719831387; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l6IYJxBcYKTxCM9Fp/WO1sJKGWNg2L7Q4ryLnz9veG8=; b=FeazLE+ptKqrJhVbXXt/PIvss6HJvDFcer+g7BNNnT2RH5j6LPQn7FKU4WJE/VgDnH FLVW/6Yu3Uf724/zQbwopnqfB7nbqSs89AKUzGKFXwakp9dykznamhXdW3TIoO9Ag745 8dM0UKtZqWSBVeeE/7Y266STO2QEv1NKdGU95saOYgdzCmo2or7+99T+ZkwHq0g/CLbV I6XDSoQEb2OBljqwL4PxuBvsM3N2ft0oAkIBiX9aMquvN+C8IdNHKzmDpDScLSRFZOB9 XtD+/tcazQ3MZsfDERf7fH011mP/kGXsbhDsqNvf21/0ZSld/nhusUhO/eg340U/Xege YGsg== X-Gm-Message-State: AOJu0YxayceVIQmGSWVm8Et7ZUAGep4Cnzz2jlrUshmwsfGcUULTKbT8 BFLnHEosZit6q+4TMLjzqnzWBlG/e58ierKa0xr2d1Z+kodqLZw4mkGqRVPfXg== X-Google-Smtp-Source: AGHT+IEUpTPNdvsnVYyqs5PUlWm+A1jTuPpUwmxosOy1zzLqR55PI3cJetQf6FXHNTWBD2eHJEKgKg== X-Received: by 2002:a17:906:c2d3:b0:a6f:931b:431 with SMTP id a640c23a62f3a-a7242cb6e83mr253678366b.34.1719226587028; Mon, 24 Jun 2024 03:56:27 -0700 (PDT) Received: from u2204-pb1.. ([87.116.160.234]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72479f360bsm187627966b.173.2024.06.24.03.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 03:56:26 -0700 (PDT) From: Vladimir Ratnikov To: longli@microsoft.com Cc: dev@dpdk.org, Vladimir Ratnikov Subject: [PATCH] bus/vmbus: add device_order field to rte_vmbus_dev Date: Mon, 24 Jun 2024 10:56:17 +0000 Message-Id: <20240624105617.3113-1-vratnikov@netgate.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Field can be used to have static interface naming in DPDK based applications instead of uuid. RTE_FOREACH_DEV won't return the correct order of such devices due to vmbus_ignore_device in case of blocklisting/allowlisting. So device_order field will be helpfull in that case. Signed-off-by: Vladimir Ratnikov --- drivers/bus/vmbus/bus_vmbus_driver.h | 1 + drivers/bus/vmbus/vmbus_common.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/vmbus/bus_vmbus_driver.h b/drivers/bus/vmbus/bus_vmbus_driver.h index e2475a642d..6b010cbe41 100644 --- a/drivers/bus/vmbus/bus_vmbus_driver.h +++ b/drivers/bus/vmbus/bus_vmbus_driver.h @@ -37,6 +37,7 @@ struct rte_vmbus_device { rte_uuid_t device_id; /**< VMBUS device id */ rte_uuid_t class_id; /**< VMBUS device type */ uint32_t relid; /**< id for primary */ + uint16_t device_order; /**< Device order after probing */ uint8_t monitor_id; /**< monitor page */ int uio_num; /**< UIO device number */ uint32_t *int_page; /**< VMBUS interrupt page */ diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c index b9139c6e6c..1a64ab2712 100644 --- a/drivers/bus/vmbus/vmbus_common.c +++ b/drivers/bus/vmbus/vmbus_common.c @@ -199,7 +199,7 @@ rte_vmbus_probe(void) char ubuf[RTE_UUID_STRLEN]; FOREACH_DEVICE_ON_VMBUS(dev) { - probed++; + dev->device_order = probed++; rte_uuid_unparse(dev->device_id, ubuf, sizeof(ubuf)); -- 2.34.1