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 A9CFF45B51; Wed, 16 Oct 2024 16:58:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63664402DD; Wed, 16 Oct 2024 16:58:18 +0200 (CEST) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id B7429402D8 for ; Wed, 16 Oct 2024 16:58:17 +0200 (CEST) Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-7ea76a12c32so3376710a12.1 for ; Wed, 16 Oct 2024 07:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729090697; x=1729695497; 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=Tt7PvvyGl1LcNkxMd17nx+w0m+fy1frFR/MiaPibmwY=; b=OlfOEkZs2HOQxdPe/edlbyHooFYfihxZdl4eCP8KsYMjzo+qrHan5Jcxq4XW2VFFVc cRKmZe8OpLsiClmmCFFwkVX+w/0M0EdcsI9AUMKVE82I4lWZzEqyEEA8R0dMbjtVb2gW hrWnUz22GdVSaVDMzKfdFuchrilaKtrWigLhoRGNZZU/oi3kCcTgCczBW5Yi6CEf4okC +NUE7LpmzZe+0lscKyUtDKPs1LLhVJm9dLYZk5qMmYmvSquKo+u6Bf+mMtHQcbFpSTyG M26hA1XgDOrSNqg+g8M2I6dSEqBYO9qKULeZhJ9Yn95EqrwGx94VHKXIwMuHgKz+ftSK Qjyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729090697; x=1729695497; 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=Tt7PvvyGl1LcNkxMd17nx+w0m+fy1frFR/MiaPibmwY=; b=cuDy3B7ui9mELZSVO7qc5ZTiDO0NAGjMUOJwo3ZkvEZaDlNQ2QwzIxhud0Z6KGtGOa 5bSnBOpIDPKgs29CJBtwj2Ubval3n513TxHQllkb2CzdOEopLI/ZVBeMkMgH6KV0us2k +2i1AaQ3W6xuaq7FcYdPuBZ/oJYSt/ESJK8K+zO84faPXKZz+alyDtlHELGktqFV55sF jBdnDWhtYY1aiKQgp1SKqPwKAuX/0iWdZAvAMfqsP6AIvnVjI/sAopjS4L7HZTwsrtRo XTv2aseBQvtlcNMQ4z10pPQbOAP3hdPgqunv2kaoZkXhaAWePfNFMBnNJ5RZOSU3E+IW T/uA== X-Gm-Message-State: AOJu0YwRadyUxcGmxoyOL+LHtT/WU4+ZnlYVdrMpY8x2geaOvwa7SkeJ jX3SdZEd90cyS1p+slin7K3bWKfxkIGIs4bqVJjUrUwzSrAAqbn3mSQ+ZxQ5jZQ= X-Google-Smtp-Source: AGHT+IHhuwLDms3+kHmf7lQRra8QD6SWwRucVJx1HwoQqy9Ki3X+RYaXA7BnbBSPI4nNP34ZTh9KeQ== X-Received: by 2002:a05:6a20:db0c:b0:1d3:293d:4c5a with SMTP id adf61e73a8af0-1d8bcf3e6e8mr24587508637.22.1729090696913; Wed, 16 Oct 2024 07:58:16 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea9c6d56aesm3336573a12.49.2024.10.16.07.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 07:58:16 -0700 (PDT) Date: Wed, 16 Oct 2024 07:53:41 -0700 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: , , Morten =?UTF-8?B?QnLDuHJ1cA==?= , Konstantin Ananyev , David Marchand , Jerin Jacob , Luka Jankovic , Konstantin Ananyev , Chengwen Feng Subject: Re: [PATCH v14 1/7] eal: add static per-lcore memory allocation facility Message-ID: <20241016075341.587e8a95@hermes.local> In-Reply-To: <20241016131916.827788-2-mattias.ronnblom@ericsson.com> References: <20241015093344.824073-2-mattias.ronnblom@ericsson.com> <20241016131916.827788-1-mattias.ronnblom@ericsson.com> <20241016131916.827788-2-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Wed, 16 Oct 2024 15:19:10 +0200 Mattias R=C3=B6nnblom wrote: > + > +/** > + * Allocate space in the per-lcore id buffers for an lcore variable. > + * > + * The pointer returned is only an opaque identifier of the variable. To > + * get an actual pointer to a particular instance of the variable use > + * @ref RTE_LCORE_VAR or @ref RTE_LCORE_VAR_LCORE. > + * > + * The lcore variable values' memory is set to zero. > + * > + * The allocation is always successful, barring a fatal exhaustion of > + * the per-lcore id buffer space. > + * > + * rte_lcore_var_alloc() is not multi-thread safe. > + * > + * The allocated memory cannot be freed. > + * > + * @param size > + * The size (in bytes) of the variable's per-lcore id value. Must be >= 0. > + * @param align > + * If 0, the values will be suitably aligned for any kind of type > + * (i.e., alignof(max_align_t)). Otherwise, the values will be aligned > + * on a multiple of *align*, which must be a power of 2 and equal or > + * less than @c RTE_CACHE_LINE_SIZE. > + * @return > + * The variable's handle, stored in a void pointer value. The value > + * is always non-NULL. > + */ > +__rte_experimental > +void * > +rte_lcore_var_alloc(size_t size, size_t align) > + __rte_alloc_size(2); This is not right, the index is which arg holds the size etc. should be: __rte_alloc_size(1) __rte_alloc_align(2) __rte_malloc;