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 0636E43FB3; Fri, 10 May 2024 14:35:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C49DE402C4; Fri, 10 May 2024 14:35:28 +0200 (CEST) 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 7625C402BB for ; Fri, 10 May 2024 14:35:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715344527; 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=pOSI7VnGc7ehBih+UIO4VM0D/gZfYayxbYJ0NItSVrM=; b=ZhyiTlMNKxFqRZ5BwSOm0WoWdhPgAOsppnS7UiU5+77zd/U/sMOhO+z646QxVuiF/+9q6l jzx989ss1qUrOmnIkWAG0koEm5XvzY6IYExXvjVfJOb7VQr5i0vlzPrPivB70NBLFGbBew qA8HUoMB1trlPPW5ftao6mDIYoL2h5E= 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_256_GCM_SHA384) id us-mta-500-4hFzvW9vMDGV4BAONztZFA-1; Fri, 10 May 2024 08:35:15 -0400 X-MC-Unique: 4hFzvW9vMDGV4BAONztZFA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-34fcf649d5dso1184399f8f.1 for ; Fri, 10 May 2024 05:35:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715344514; x=1715949314; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pOSI7VnGc7ehBih+UIO4VM0D/gZfYayxbYJ0NItSVrM=; b=OPpgNS3MTlTi9FM0UMYvPMCdWtha+v8jNstGE1sZOb/JZ0r1WgzE5JvEC+Wyto3sVD 4h2fDcha/tqd5+6hH/iwQRuxCQ071KcJMvqTS2LEzfezpvu92KbctLOBlRBBHKkfZYlE nZO2pAhjgNJ6UcKhrLQ4RZqTlvk/GoP2zQHQ9qRICh/p6Zb7D8PNH5pzEH0uHCmqrEEi +eu9ZafnbPPH0fc9NTeUkHz8AtKdSIikUJ51gdtmm0IwiPPFZ+9ZkHMVOOVcrlIiQDIm KN4PDoVUhwnSPIcfLZOunRF9bwUlds6JFTJ3zxkdZyDchzhjhwHloGQ2KpurLXvf91sW ANPg== X-Gm-Message-State: AOJu0YyI9XL5fv1gh7+EtTVxGLeBn9Ik2TlX1YxQyZBKLtHQXr3F/E/Q 2BhcfEi6Sqiduq9UG5FfQaL0W46ANBZY6dX9Gmq0knPi1dDIFhsBz+LbhAnLCacqL7/Be6waNpg eI9vzCezfb7nF/oK8pJz4Th3GWIWfgDHjt+DtNLryyr8Gv37Wniaed+GKPD+POPkcaRpB1c9ALV hqQhlcl4S8Mem4mvBvG85RJRI= X-Received: by 2002:adf:e401:0:b0:34d:a508:e1fe with SMTP id ffacd0b85a97d-3504a955412mr1713235f8f.51.1715344513962; Fri, 10 May 2024 05:35:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvClXkPZT73QizzD1ogDFAmDqz/o9y4Z0wtcEipQPTR3KM0Qm9qrQL4vNqpsjeGPAksAVy/A== X-Received: by 2002:adf:e401:0:b0:34d:a508:e1fe with SMTP id ffacd0b85a97d-3504a955412mr1713218f8f.51.1715344513433; Fri, 10 May 2024 05:35:13 -0700 (PDT) Received: from [192.168.0.12] ([78.18.17.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502b79bcf9sm4507118f8f.6.2024.05.10.05.35.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 May 2024 05:35:13 -0700 (PDT) Message-ID: <2eb8665d-679a-4a3f-a2e7-3c193c98c470@redhat.com> Date: Fri, 10 May 2024 13:35:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] net/af_xdp: Fix mbuf alloc failed statistic To: dev@dpdk.org References: <20240510100358.18815-1-ciara.loftus@intel.com> <20240510100358.18815-2-ciara.loftus@intel.com> From: Maryam Tahhan In-Reply-To: <20240510100358.18815-2-ciara.loftus@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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 10/05/2024 11:03, Ciara Loftus wrote: > Failures to allocate mbufs in the receive path were not being > accounted for in the ethdev statistics. Fix this. > > Bugzilla ID: 1429 > Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") > cc: stable@dpdk.og > > Reported-by: Stephen Hemminger > Signed-off-by: Ciara Loftus Acked-by: Maryam Tahhan > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +++++ > 1 file changed, 5 insertions(+) > > 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; > }; > > struct pkt_rx_queue { > @@ -339,6 +340,8 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > * xsk_ring_cons__peek > */ > rx->cached_cons -= nb_pkts; > + rxq->stats.alloc_failed += nb_pkts; > + > return 0; > } > > @@ -408,6 +411,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > * xsk_ring_cons__peek > */ > rx->cached_cons -= nb_pkts; > + rxq->stats.alloc_failed += nb_pkts; > return 0; > } > > @@ -872,6 +876,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > stats->ibytes += stats->q_ibytes[i]; > stats->imissed += rxq->stats.rx_dropped; > stats->oerrors += txq->stats.tx_dropped; > + dev->data->rx_mbuf_alloc_failed += rxq->stats.alloc_failed; > fd = process_private->rxq_xsk_fds[i]; > ret = fd >= 0 ? getsockopt(fd, SOL_XDP, XDP_STATISTICS, > &xdp_stats, &optlen) : -1;