Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1420039lqm; Thu, 2 May 2024 14:27:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFUzFDwFE134YhOwNpHw1Zn9ppNPJb2GIqFwq9iW+Gy5g8X/Ng0e9q+ANR4LWPemLYJtz8zR2mKB0cvjgN08gY+NzdaU9nN9w3jsFtOQ== X-Google-Smtp-Source: AGHT+IE9Ya4S1DbBhWZZGSX3KStqrDOfWvEy/lKTHtahaMG6DXQnlbtQY1zgDxwineT1TiGKY92N X-Received: by 2002:a2e:a488:0:b0:2e1:a747:532d with SMTP id h8-20020a2ea488000000b002e1a747532dmr701415lji.8.1714685228676; Thu, 02 May 2024 14:27:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714685228; cv=pass; d=google.com; s=arc-20160816; b=iSwk5/J0Wn4KLZklbsQdpbjLVlsGx/7dbavmCL2VR++rfBS5nrgHhkK+Zb958BL7HG fN1KH3EhsT1YRQsdbuCwKtnNPa4glbOuRG+vYiFNxF5DgBC0PHsepIgmetQuxxvFfemZ AKL1QfB3Xr5r7fd2TTFPirWRBaw1hrfP42z2+zRswhk49WwGUBGukIeVLV3OXCR83HPy 30BjeB5nY6gLG3JUyOH9v8SeLle5+rdytxR27bA2pU1LDbaDtOcbgWzU0v3QvGknU9hc uCZd9lnuOBjSu/4jTMK+Xx1WLtRhKl3Y0nxSvHpFjrLnJOu2tGUSxJS3X6k5G51SGlGX 5Zkg== 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=/jgR8JD3oQd88EH8HKGjA3Az+hSDzBJU5y5/SDxJYdM=; fh=aDTS+bpspYtECWIZkV9sc23CsXTIDr2sIkz0LRDYvxk=; b=oNE0wBQehCQsTjZ9/9cD3Kpx6BfngcppyiG2PqZ8iLCmVnuP2gK/FlgBWvazKozW6F bJg0mtOOghvkGOFJYd3yylNupOC2pNf2Z3SbLW0qEz2JhWcO8E8EHmmJKmCLuUBt/dd8 FR62qAADQBoZbSy5Xsu0GbzLYz5eebbeGuriB7k904AJ8x49JWa+ef6aYrTwkAcSd9D1 +YZZrBkN3tvQUmFc3IG8n7ZcsptioCq+xWeunNQcS1w6kFmh41wjHPYoEVmNGaj7qYmZ YAe+wvbdMvoK+mGQPrOAdZtAGNjn9y30jtWSyLYMlK3wMhWcktkCnrN9iZStlIljxYlB qoNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=DAANplb8; 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-166934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id js12-20020a17090797cc00b00a58a312289dsi901381ejc.350.2024.05.02.14.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=DAANplb8; 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-166934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166934-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3C62F1F22885 for ; Thu, 2 May 2024 21:27:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12D8719DF7B; Thu, 2 May 2024 21:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="DAANplb8" Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.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 E656F181312 for ; Thu, 2 May 2024 21:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714685198; cv=none; b=b77BHQn4S2pHzwaaypa0t9WUbJ98CH1Bv8afMVVLHY+h/xO8e/IlIK1RrC8h8n/UOjxH0ZCQahKxHfxmwbNW1IRgaFfp3X6matyxBKfCaOhdDNPclQAAIRXmHOp6tE2nO0WFVBtrm9mE0M3mjxwqzUqoZJ3Tdw0tiz4hfAF24BQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714685198; c=relaxed/simple; bh=FXv+vJcBCmEgOu5jScWUmm7QGv45QW6i+T+dLFjv6OY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NY2Bw3VWhrC49Y6GuS0CAiFaNrMSCK/F0Q6pW7rH6HcEjPNnDqsN4GiDtC//eDFTJjWhnfqjuftNo1XSmL49CIvPrghhUYWp57QTkDBMkcsUjB7AhGQFYJmjEs4QuHreoEhhuwRAt9B11CCEJLmgJ51G1tuOQvOtUR6V+VTlNgQ= 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=DAANplb8; arc=none smtp.client-ip=209.85.210.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-pf1-f170.google.com with SMTP id d2e1a72fcca58-6f42e9221bbso1688946b3a.2 for ; Thu, 02 May 2024 14:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1714685196; x=1715289996; 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=/jgR8JD3oQd88EH8HKGjA3Az+hSDzBJU5y5/SDxJYdM=; b=DAANplb8T8epsb7QiagB9494a98DfQ2G1zai+CmFE/BJ8x/eMqVrLKjRHIqjQX2O+v NrUQk4UPZkwKJUDoSfhOZx4KzHdh8Vt0kePRQiBoISWV7SmCvfHdL2WfuAzB68TCWciq xKDILOO6d1/zqZQ0fBpHQ9AXWw3e/xew+qfMM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714685196; x=1715289996; 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=/jgR8JD3oQd88EH8HKGjA3Az+hSDzBJU5y5/SDxJYdM=; b=FJ8YZ2cdxDdWYgqnbsXrKLX6IQU9cLd2RvJNOJeI3uc/P16YLFrGMdLyWLNSLApc3k IxSiuXygMecUJEJQsVn0PqITMj6+HBuz1hKzqpAeSzqDaEbMIwtPbXMFBEwg2zu6cycD 9j8CJ6OP0+krNf18R8yHHEVfjxgaWjv//i9WzhfpOxMFck+M21++Q/6mwtxIsNXu0PdH 1e97LSNXwliQwPGXJsQsXFU7NBOkaO3gpYMIwpQqJjSOQk9fmUqP/hMSinzOJf4vAsny eD8WD65aqRr7kcvYBRYe5RETPqRVK2SlBOrzns1t/QbQRcNyGeRMyDknNdZGWybxOs3P q93g== X-Gm-Message-State: AOJu0YzlTDOaLlqCs/1Jhru2Iq9JlFdvxdZg+ftOvNkxx6uyM/zU1aD/ 45tFi4NFw8XaaR2eP37/e99VEEYhKMH526J6nC/tftVFqdJX87Y2KxL12EjaqVy13kwO2+VdUbd TCHkMterLuOsYEBzadbPK/dqf7Q0iwDC0Y7MPCRmlozIbaR/R7Onc48B1phBduDcvdKNLOFdJNP X9TVvCX3H1FiDUAwuZ6j5Wgde9HGIxKxcRhFhUlLK5ED0= X-Received: by 2002:a05:6a00:1305:b0:6ed:416d:e9a with SMTP id j5-20020a056a00130500b006ed416d0e9amr1014030pfu.7.1714685195864; Thu, 02 May 2024 14:26:35 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id it21-20020a056a00459500b006f4401df6c9sm1371345pfb.113.2024.05.02.14.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:26:35 -0700 (PDT) From: Joe Damato To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, tariqt@nvidia.com, saeedm@nvidia.com Cc: mkarsten@uwaterloo.ca, gal@nvidia.com, nalramli@fastly.com, Joe Damato , "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 v3 1/3] net/mlx4: Track RX allocation failures in a stat Date: Thu, 2 May 2024 21:26:25 +0000 Message-Id: <20240502212628.381069-2-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240502212628.381069-1-jdamato@fastly.com> References: <20240502212628.381069-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. struct mlx4_en_rx_ring has a dropped field which is tabulated in mlx4_en_DUMP_ETH_STATS, but never incremented by the driver. This change modifies mlx4_en_alloc_frags to increment mlx4_en_rx_ring's dropped field for the -ENOMEM case. Signed-off-by: Joe Damato Tested-by: Martin Karsten --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 +++- 1 file changed, 3 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..573ae10300c7 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->dropped++; return -ENOMEM; + } ring->rx_alloc_pages++; } rx_desc->data[i].addr = cpu_to_be64(frags->dma + -- 2.25.1