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 CC66D45D06; Thu, 14 Nov 2024 17:25:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA6044025D; Thu, 14 Nov 2024 17:25:03 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 5299E4021F for ; Thu, 14 Nov 2024 17:25:02 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2114214c63eso7752875ad.3 for ; Thu, 14 Nov 2024 08:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731601501; x=1732206301; 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=n2iE3qYHfPDYWlptloAWqPnwsptxRMsG31OlvULwjyk=; b=YsCWPJloXedGBiqwdDuTFOZEbEb0w15GT6TTCYIFsTRzOXE3J6qY6P9azaMT+JrauD JK+qVjfdXQUyPRNI26SqP+ul2gg6g7ZNOrVyUFQMUGJ+KsH0r2h8+H8a2y3WCfNYHP92 aFEwiMsQfhUFrHs2BDV0rgHduU644n/7wrLE+VA/jZHzAWYMggvT7cKH0GTDLACqOHFJ A6ic6TWuiaYISwww6v9XFrICDgGceob8wkMH14lk0KBocwUQtz5hKU9YdEsA9qArBOB3 GQbf/XKt1YopSMLjuxtqIH62+peU5m86GbW+7IzyoMGdrpGLAx5Tf1kHzaAgGCu5eVCM LKRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731601501; x=1732206301; 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=n2iE3qYHfPDYWlptloAWqPnwsptxRMsG31OlvULwjyk=; b=S4fPOmdBndDsj3U1Hjx0TedWODWCJwb++DhMTOWxeVHqL6kMVqpokx95kDCvn1WLs5 zIbrTmOFU+Uh6zgilXOMzySTXh7VKZ0Vr9iLKJ7RwxWiysKkGXRTFGglemAad7KD45Rc 3ZMSdaPXoKEPcy923MCjH9WI2sEP5gtQgNXX+RxnWg3hjKjb1XQCpbZL7VOtyYc6AJ7N r8bz0Ny3oJhaUbXylsTic3G8WDOkC+jlPNg0a9VvA0TyIIE2xz6fipdsGCpzhFy6o8aQ gqdEOS+QcYHP+dv49sqeeUBKf/iCU/g/vw3cnV6ZdCGzK2fG5GHxzT5qwXbvpm0gas3W 9WLA== X-Gm-Message-State: AOJu0YxyMJka3OaVh8vx9zB2sBA0PebrwafNsI/bBxC3MIO/xlbpxtcm 5kzjZo7rmqMhMBD14NZLmv656o9bkVBOWkSEZaEJObsjDQdJs4D9fISKjjMCksE= X-Google-Smtp-Source: AGHT+IE1bAo2bI5ZG/Szfva4l6uprfEJn/O7+LGNnflU9CUpIx7jTViuT9I7ak69UPnF79IYllK0/A== X-Received: by 2002:a17:902:f541:b0:20c:cf39:fe3c with SMTP id d9443c01a7336-2118359be6bmr327376685ad.41.1731601501468; Thu, 14 Nov 2024 08:25:01 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211c7d06940sm12617295ad.199.2024.11.14.08.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 08:25:01 -0800 (PST) Date: Thu, 14 Nov 2024 08:24:59 -0800 From: Stephen Hemminger To: Congjie Zhou Cc: dev@dpdk.org, anatoly.burakov@intel.com Subject: Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init() Message-ID: <20241114082459.10a991aa@hermes.local> In-Reply-To: References: 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 Thu, 14 Nov 2024 16:37:10 +0800 Congjie Zhou wrote: > > +static uint64_t > +current_time(void) > +{ > + struct timespec ts; > + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) == -1) { > + EAL_LOG(ERR, "Fail to get current time"); > + return -1ULL; > + } > + uint64_t time_ns = (uint64_t)ts.tv_sec * 1000000000ULL + ts.tv_nsec; > + return time_ns; > +} > + > static int > secondary_msl_create_walk(const struct rte_memseg_list *msl, > void *arg __rte_unused) > @@ -1447,8 +1460,8 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl, > local_msl = &local_memsegs[msl_idx]; > > /* create distinct fbarrays for each secondary */ > - snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i", > - primary_msl->memseg_arr.name, getpid()); > + snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i_%"PRIx64, > + primary_msl->memseg_arr.name, getpid(), current_time()); > In general DPDK uses tsc instead of monotonic time, since it is faster and platform independent (ie Windows). Why not use use a global counter instead?