From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <users-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id D15A445BC0
	for <public@inbox.dpdk.org>; Tue, 29 Oct 2024 18:28:49 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id A690942EA0;
	Tue, 29 Oct 2024 18:28:49 +0100 (CET)
Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com
 [209.85.215.174])
 by mails.dpdk.org (Postfix) with ESMTP id A46D340267
 for <users@dpdk.org>; Tue, 29 Oct 2024 18:28:47 +0100 (CET)
Received: by mail-pg1-f174.google.com with SMTP id
 41be03b00d2f7-7c1324be8easo47317a12.1
 for <users@dpdk.org>; Tue, 29 Oct 2024 10:28:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1730222927;
 x=1730827727; 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=6eGIeuHIwW4qL8LgjVaePbBj3TaqfiFyTclpQyp+M6Y=;
 b=UGqY7HPPydJ9f5b25zqGEFrJF+X+vbwb8P1gyMSkU2EPTLf9NjTwFOrhgH3PJbgF6H
 cVu6MZm11ewJgDsYZn7hzCMzlo2uZbqhTqAApPrN05Zw4la+bvqbYIpPtO32CbovDxRj
 VeLm9vAJa6ctRA5NiuWmlAsU0znJ9y//GX6QxFlPI38vL8rQmwqmUdhdhNIydny6yZBC
 OE0J8r4GTqZWariVzhVHFdv+5kND2l559iMv1mHM2FOinQSrwrZjGHZZK6dk5arL37MN
 u523tFz4jviC/WcizGHrzqh7Oyn+twulf+GAKilsDqEBh3ZTGfUsVzhOHqwh1Bz3oAZi
 0dAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1730222927; x=1730827727;
 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=6eGIeuHIwW4qL8LgjVaePbBj3TaqfiFyTclpQyp+M6Y=;
 b=B49wtySZtBUeK4zwcAbyQAqz6mgbLbxXCKdCLO1metrPhm9OGYRAleIvxKho8CLhWf
 2qEZ1EH/hKFTf4+Tfj1Vz1er6ak/n/+uwFeTPJZtiKawSIuljAB/XefeEIHURpEH+CRO
 uc/Clm0ZNnX9FrwT1md1GN/A0F+ptCY2FY0eu1kPVN7WO51Jyfkb/wjcXBh3wInMU2H1
 fgIbhzlpDwNXWDfZwqqJItC8ohEV0tKE4TDg2zFp5ZwF7ms3v3nVBPA/HkXs0AZ+egL4
 HelDb3kKlaMdsOp1sdzsScvREY0bm4B+Sy4AbElOAxzVf2usBSPbAsV5QRxzDSeZoVaR
 BCKg==
X-Gm-Message-State: AOJu0YyHM7aDCiW9Vppa4JjkcbYxzyJduMPdwxMUeghn7AQiRZ8oEU4f
 gg20VHbum4l/dIOxBPrNfDn1PfR24C4IitD+2iXIiyKOCgWN8Is5asKLu/M8vhM=
X-Google-Smtp-Source: AGHT+IEMOQO244HZvTEmmz6qX047wR+4BP5EvC7fS6RNEEjQ9FMsNJsr+cFpH9sMIxFrXE5YNeL4FA==
X-Received: by 2002:a17:90a:9c0d:b0:2e2:7f8f:3ad5 with SMTP id
 98e67ed59e1d1-2e92204cd10mr4601559a91.2.1730222926669; 
 Tue, 29 Oct 2024 10:28:46 -0700 (PDT)
Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-7edc89f36ecsm7804989a12.72.2024.10.29.10.28.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 29 Oct 2024 10:28:46 -0700 (PDT)
Date: Tue, 29 Oct 2024 10:28:44 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: Antonio Di Bacco <a.dibacco.ks@gmail.com>
Cc: users@dpdk.org
Subject: Re: Adding a new core to a DPDK application that is already running
Message-ID: <20241029102844.2d7bb710@hermes.local>
In-Reply-To: <CAO8pfFn+yFbGgLjX+rzMw80XUYm5=P3CqWFXb3e7AZK7b5+v-A@mail.gmail.com>
References: <CAO8pfFn+yFbGgLjX+rzMw80XUYm5=P3CqWFXb3e7AZK7b5+v-A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
Errors-To: users-bounces@dpdk.org

On Tue, 29 Oct 2024 18:11:13 +0100
Antonio Di Bacco <a.dibacco.ks@gmail.com> wrote:

> I have a DPDK application that starts with a set of predefined cores.
> 
> Now, at runtime, I want to assign a new core to the application
> without restarting it, then the application is notified to spawn a
> thread on it.
> Is this possible ?
> 
> 
> Regards,
> Anna.

Yes and no.
Yes you could create a thread and affinity it to an lcore; but you would
have to do that manually (there is not exposed API). And you would have
to register that lcore.

But, it is not tested. The application would probably have to change,
and you then have to design some mechanism to do mutual exclusion
during the change in lcores. Putting lock in hot path will kill
performance.

Also, some drivers may not expect number of lcores to change.

Short answer: not a good idea.