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 9C375A00C3; Wed, 7 Dec 2022 22:03:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8CB25410D2; Wed, 7 Dec 2022 22:03:45 +0100 (CET) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mails.dpdk.org (Postfix) with ESMTP id 72BD640146 for ; Wed, 7 Dec 2022 22:03:44 +0100 (CET) Received: by mail-pg1-f181.google.com with SMTP id v3so17475024pgh.4 for ; Wed, 07 Dec 2022 13:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; 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=4Q2oBieqF8dTNVXfdn1ZV2nbqAPGrfoouoCM3DOLSeE=; b=eZ45fLWrYwjXeVVwJcXkal+2rMfRQtt15/px/rS7AWJS4OSygMw28/1sOMyHQ/5KJJ +lSOABENgcmHgeCn/XoV/hMlWtBbyyPGIgJPbK4XMjEBUnsYUinC/jvru/bJonaZQ12O TN15sc2pebWdykwp755sVEHMaNErPzWQOk9ESjWi/E9MasFbFgJXknDSrYM2vBELQc/V 2YFDLyjUsCdZzicGf6n7aR/zAHIT2LFQPzIzTm2ocDLDQfeR0T7EetUzcO2BZq5SS70Q EMQUEpsf09FyNZvE6kxsS45k2OAi0EktZFGfyANwZmEBiNUaH64uXZzVj6uckUd63jUn Ug+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4Q2oBieqF8dTNVXfdn1ZV2nbqAPGrfoouoCM3DOLSeE=; b=NjkM8/lmldyHBgL74edAj0QeNGaCl4CplFSUWAsRT0F1ah/yn6J6OG3ln2+fWYmWry Z6Uda2/PiFC7U2v3ikW8kK6pJpog6Hxp9xUZueHszkLQkVOSp/Mbu4iWpFZlCPX1PEOi ANpFErdO9nUWOUcQBnwfnlS3z5d3KFkOVv2C3s/5Hz1iybUBLRIs4ZZfzKt197DttzaV SF7jqKEdQ9nxe/EgMl4Liwdku2otE09LkLBMF+Dgnef2ZtpDMBnHdevCioP8WQy1U2Gs mKjrhntqDeCUYurQ5aWIB5EFY0CAF1t9kSZwltMRLxkKQeDIZUC5OuYcF1iAxeFVzDp6 Hr5g== X-Gm-Message-State: ANoB5pnuDGHj1tyDZrJGZezmYoXHZlSZHMAB6fD47iQ5yWqCFGs55Bjo 1XezkfVSpYITOMIWYN8Ic+R/PQTS6+QLcKYB8cc= X-Google-Smtp-Source: AA0mqf6VWE7QC9TMG9aOXa4aDZ+YSjHpEjgQp/NhxrAGPMBJa++f0GiDNsjMzZL572gESSWbe5YkKg== X-Received: by 2002:a63:4e64:0:b0:477:a782:31be with SMTP id o36-20020a634e64000000b00477a78231bemr65089094pgl.38.1670447023602; Wed, 07 Dec 2022 13:03:43 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a1-20020a1709027e4100b00189f143da27sm2658148pln.288.2022.12.07.13.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 13:03:43 -0800 (PST) Date: Wed, 7 Dec 2022 13:03:41 -0800 From: Stephen Hemminger To: Tyler Retzlaff Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, olivier.matz@6wind.com Subject: Re: [PATCH 1/5] eal: add lcore set name and get name API Message-ID: <20221207130341.30d6f22f@hermes.local> In-Reply-To: <1670439617-9054-2-git-send-email-roretzla@linux.microsoft.com> References: <1670439617-9054-1-git-send-email-roretzla@linux.microsoft.com> <1670439617-9054-2-git-send-email-roretzla@linux.microsoft.com> 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 Wed, 7 Dec 2022 11:00:13 -0800 Tyler Retzlaff wrote: > +static char lcore_names[RTE_MAX_LCORE][RTE_LCORE_NAME_MAX_LEN]; This copy would redundant on Linux. > + > +int > +rte_lcore_set_name(unsigned int lcore_id, const char *name) > +{ > + if (unlikely(lcore_id >= RTE_MAX_LCORE)) > + return -EINVAL; > + > + if (strlen(name) >= RTE_LCORE_NAME_MAX_LEN) > + return -ERANGE; > + > + (void)strcpy(&lcore_names[lcore_id][0], name); Why the void cast? > + > + rte_thread_set_name((rte_thread_t){lcore_config[lcore_id].thread_id}, name); > + > + return 0; > +} > + > +int > +rte_lcore_get_name(unsigned int lcore_id, char *name, size_t len) > +{ > + if (unlikely(lcore_id >= RTE_MAX_LCORE)) > + return -EINVAL; > + > + if (len < RTE_LCORE_NAME_MAX_LEN) > + return -EINVAL; > + > + (void)strcpy(name, &lcore_names[lcore_id][0]); > + > + return 0; > +} > +