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 D230643D7A; Fri, 29 Mar 2024 10:32:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F3A44014F; Fri, 29 Mar 2024 10:32:49 +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 8179D40042 for ; Fri, 29 Mar 2024 10:32:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711704767; 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=5Jv/lwma9p6PJUc+n4WBwr/owWZpbbBzUcopt8cGeSk=; b=Hu5M/V5Rq2E0cILGmsZn06Oul2zbaFsC/0M5GhNm4zf3yAqkyWlkrSywiu5Ke6TnMm+P4b F3ckF7jPMmk04O8CeoxzAOMYtIBxh34mqyuAM8IZdEgZlh7sPg64c2Ooy+rTgPVBIPOqzB QIUsyDm1Cb4uYhjxTktd/dYF1zK0xwc= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-nh0p7521ObiFW4g94Jx3Og-1; Fri, 29 Mar 2024 05:32:45 -0400 X-MC-Unique: nh0p7521ObiFW4g94Jx3Og-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4148b78d733so8707305e9.3 for ; Fri, 29 Mar 2024 02:32:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711704764; x=1712309564; h=in-reply-to:references:user-agent:subject:to:from:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=BfxmhrEP/R2sFlcYImW3NkBWKQz8D2uNB4znDJWZWGU=; b=p0dbSSkN1c9ngKuG/qorzZafhhSPYb+W58Ro6j3xfIUcGzdTjWD9sCPzpvv2OpB9aU rb0ohsesb3k+dnqpKqZ4UVyr5WFfbH9HdjY8MRUg6EnwV1CVG/9U9A9zQyrn2O0SQIHa gBE+MPdnF9oi94cUNTaeOM7YCuT1xevWwxJNGfgRgA+hCbwMuCTJ42Bic5EQKfhmJ6LB mTWANy79+yHkQdyPRbLQv815koLfl7EKT+2MBvVt6hXcR5qGejRGwlWATALWqU/LW6fr rnyz7/hG8RlrRVUJPjmoT0b+ug6fqXyPo5pGddILOkCyWknCeJMrZ+1jJwYeMlmEB/Co Hb1g== X-Forwarded-Encrypted: i=1; AJvYcCVJIY1MnEtyjh13s4ZDwAkBp1MeUyxy+7Sh57aVsMOUPJ69NFti0OfnUmXBQ8I4xS/0SPitkArykq9sbVQ= X-Gm-Message-State: AOJu0YwZrdybuqF72+SUkKyTl7f/hv+eJaAnSv3TTg/1WmOm6ynktDw3 1J8EChzg5Sz8PqK/jwR/yGSYz3DoNIbYCZiJVlLlmQMc6KIkBJX55mc7C/XwJRttjQH0oFDIJmR TXcnMEHc6CNSBdlk6KVGgpiQwuX02lA1dGVmJ9Ipi X-Received: by 2002:a05:600c:4589:b0:413:fea7:bd19 with SMTP id r9-20020a05600c458900b00413fea7bd19mr1204541wmo.15.1711704764381; Fri, 29 Mar 2024 02:32:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG81gRS+2FbMCU9j7Atr/FI95SCATFzDJwoBR0C51Jr/s9th06ZsHEuhprhSE60YUHKrLxMcg== X-Received: by 2002:a05:600c:4589:b0:413:fea7:bd19 with SMTP id r9-20020a05600c458900b00413fea7bd19mr1204525wmo.15.1711704764042; Fri, 29 Mar 2024 02:32:44 -0700 (PDT) Received: from localhost (2a01cb000f8b9700598da2e1679e8383.ipv6.abo.wanadoo.fr. [2a01:cb00:f8b:9700:598d:a2e1:679e:8383]) by smtp.gmail.com with ESMTPSA id n17-20020a05600c501100b0041550a2ac10sm916403wmr.6.2024.03.29.02.32.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Mar 2024 02:32:43 -0700 (PDT) Mime-Version: 1.0 Date: Fri, 29 Mar 2024 10:32:43 +0100 Message-Id: From: "Robin Jarry" To: "Kiran Kumar Kokkilagadda" , "dev@dpdk.org" , "Jerin Jacob" , "Nithin Kumar Dabilpuram" , "Zhirun Yan" Subject: Re: [EXTERNAL] [PATCH] graph: avoid accessing graph list when getting stats User-Agent: aerc/0.17.0-87-gf035bc4dbe48 References: <20240325155303.770468-2-rjarry@redhat.com> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed 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 Kiran Kumar Kokkilagadda, Mar 29, 2024 at 08:44: > > +167,16 @@ stats_mem_init(struct cluster *cluster, > >=20 > > =09/* Fix up callback */ > > =09fn =3D prm->fn; > > -=09if (fn =3D=3D NULL) > > -=09=09fn =3D graph_cluster_stats_cb; > > +=09if (fn =3D=3D NULL) { > > +=09=09for (int i =3D 0; i < cluster->nb_graphs; i++) { > > +=09=09=09const struct rte_graph *graph =3D cluster->graphs[i]- graph; > > +=09=09=09if (graph->model =3D=3D RTE_GRAPH_MODEL_MCORE_DISPATCH) > > +=09=09=09=09fn =3D graph_cluster_stats_cb_dispatch; > > +=09=09=09else > > +=09=09=09=09fn =3D graph_cluster_stats_cb_rtc; > > +=09=09=09break; > > +=09=09} > > +=09} > >=20 > > Do we need loop here? Just take cluster->graphs[0] and remove break? I wasn't sure if the cluster could be empty at this point. If it is=20 guaranteed to contain at least one graph, I'll send a v2 without this=20 loop. Thanks!