Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp96851lqo; Thu, 9 May 2024 13:51:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwMY6EgCLnMehEIsk0XaX5gMQd1LVhvbEEjbkNRhCyIHG6XSF+JnzPRckp9nyHoLRgox195yyFhz/vAIxO6TpHBcbmjKIJML/s72Re4g== X-Google-Smtp-Source: AGHT+IGyInxScCJcL4/I8j4bXKQerhhKBGIMFVnQUku+8fh3tiMUwjzR+7teiseHWzmGUzPVff+Z X-Received: by 2002:a17:90a:f2d2:b0:2b1:50:cf05 with SMTP id 98e67ed59e1d1-2b6cc76d384mr653089a91.27.1715287896054; Thu, 09 May 2024 13:51:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715287896; cv=pass; d=google.com; s=arc-20160816; b=bl+y8nXcYaf+WMm7+qgdlciSteus8tEeGFMhZ3YvMtkQfA0d6xTgwtb1Ew0zLoZmKj bBZ0HNBGlQ6N+Rdpt8v5OOxXsBa/lJo6+YVT3twCJ8lojHlpIBEdZPHsTb/iY+WZwLn1 jmgZpY4JQT70E3Bto8Pl20l9q1FtCo/azKis6KJia3Qze4X6vro0XxECULtrQQ0pfIrw R3wQlhnLBmpS72gVvZ9ShD/fUOxRJpUwmAT0i/2ll7fV4ggC1uQOKHo0wk5sPj3z9nXD UmYyBUNgjxfbe/r1HV19igbq+AoMpfSQJBWkQyXsbmWgar4hCDypR7S9oMmslMYLBR7+ 2Xng== 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=mK9jRCqJy/IAjt4V55hSSH/H3KvUaHNlqx/4tUOcg/w=; fh=7D277dvSYbSMIMnwgfRc7huvydmITLCRdKfl6wh4SaA=; b=sKqQBs1iAV6575dYLLN6EpmxVIPl1Vz1bD7KpcqUJiRQ5OI7qUMV4Oy1LAXCF3Nh1Q yAJ8saBtZuiVCRgAvdoIVqbZDklPNNLYMQ1g5YNE0uWz5JSNad8633zLzlqQg0BrRViA VgSgemeonQEaTk5ZLRVXBWEfzx/bcDLroOvMZ+F2ifLLVsll55aZ4hgTX1K34UkzsG2J lNcxfw9+NCOPOBMmfcOx9MBVC2hh83+rXUlIR9jGh7e/UexVeqqZPk0lN9W5BEVA+eK3 EgbGlwGvhSJSoyU6Yyeod0LVDoVgHWlvPKY3hNDC57/ZcxopbB2Q3ZsT4xHLgX81gipm 0ZuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b="Ed67/4tf"; 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-174954-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174954-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b670e355cbsi166921a91.27.2024.05.09.13.51.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 13:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174954-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b="Ed67/4tf"; 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-174954-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174954-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8591C2815D3 for ; Thu, 9 May 2024 20:51:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E9EF83A0E; Thu, 9 May 2024 20:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="Ed67/4tf" Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 D946A83A0D for ; Thu, 9 May 2024 20:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715287869; cv=none; b=k+3Qe+mLbXOnSVdTfVKdEbf0b5x4qx+CHAis8GFMcISvb/YSS1DIPr1a/2X7UkKtqFtdF5gZ2Y6OA9B+iJMqC5/PiqOjP2/rTcxEAdc4QxBVtT1miMHx/3AZTm5P1zhBULAlmd4686ojMwNtg/kvueKgDIry7w3imxvGQ4i8hB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715287869; c=relaxed/simple; bh=AO4ibM0f40u0LST8xsBvynBO/brqWCLwYZxK5Wpm0nw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZUuOYOeu84n6w25aPwITm6NRQf/atFR2hgqLlTWe2iDDpHk2GSWA2ltJWa7AFnze5rdxxz3bTmQzCViBL6sJV7W3Lc3ujMbWkPcBpU+BZF9Ufi5DpT7wdEVJAwhSajKvifr7Nkox0H9hSWyrsdtnfp+ipLvCAXa4kf3LvIBLuNE= 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=Ed67/4tf; arc=none smtp.client-ip=209.85.215.170 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-pg1-f170.google.com with SMTP id 41be03b00d2f7-620e30d8f37so1109982a12.2 for ; Thu, 09 May 2024 13:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1715287866; x=1715892666; 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=mK9jRCqJy/IAjt4V55hSSH/H3KvUaHNlqx/4tUOcg/w=; b=Ed67/4tfRKob+rHwqlGfFIl6bqdWmz9So+IxPDc4LHg5gndY/4YzTkAYeIdM4Tp9Yk OrrehrbByqoUzvelU3q/x5TzL98DIlmdYARhEYkZnbXNhud9tvOvxMhnphWq5Taxcb7P tzRfNG/9JxVKihzIGfjBgX1vUmbScnaNzEhuE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715287866; x=1715892666; 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=mK9jRCqJy/IAjt4V55hSSH/H3KvUaHNlqx/4tUOcg/w=; b=lq7HeTE8udkjCQceHYr6Z1GVX01RqGJn9RFOvEzJqafPvr4lp+oztu2bUf4jHe2q7o nYchSsi6ryQG7MVD8sm79lx7czhV9vhjUv9Z6fv1PWhr0h3Pqs83fr+9nH43LGZRpYBe 4Ul1cbl2h/ga8ZPkV5HYCveQfdl1S3+plLvI4eC3IJ8q8NjG753y4WHWsICLkxjZW0kJ 7qnY1DewCXTD74z/lpD1ohPFLtGBnSzZSfWB47QP2cfDveGpEqQF1ezPcCCHxNdaylV2 Nfp2Mj0kfjhdeJHxExZ46k27SbEUbZQhcBcHZi0e76x8H4BLgKTK/bx6ZrFBURRBB1j6 Nsrw== X-Gm-Message-State: AOJu0YzuFuafgpp4RYProWAYZ2hk4SyqsCWsY34VzkeF2aVR78On38fO pOvWsiIHvppquWqbpfyffR5aju6JOm+MBVGhP54cQ1xhm03ENZYoD/8/UfJS0o6+sAL+Yg3cO3U zDPXtKlfWSPzFhzn4XRLO9PHDLNBvtD6DzKjRATx5j5TYkvEpbdVO26NbR0+VEZu70v6hgzbsYg CKOxzQYiFsUa03DbTwbNlyBV4cmYXBJcriUccBJuOoQio= X-Received: by 2002:a05:6a21:99aa:b0:1af:7180:494f with SMTP id adf61e73a8af0-1afde1b6f3dmr1283476637.41.1715287865782; Thu, 09 May 2024 13:51:05 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0badb959sm18677365ad.85.2024.05.09.13.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 13:51:05 -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 v4 1/3] net/mlx4: Track RX allocation failures in a stat Date: Thu, 9 May 2024 20:50:54 +0000 Message-Id: <20240509205057.246191-2-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240509205057.246191-1-jdamato@fastly.com> References: <20240509205057.246191-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_rx.c | 4 +++- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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