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 5CF4E43FDD; Fri, 10 May 2024 17:06:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D37AB402C4; Fri, 10 May 2024 17:06:17 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id B1941402BB for ; Fri, 10 May 2024 17:06:15 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1ec4dc64c6cso14753175ad.0 for ; Fri, 10 May 2024 08:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715353575; x=1715958375; 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=Sh17drZ6d+vdb6/6731xVkHsoDoF2/n1NoOKr9vrVD8=; b=g3ayXnC4Tw7fH5zd6scnVTVBjnaPN79j1mlhEovp891NmN3HFeiQrdzvYWZdxc2Czm pF2vTluyUoq9E0dVPCqQ6iGZYZjD9hIJKrXPAiNHWNANLRE0U/hMxEJjSjEoGosW8fhQ eQyVwLfwKzrTdErFxZoW05ndp+b6YpE5rs5ZgIQCV1vruLeJID6zNAAvc6W6UrH+sXd0 xBSbqfit5ooy1jEyaVIhZAkDUOb5oyghOuqwNZt8M8U1mh3fItTXW0NYK4YE6zAMKGnJ KNBLxhLvXBeWuMdZlYWxdR/VbQSRW9xgDsyz1ENwTcdM1zAysFo1OU2YtnOJngWo6MSx /iVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715353575; x=1715958375; 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=Sh17drZ6d+vdb6/6731xVkHsoDoF2/n1NoOKr9vrVD8=; b=sRFyYy5eDRuCljb+TiNqIjSRc8Pm85BGra70GSlD7gyzDiQydAdsM5EW1BHdW7wgR/ KdJ2AYvoCaIyc6TDNOP7RLKQpYf/99/a7TJVFtZZos5p2t/Dn8nphp9hi+wfMicmYRTJ skcGtfDaJKSk9s3KRGrn2doJB+1VIzxzCBkcxfw25BYpPTUSis/5Nr1xMDojsAusKlbP 8QlhBdvE9PBnZeWvjVyGkcwO1dxOeBwUvNJLzN1WnuU+720JLdG150LuqcObX9+vq8GB f96LgEN7EQqOQcbIruFzB49SmEWcUQ4Q8cXB5k/UqmT/Z4iVakn3IuC7k81TgCkq90+U hYRQ== X-Gm-Message-State: AOJu0YxdW2RJLBNgtiNXj0QtQ6uyS7zfC9B1JGPb0UVkABmbvESMS6IH Rt24/VyeomQovzrQ6b6Y0b9pXdL3QZAUQbwqTVF63uZbQaqEDdzuObCWQ+Rk+0c= X-Google-Smtp-Source: AGHT+IHcclGKKDsnGAsomkxXwFkOQLJQo3dTq8XhrR0gW2gckPLwevXhh2rcGgdolRuYYtiU1sfw/g== X-Received: by 2002:a17:902:e881:b0:1e3:dfdd:21bd with SMTP id d9443c01a7336-1ef43f51ff5mr27102955ad.55.1715353574690; Fri, 10 May 2024 08:06:14 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c0369f1sm33092065ad.185.2024.05.10.08.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:06:14 -0700 (PDT) Date: Fri, 10 May 2024 08:06:12 -0700 From: Stephen Hemminger To: Ciara Loftus Cc: dev@dpdk.org, stable@dpdk.og Subject: Re: [PATCH 2/3] net/af_xdp: Fix mbuf alloc failed statistic Message-ID: <20240510080612.7b420011@hermes.local> In-Reply-To: <20240510100358.18815-2-ciara.loftus@intel.com> References: <20240510100358.18815-1-ciara.loftus@intel.com> <20240510100358.18815-2-ciara.loftus@intel.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 Fri, 10 May 2024 10:03:57 +0000 Ciara Loftus wrote: > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c > index fee0d5d5f3..968bbf6d45 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -124,6 +124,7 @@ struct rx_stats { > uint64_t rx_pkts; > uint64_t rx_bytes; > uint64_t rx_dropped; > + uint64_t alloc_failed; > }; You don't have to use local statistic for this, there already is one in the dev struct i.e dev->data->rx_mbuf_alloc_failed. The problem is you need the DPDK port number to find what dev is. And the code in ethdev for stats get will put it in the right place. PS: what is the point of rxq->stats.rx_dropped? It is never incremented. PPS: Looks like AF_XDP considers kernel full as an error (ie tx_dropped gets counted as error). This is not what real hardware does.