Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2198165lqo; Mon, 13 May 2024 10:30:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/PIiIZo5rSkp1YIuy7+l/zM7F4R7UUBddMPrkDDXRduq7UJx4J+28nt4tRJCr1v7GMUK0bb0nk2Zapo7vCXokSr9Z/Mh0ZiIGpBiHvQ== X-Google-Smtp-Source: AGHT+IHmq4AJNDGbdqbSXfhfngHIXrvJQodvUkv1s0ITyu7eLxOFk/6uPAO1QAbMfHAEpZMeK6ab X-Received: by 2002:a05:6a00:3cc7:b0:6f3:e6e0:d9fb with SMTP id d2e1a72fcca58-6f4e02c6a0emr11783474b3a.11.1715621431339; Mon, 13 May 2024 10:30:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715621431; cv=pass; d=google.com; s=arc-20160816; b=thSYooaKkgRr3kuX5l/wJO+u3xCHpNUGFOAbT5EFNhMlPD8YjJrhaba/8ChitTabYd ++jZ1XT+oiawvcBN9/Zi4r8+xupxSsH5QpWGCKaz0sdSOLCNIv6Psx9cnYyMNErWMFOO Hpq/NY9G+6uPtmAS0lb/pfI1uYh/5c4m1JIN9cebovLTyAbpYTBWSATxf/Sm9Lu0MEGs TlmGQku1AMordsXSvTSuRRsH7G5AqekSz5LMub9A1LIwMCmk5QegiBoN3nMeOMIJt6WE CFO3ituB6J0MEkYZK+jEs2Z+qQ50nPprO3STbY5QY+EQ77YMlnZNzbm/LFirIfZOjiIz YUSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=prTLobfW9EKFUcdfFKM6P4Zgx11iA1pn2v87YJC+EGA=; fh=7D277dvSYbSMIMnwgfRc7huvydmITLCRdKfl6wh4SaA=; b=dxbUWPAnQjCiNLEuNH3qjkI2nk+Ciscp9CFTlEIY2s/WsghPzgh63OE9RMuRP0Vcw4 PQWEIs4lwzUZp2acXIF5GgQFor5cZ0vga90KbxyVe1laAGd3R9b6U1oY/JVyx97jlC16 MzMGcFokXbF2hweEnuxrNihSaq1k7OIqX07il8wPuzPgYmupvsqs+GJdmOTN7TJwyw+M YP7/kwSTJkZtiyAMHRDCN2J6DFx42jsd45hDeooSTbEiNmMHm05ueIh33XdrQFJ+3BOT tNiQgiyr75P1/6en6D61azmZefNoA5OiE28POkBLNa/VLSGa4Rc3uAzFaedtDU7HF/iq Cq9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=krpBOLQM; arc=pass (i=1 spf=pass spfdomain=fastly.com dkim=pass dkdomain=fastly.com dmarc=pass fromdomain=fastly.com); spf=pass (google.com: domain of linux-kernel+bounces-177902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-634119042e3si9156810a12.590.2024.05.13.10.30.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 10:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=krpBOLQM; arc=pass (i=1 spf=pass spfdomain=fastly.com dkim=pass dkdomain=fastly.com dmarc=pass fromdomain=fastly.com); spf=pass (google.com: domain of linux-kernel+bounces-177902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 31FC3B20A02 for ; Mon, 13 May 2024 17:29:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB1732B9DE; Mon, 13 May 2024 17:29:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="krpBOLQM" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7552721342 for ; Mon, 13 May 2024 17:29:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621359; cv=none; b=PZSPdOehXXvdvoWmwIy8jVsp2DkTh9zW0DIo2YqnYbMz4NUk5oWuqbCPzyyBaSKqWAd17zqhoRbi2qefxlw3vd5KN3GMz9uivjjqYkKVJ4NFi5lKEed66QH9GW1rTarulGxx2yGjwjzWYLhroyaHZ1eRhXOrS64Fy1gYpnB23VA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621359; c=relaxed/simple; bh=WG61YN2Nk7u7U7P0fO8v+PMiI3q/l4RfJSzMoJVrZSs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=o3tPVagf7io3Z6Bt8u1h3gRLTi1Nsf4IQXsKXBM10ZoQ031HI9eP2AvjZ/bCxWEAKPgj/HdMle6zeCTG33TmHeukACQGKY0/PTdWx8LUDwDMonH7iDBK6OEO76j1DNTGc8TMfCJje67P7UhvBP090HGLAO9zGDAAyBpIsL0IgAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=krpBOLQM; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1ee42b97b32so37054265ad.2 for ; Mon, 13 May 2024 10:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1715621357; x=1716226157; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=prTLobfW9EKFUcdfFKM6P4Zgx11iA1pn2v87YJC+EGA=; b=krpBOLQMp5px5k53sqHorpJOHLfWSh6/oD7If8Tu30EBtb4KUFYs02xap1vgsry/dZ yWy9nBqzTE9uTf298ET05OKpS7OzAfPI4ndC8KxfihllDzOCs740GK2fzWean1fQpsHs 1JDsPYljok6wfS2EMgOO02ZvW0Q5LFKb9WIqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715621357; x=1716226157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=prTLobfW9EKFUcdfFKM6P4Zgx11iA1pn2v87YJC+EGA=; b=GcsXGS3iE5VEqRhxnznJXhSzs30MTJ6JojlRsH8P3zDMogB6RK5ZqNfsGCN/LSutbV NpRWsbeXl74vIrBjLNDqfGkALimvfA+TTeg3pwgWgdNbK2REot3cmWZDezLxfXPjvD8w TcODOT4SURoTEyA7Pu6paguDzciBacom7uPAOYFhPOzPa2anLOhiMOB+Yg1crEYSwmCd tzHEDAMkG9Jj9qlM0kvQKQY910VK3BdrkEDb/3nvc80IGJYb2rXgfWa6Hxks1OknzTuc yYhAR6abJpIwjsCF2GEI/G2ty28zHrGE7kSAm9tW785je5oqQyk7pHHLMjRsosvnI54a h4mQ== X-Gm-Message-State: AOJu0YzILnIBs4ziT476JB/YzdnekOVc2ZGs+j/I0jTAVzl4Pyk/JbYa 4Rq6Ahs1zbEh3nshtGqlkX1QxWQcM0ix0/0gHWgOnr9IfbvsUX1ZLkp4KPuEOOfb3ebgc+ykxc7 r1Tl6vg0apSHY14b54mEmyo52AsAIObg9tPbqG39oTAIz/5olYVDQASCWBMrHZ1kyZl2zY53Tq9 L8P6a9LPNhJ6ZBUcpyWMNtPIUog7QhoDleeG1Yin8290c= X-Received: by 2002:a17:902:eb8b:b0:1e5:5ccd:30e1 with SMTP id d9443c01a7336-1ef4404b81dmr120238405ad.65.1715621357397; Mon, 13 May 2024 10:29:17 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0b9d1663sm81948995ad.6.2024.05.13.10.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 10:29:17 -0700 (PDT) From: Joe Damato To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: mkarsten@uwaterloo.ca, nalramli@fastly.com, Joe Damato , Tariq Toukan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-rdma@vger.kernel.org (open list:MELLANOX MLX4 core VPI driver) Subject: [PATCH net-next v5 1/3] net/mlx4: Track RX allocation failures in a stat Date: Mon, 13 May 2024 17:29:06 +0000 Message-Id: <20240513172909.473066-2-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240513172909.473066-1-jdamato@fastly.com> References: <20240513172909.473066-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit mlx4_en_alloc_frags currently returns -ENOMEM when mlx4_alloc_page fails but does not increment a stat field when this occurs. A new field called alloc_fail has been added to struct mlx4_en_rx_ring which is now incremented in mlx4_en_rx_ring when -ENOMEM occurs. Signed-off-by: Joe Damato Tested-by: Martin Karsten --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 1 + drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 +++- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 4c089cfa027a..4d2f8c458346 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -2073,6 +2073,7 @@ static void mlx4_en_clear_stats(struct net_device *dev) priv->rx_ring[i]->csum_ok = 0; priv->rx_ring[i]->csum_none = 0; priv->rx_ring[i]->csum_complete = 0; + priv->rx_ring[i]->alloc_fail = 0; } } diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 8328df8645d5..15c57e9517e9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c @@ -82,8 +82,10 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv, for (i = 0; i < priv->num_frags; i++, frags++) { if (!frags->page) { - if (mlx4_alloc_page(priv, frags, gfp)) + if (mlx4_alloc_page(priv, frags, gfp)) { + ring->alloc_fail++; return -ENOMEM; + } ring->rx_alloc_pages++; } rx_desc->data[i].addr = cpu_to_be64(frags->dma + diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index efe3f97b874f..cd70df22724b 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h @@ -355,6 +355,7 @@ struct mlx4_en_rx_ring { unsigned long xdp_tx; unsigned long xdp_tx_full; unsigned long dropped; + unsigned long alloc_fail; int hwtstamp_rx_filter; cpumask_var_t affinity_mask; struct xdp_rxq_info xdp_rxq; -- 2.25.1