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 7108841B90; Tue, 31 Jan 2023 17:41:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F17044067B; Tue, 31 Jan 2023 17:41:45 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id E0F1540041 for ; Tue, 31 Jan 2023 17:41:44 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id v6-20020a17090ad58600b00229eec90a7fso1651054pju.0 for ; Tue, 31 Jan 2023 08:41: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=eAwMr0gRqI7wf1LAKuSS5WSweBm7nEn/m5OIGt7aRWI=; b=pE6JzIpld6HYlMJ3vDMcWa1D8Apyjv+DuEAcXMDrAluSapqrpYUE5IJWH9JDBD0OHj //25WzB0p2GA5XTmtKgRpOSrwylQGIY2NRyADXu46DNpfbrPFSTuxl/zHZKfT9AeheVa iZlVD+hE6awHIYtfyPIF9MEyf9QZExWB9cg5qLRd5RwbCytN+OC0UP1NNVoT+3DIrWkh zLOwmFs0FJlSpnoM6Dkt9iPISSKD8f8ydrEhMeXChVKW2prk5oKDTjl1b+7PPW4yVI+C QeePlGrcSTgRgt3/9LUinERNDb6tQIWcijXxg0ixGe41VFBa6qwTfPSl23ZFvWFbMvrV v85w== 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=eAwMr0gRqI7wf1LAKuSS5WSweBm7nEn/m5OIGt7aRWI=; b=lHQJEJ6bOabEE/vSJFQXdcMFwhHkKfzRbQ6gYFUeoFXlkeqve2xuK9VcqW141Gk6oy WZkRM5pVUf0QSQVgdR8aA5zRIlEd4yl4wuNVXXJU/ql3zLLdDRUow1PVywYRQKugkhwd fNEZGQ123tp5hJbfXVK32M8u/CZFik39PGCNNEksPka9gZPeKq2/5IW8fNQ6s7g0cPKA Wy/yebZ8Fd/4ZIG8UIH/zdNMc1XJiIcIp7FwwBFFBLS3/xOdopVEo/dOudfrOs3a09MM kebD2prIMp873PiYMBktX5ew0K0htNXP4ZoUG233wNMOUlRznsQ1UvN19Cl4Ongw+5aT Z/pA== X-Gm-Message-State: AO0yUKUqIT4zUG9BNgtSaJ9laZarl0lOtQaEXivC1bDa53QZGSvmEsBX q29bca6z0rmJEJJ9sEWoKLE7dQ== X-Google-Smtp-Source: AK7set/GBbvkSg5wjrMO0yHQEy15Oqd0BW//NDe4Dj0SPcw5pRlb5oiujJNd1c9xl5OdR8LP+k/udQ== X-Received: by 2002:a17:90b:1a92:b0:22c:d57:519f with SMTP id ng18-20020a17090b1a9200b0022c0d57519fmr14093335pjb.34.1675183303819; Tue, 31 Jan 2023 08:41:43 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id ie10-20020a17090b400a00b0022c1f78c920sm8691632pjb.35.2023.01.31.08.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 08:41:43 -0800 (PST) Date: Tue, 31 Jan 2023 08:41:41 -0800 From: Stephen Hemminger To: "Robin Jarry" Cc: , Morten =?UTF-8?B?QnLDuHJ1cA==?= , "Kevin Laatz" Subject: Re: [PATCH v7 1/5] eal: add lcore info in telemetry Message-ID: <20230131084141.7dac021c@hermes.local> In-Reply-To: References: <20230126152045.1036904-1-rjarry@redhat.com> <20230126152045.1036904-2-rjarry@redhat.com> <20230126090330.13014fbf@hermes.local> 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 Tue, 31 Jan 2023 10:40:08 +0100 "Robin Jarry" wrote: > Hi Stephen, > > Stephen Hemminger, Jan 26, 2023 at 18:03: > > Alternatively, you could should check for lcore out of range. > > > > Simplified as: > > struct lcore_telemetry_info info = { .d = d }; > > char *endptr; // init not really needed > > > > if (params == NULL) // length check can be handled later > > return -EINVAL; > > > > info.lcore_id = strtoul(params, &endptr, 10); > > > > if (*params == '\0' || *endptr != '\0 || > > info.lcore_id >= RTE_MAX_LCORE) > > return -EINVAL; > > Ok that may be more exhaustive. But even if the lcore_id is out of > range, it will not be matched by the callback. > > Do you think it warrants sending a v8 of the whole series just for this? The reason for the range check is to avoid wraparound. Actually, you need a temp variable there since lcore_id is uint16_t and unsigned long is 64 bits on most platforms.