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 B057C454DF; Mon, 24 Jun 2024 13:15:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 889DC4026E; Mon, 24 Jun 2024 13:15: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 D4B2E4026C for ; Mon, 24 Jun 2024 13:15:28 +0200 (CEST) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-57ccd1111aeso4919015a12.0 for ; Mon, 24 Jun 2024 04:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netgate.com; s=google; t=1719227728; x=1719832528; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TzGkjSSke4Zd+vJxGb4dhwUn/TbjrUEoJNfOfzoA3PU=; b=dMCddLdiGbfrjuID75pMYpWNFr7KcL+9Jn9L8wrjIFhiHVwzdp5AWKFqDKwUr7ZAK2 YwPDQn0ILZ93CFXrRfWxpx/w/22+zYXAsWoD/HXVG7TG6Er9K7vtpRMLIZVEY+fVY7yP qp7K8Hm6CCRHau+rUMe59BBDmTrJrTRWNEUBI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719227728; x=1719832528; h=content-transfer-encoding:mime-version:references:in-reply-to :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=DVsxcWk4m+BW6JWkv48BDnZrySSLsWIASbaVtOShBRGYi8LoZe0z7mtIoANUkW7fXC /RGRkpob4rzgXKoir4q4huUxIrHlBF+mRDpk+9Qw277ZEyfJhRMr8hqdt+Hcj5zsQikQ yI4s1OE7K6FaC0rveIHIkp97jEJLvatDG6eC/jAy5z6DduXP2TEymxeRhis07s+IYbJJ dIaLMMYSeP1xvHTYblPH9GC1SxF+kltBFFR/5w3Z+lyWaagNrZ+KK2OaJdxyEXC11LJg pfmdfEQLhorYG1VqFsWxltfckjfL6rhKcqpFQhYrDZ2oIlniZHBxkQIO7zzSlcXFQG9o YIZg== X-Gm-Message-State: AOJu0YwhiB+ApnJ+62l4OdnAkw41d5FzeyR0QryX7+tFD0STKmAFfJF8 Py307figzvk8vgEd2mAoQNXMxUsHvofUYjyke8342tMXzjQleYSPnvTQ1LSc/jCebJ2I8nTKvHY = X-Google-Smtp-Source: AGHT+IGWTfwOPwhjQvZFAyoO8f0+M+I+hO/eEnWISCCYVCyv9yhAAL5oFUsW3L7/y/rOTMvr3L8uMg== X-Received: by 2002:a17:907:9116:b0:a6f:b41d:237b with SMTP id a640c23a62f3a-a7242c3f5f3mr299188166b.32.1719227728230; Mon, 24 Jun 2024 04:15:28 -0700 (PDT) Received: from u2204-pb1.. ([87.116.160.234]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7263b3d60esm3153666b.113.2024.06.24.04.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 04:15:28 -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:15:21 +0000 Message-Id: <20240624111521.3253-1-vratnikov@netgate.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240624110415.3230-1-vratnikov@netgate.com> References: <20240624110415.3230-1-vratnikov@netgate.com> 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