From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9E9DC6379F for ; Wed, 8 Feb 2023 17:04:21 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A14B54014F; Wed, 8 Feb 2023 18:04:20 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id D250B40141 for ; Wed, 8 Feb 2023 18:04:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675875857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=26RdIBLCbjZ9RV17OxwaMuuTJE8RzlTIei2vR13MaEc=; b=etfrz+Gu/e4d8mt9Em7avy78m4pTeO5Mi7FSfE3Sc8qbRlLxlB8aGDzXE9Hq/PqrhRFKPB zwW2SgMBIIzkwCEhm53zKR35AOcLHjf7bAXnURlJEDWNVolPuP1oImCsWIHPCgIMBF0q9a eGSTTSQW545wsUDmOmn/mmSFa12DFGY= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-124-PpVRQFECPK-DLsxAwtSNyQ-1; Wed, 08 Feb 2023 12:04:10 -0500 X-MC-Unique: PpVRQFECPK-DLsxAwtSNyQ-1 Received: by mail-wr1-f71.google.com with SMTP id w10-20020a5d544a000000b002c3de7a10b0so2186831wrv.5 for ; Wed, 08 Feb 2023 09:04:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:from:subject:to:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=WQeedNh+TLHpdtDdarew5EkF6J2llqSI/5/sd7DmEHM=; b=sClzE+ua4/g/rltuq9bDjbgwgEn8MdtwgQc3N4fKGat7wlf9C6KDePsTgh488bTlMW mOO0T+uPUi9rrY8Xn5VVtcH3D/uHujQDl3UuFzTeZQ2ihdQ1UdzJX69lVNu1zjoVDfF4 Y2TxConEZHnSYDWxSG9uNXv8RpotSWGDvX9GZ4HqVd8t3f3ozDFdh8UcWSEey8PvVUC8 23zpd9rxi2Xwe/PL1N6qVzGRGpSrvxSvfp+BrLqSR8qNrLNW4BLYWktjw7dvPzY429Bs M58N23LUdQ+nCxNAaLITxZFymLPsZ5m3augu45gwev8QxZyaVT02gmW8IYpOJsTFcsWS ureQ== X-Gm-Message-State: AO0yUKWWnLFihxWA0B0gxxO3+6RaRGuHL6JobCrc21CgSiIaqZJ3PA0L cHwWyRof3IjyVMKMJcABpg2hjHQKH7fwZYlZL69ff+gIX4Y5zPyu7240/WA7iAUo+6L9OeN6Q/T N/FtX8OJL X-Received: by 2002:a5d:610c:0:b0:2bf:ecee:acc6 with SMTP id v12-20020a5d610c000000b002bfeceeacc6mr7360599wrt.61.1675875842534; Wed, 08 Feb 2023 09:04:02 -0800 (PST) X-Google-Smtp-Source: AK7set8ok+Bo/8Nc8kki8XUuTCxCRAQS8X9yK1Yj3QmRrnbG4r0duppFIel5YyJvdq9M+fUD6/0tGA== X-Received: by 2002:a5d:610c:0:b0:2bf:ecee:acc6 with SMTP id v12-20020a5d610c000000b002bfeceeacc6mr7360576wrt.61.1675875842310; Wed, 08 Feb 2023 09:04:02 -0800 (PST) Received: from localhost (2a01cb000f483e0055ae3800781b5cbc.ipv6.abo.wanadoo.fr. [2a01:cb00:f48:3e00:55ae:3800:781b:5cbc]) by smtp.gmail.com with ESMTPSA id j6-20020adfb306000000b002c3d29d83d2sm13723081wrd.63.2023.02.08.09.04.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Feb 2023 09:04:01 -0800 (PST) Mime-Version: 1.0 Date: Wed, 08 Feb 2023 18:04:01 +0100 Message-Id: To: "lihuisong (C)" , Subject: Re: [PATCH v9 1/5] eal: add lcore info in telemetry From: "Robin Jarry" X-Mailer: aerc/0.14.0-61-g75bd42ba0288 References: <20221123102612.1688865-1-rjarry@redhat.com> <20230207193731.1242505-2-rjarry@redhat.com> <3cd7617f-dbb5-9626-2db1-e6a8ce5f6376@huawei.com> In-Reply-To: <3cd7617f-dbb5-9626-2db1-e6a8ce5f6376@huawei.com> X-Mimecast-Spam-Score: 1 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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 Hi lihuisong, lihuisong (C), Feb 08, 2023 at 03:24: > > static int > > lcore_dump_cb(unsigned int lcore_id, void *arg) > > { > > =09struct rte_config *cfg =3D rte_eal_get_configuration(); > > =09char cpuset[RTE_CPU_AFFINITY_STR_LEN]; > > -=09const char *role; > > =09FILE *f =3D arg; > > =09int ret; > > =20 > > -=09switch (cfg->lcore_role[lcore_id]) { > > -=09case ROLE_RTE: > > -=09=09role =3D "RTE"; > > -=09=09break; > > -=09case ROLE_SERVICE: > > -=09=09role =3D "SERVICE"; > > -=09=09break; > > -=09case ROLE_NON_EAL: > > -=09=09role =3D "NON_EAL"; > > -=09=09break; > > -=09default: > > -=09=09role =3D "UNKNOWN"; > > -=09=09break; > > -=09} > > - > > =09ret =3D eal_thread_dump_affinity(&lcore_config[lcore_id].cpuset, c= puset, > > =09=09sizeof(cpuset)); > > =09fprintf(f, "lcore %u, socket %u, role %s, cpuset %s%s\n", lcore_id= , > > -=09=09rte_lcore_to_socket_id(lcore_id), role, cpuset, > > -=09=09ret =3D=3D 0 ? "" : "..."); > > +=09=09rte_lcore_to_socket_id(lcore_id), > > +=09=09lcore_role_str(cfg->lcore_role[lcore_id]), > > +=09=09cpuset, ret =3D=3D 0 ? "" : "..."); > > =09return 0; > > } > The above modification doesn't seem to be related to this patch. > Suggest remove or delete it from this patch. I was asked in an earlier review to factorize this into an helper to avoid code duplication. > > +=09if (info->lcore_id !=3D lcore_id) > > Suggest: info->lcore_id !=3D lcore_id -> lcore_id !=3D info->lcore_id > Here, info->lcore_id is a target and lcore_id is the variable to be > judged, right? Yeah that looks better. I didn't pay too much attention since this principle is not well respected in the current code base.