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 4C704A050B; Thu, 7 Apr 2022 15:14:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E771D4068B; Thu, 7 Apr 2022 15:14:49 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 42E5F40689 for ; Thu, 7 Apr 2022 15:14:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649337287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6hnLwbFdi99bB0tu1gERx1R1/ICkJ6od99bnZhIyn3M=; b=Bn9BQ2f3BYNX5wMENSp6Y1OpKZqubKQOHhc7AKvVZjT45DjoozK24MMfzIl0JfT5/HgjoQ RRnhNiNq3l+zax5e+Cv3BVaY/CAlhpyMUxN/CDo3UBG6SotvEC7fhNwbNI2axXFU6kcADt xxfNoACk+WQpRdSYsWn7WH9EbLZwzxs= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-7eN4tUXsMBOk1iKrJ0uW0w-1; Thu, 07 Apr 2022 09:14:45 -0400 X-MC-Unique: 7eN4tUXsMBOk1iKrJ0uW0w-1 Received: by mail-lf1-f71.google.com with SMTP id d12-20020a05651233cc00b0044ad60fe93dso1823094lfg.11 for ; Thu, 07 Apr 2022 06:14:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6hnLwbFdi99bB0tu1gERx1R1/ICkJ6od99bnZhIyn3M=; b=jRIpZJbzSaYZV1hck3FU5jibUptJghICM+xJOCa7YNGts9iXBajeKl65sRsbhqlRPB R/o0XgNllkTt5z6RU5WpQIQfVUGmo3jU5kLHqcSLqn2YU4k8pyLRETJQwaxgF7EyfQcM WLqCZOei79BugjdJLGquwBd+saRGnSdWzdD3G8fBZlVg4CH1Mj0nfpscNMH9GK9k2JSg EDS1T+ZPoDUeFwFHhJ7npN1tjo/8a5xHzTZhWdpF3uVYYlOj94PjWsDea5qlgDEuy+q5 eDdEovCYC9qxp3srpFNEpzInfmC36lzvZZ3zeLCUoMuy2Y2MdwqWfKvn9XNuxvBKSCbS RV3A== X-Gm-Message-State: AOAM530CafnWiX6iS8j0uG4uHYu8AkCN4c9fqvMzS96RtZNnx86BHdnt zmbozpe+g0Me9K4x4JkHxSIPVstfolCxUp9egTm4PauDp/pky/981ypdW5X3/CP2RVtZ6/u0O+3 TrbjMCDGGz66WmDGQ9Og= X-Received: by 2002:a2e:864c:0:b0:24b:4c8:d0df with SMTP id i12-20020a2e864c000000b0024b04c8d0dfmr8676105ljj.333.1649337284398; Thu, 07 Apr 2022 06:14:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6e0VzGrveKTuyjIwYxtlIdAcOytu5ssM92QFEDSTjhcaNPq6XAfvhklYmuuRQASNsroROAdV/QgFEuUjPcCY= X-Received: by 2002:a2e:864c:0:b0:24b:4c8:d0df with SMTP id i12-20020a2e864c000000b0024b04c8d0dfmr8676090ljj.333.1649337284160; Thu, 07 Apr 2022 06:14:44 -0700 (PDT) MIME-Version: 1.0 References: <1648630829-4372-1-git-send-email-roretzla@linux.microsoft.com> In-Reply-To: <1648630829-4372-1-git-send-email-roretzla@linux.microsoft.com> From: David Marchand Date: Thu, 7 Apr 2022 15:14:33 +0200 Message-ID: Subject: Re: [PATCH] eal/windows: set Windows main lcore affinitization To: Tyler Retzlaff Cc: dev , Dmitry Kozlyuk Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Hello Tyler, On Wed, Mar 30, 2022 at 11:00 AM Tyler Retzlaff wrote: > > add missing code to affinitize main_lcore from lcore configuration. Nit: Add* > > Signed-off-by: Tyler Retzlaff > --- > lib/eal/windows/eal.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c > index ca3c41a..9c61780 100644 > --- a/lib/eal/windows/eal.c > +++ b/lib/eal/windows/eal.c > @@ -401,6 +401,12 @@ enum rte_proc_type_t > return -1; > } > > + if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t), > + &lcore_config[config->main_lcore].cpuset) != 0) { > + rte_eal_init_alert("Cannot set affinity"); > + rte_errno = EINVAL; > + return -1; > + } > __rte_thread_init(config->main_lcore, > &lcore_config[config->main_lcore].cpuset); > - It looks like the affinity is dumped for workers (see below), I would dump affinity for the main lcore like other OS do: ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset)); RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%p;cpuset=[%s%s])\n", config->main_lcore, thread_id, cpuset, ret == 0 ? "" : "..."); - Which makes me notice that windows/eal_thread.c probably dumps random stuff in logs because it is missing a call to eal_thread_dump_current_affinity() to format affinity as a string. lib/eal/windows/eal_thread.c: char cpuset[RTE_CPU_AFFINITY_STR_LEN]; lib/eal/windows/eal_thread.c: __rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset); lib/eal/windows/eal_thread.c: RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%zx;cpuset=[%s])\n", lib/eal/windows/eal_thread.c: lcore_id, (uintptr_t)thread_id, cpuset); -- David Marchand