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 8DE55454DF; Mon, 24 Jun 2024 13:05:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64B1A4026E; Mon, 24 Jun 2024 13:05:27 +0200 (CEST) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mails.dpdk.org (Postfix) with ESMTP id 494F54026C for ; Mon, 24 Jun 2024 13:05:25 +0200 (CEST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a725d756d41so65018766b.0 for ; Mon, 24 Jun 2024 04:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netgate.com; s=google; t=1719227125; x=1719831925; 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=TzGkjSSke4Zd+vJxGb4dhwUn/TbjrUEoJNfOfzoA3PU=; b=GUL9cgmpWS7kRrsFgTcI8tf1k1kRZjm2+vY/iflVe3VA2X7PvizGktE4Vxi3qtCdiv GZxH39opogXH166GkPFubiwFR7v59wYjMOGpKdPjS+jlBwEy5w3vb9fjxBmqoUtFzXla rtpSqN6lJATcwbMl0kDVpZosquL3lcU4MBjX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719227125; x=1719831925; 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=TzGkjSSke4Zd+vJxGb4dhwUn/TbjrUEoJNfOfzoA3PU=; b=QV6hNTZ0Bz912+hxLqsD0bxS2DflJJ8ybsWLWfdlffx649g31fp/rzJeczPmk8owlo mZVE6fb05dAbHPatRWbIWWwVgYQb931d6VR90/eP5sRXsynlk764yY3W+fi7mpIb4g/U CEq5VdQnZ4jgy/BuLe5dRTlMoejRR+AdhqdGHFHwTaJDhWzLj7Z7J/UZN0hn1qbtZrQV FK8FnRMGX8uvxcNfn1TO6CL8fxhGMaN0YYvknRabUERuKuiYtjS0SnCRHVEF/BXZblLw 0O9CINC+w+92CUhc7CtLvp73ci6L65nIkoENGc8GptetuQPTUcuOo+g8lEcy6fwjBDaO /HdA== X-Gm-Message-State: AOJu0YySDESR8n71He/eMEJBJ1ao/SmA5UfaxXLM/wKX5VFjLA6cArry rhf6CP/uB0P2CNaEL+LKBJ0JOfLxTCkc4tNWr9hMu4MvoY9QMttLMJFtmRtx2w== X-Google-Smtp-Source: AGHT+IGdcfiCldKVYoXgc6TJ7unJ0dysyf3NAQxeFh4oji9ssR7uw+9ja4qXmsqMBg9S4gQNYjomnw== X-Received: by 2002:a17:907:a785:b0:a6e:feb8:eb15 with SMTP id a640c23a62f3a-a703860ae36mr396558866b.38.1719227124911; Mon, 24 Jun 2024 04:05:24 -0700 (PDT) Received: from u2204-pb1.. ([87.116.160.234]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf48b451sm395748666b.83.2024.06.24.04.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 04:05:24 -0700 (PDT) From: Vladimir Ratnikov To: longli@microsoft.com Cc: dev@dpdk.org, Vladimir Ratnikov Subject: [PATCH v2] bus/vmbus: add device_order field to rte_vmbus_dev Date: Mon, 24 Jun 2024 11:04:15 +0000 Message-Id: <20240624110415.3230-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 helpful 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