Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp162742lqg; Fri, 26 Apr 2024 11:34:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqoKkaPb2bwZKv0bgbSHfiRb7DnaoQCOzn6+n9UZDa5gzu9EWEimJJrvtaLdZ75GRWlVTRztXi2cq+EksqiWZULtKTERsxg8jVS162CQ== X-Google-Smtp-Source: AGHT+IGX2UBY99FX4lt2GXWatXFLbNaSqLmgu1DhFiqZheTEdWaQhQZVTP7jeEUyQV31CwUgcktg X-Received: by 2002:a25:98c4:0:b0:de5:5823:d5b3 with SMTP id m4-20020a2598c4000000b00de55823d5b3mr3910696ybo.26.1714156482476; Fri, 26 Apr 2024 11:34:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714156482; cv=pass; d=google.com; s=arc-20160816; b=WXNVnm7rdrsWdIdjXWglpPih2IiWqmqAn0bP1VTH003KHJcqYlyP4f+nSx7zoepo4R re15Q5LjhDCceLYrv2f636Oi/0/nNh47hi2rZyAd5ZSb5Z9FKEYgl8e8RN6Qfqwf6O9y vzhlXKBa12cdC7K/zuEG6tsvNaK5Tv3QYnGvk3ybrKVsX+ux+mjALmuTaqYbzpSQnls0 Bjp9vM7+wzHQJckhjLJLCZvNB+hzOD4Qu5oAu1cptoIrcJxmggCmtvEORNjGuywM68O8 9ZEFt43a80NINCHIXmwUBTrVlpkFKwBz1Q9zzKTd8F9IaGrOAbfEbtnyB+ys2+3bcv/f neGA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=pZoSwzLi6xvTIvtNVms/jlVvWAfvYtCLM7lzp/fumoA=; fh=jQn4gMYdQNJ0qCnQiDk2ihkxRf8A1ZXBCSI02BHjbC8=; b=eFn6N7ANnwNa1ecODJTIsh1VjmXrgSrDnlUxWIFDmYQdN7Y1BpuQ//7mY9E1OrhVrW bcJS2bkDmxV9hzTE+5nzYk85gN1LBhnCkYywMc1gZvhEj/+zFRHMmIG+q1noXQL5ndJW 4PA2ifoXhIytaZQFR/RTmosOp0qpYpU9FdEiwlBkZpBf3FU9foYJvD3rsojkAnd8PY1c 6sY2oMfwovfnK6F0i+9kuq7AuqYF+INHISVwHt0jGewrIq08gweJrnIrRlyqeiKkazHY cbEx6uSrwWEw+3wQYDtmVvRO/MGBELZ0pfzYAYBM2CWR90cJCaNoWw+gCMqh6AwpYGR6 Gsdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b="vVVU2/Ct"; 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-160573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v4-20020a05622a130400b0043a46e3a08asi4668388qtk.721.2024.04.26.11.34.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 11:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b="vVVU2/Ct"; 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-160573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160573-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3429A1C23B34 for ; Fri, 26 Apr 2024 18:34:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8832B647; Fri, 26 Apr 2024 18:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="vVVU2/Ct" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 6B921125B2 for ; Fri, 26 Apr 2024 18:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714156448; cv=none; b=N2RY+tffMiSyN/Ig4607JSMRheNCXsDOdfP6SbKlBr0koB+5EEJdlT+UMFb3XDwuuodqKJ1rpxP5rFWMURzvLMC8AGZc96d/pKH+7NTY+XEaQXp2ZuR2hOaZU1c9tqgG7/S/WbsjD6FzgUUjbghOCdV9UVfHxR5SJz4IsnB0ps0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714156448; c=relaxed/simple; bh=veT0sDsyrl73mCujRdcKEc2AtCFryNFecy2sFtWamoE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=k+9rUytcgvt9l0AGz+H1OhP7FE/ib3r1YJlWpuf3kIS7Y9tiNKs8SgBZ6lYQz22eY4oX9ral0G+oknKzLe9VVoCyge1UKAskqSM3JMx2zfDrYK6FfbBhOpS04kEC4InhdwobFbGLx38llN4hKRVfJ9zce4JtaA53ceGOWDy1e5c= 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=vVVU2/Ct; arc=none smtp.client-ip=209.85.214.169 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-f169.google.com with SMTP id d9443c01a7336-1e3e84a302eso19791975ad.0 for ; Fri, 26 Apr 2024 11:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1714156446; x=1714761246; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pZoSwzLi6xvTIvtNVms/jlVvWAfvYtCLM7lzp/fumoA=; b=vVVU2/Ct3D4r2pjJ2u3DuoB0ifAiZURDotWsnzPg8nxXXw9YkeMRN6cieUZGPlPzMX MqTsJnI6khIFz+q5hkcs0CUXKEUv88CDwSoel4Mvr+R9QJwsFrlZULYwll/ba9T1GTz+ xHVf6eo1eoKnSks0UCOmH4o2MKl+zoHnkiS18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714156446; x=1714761246; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pZoSwzLi6xvTIvtNVms/jlVvWAfvYtCLM7lzp/fumoA=; b=nJFuMPUovZS4/3HIIWh09dOxszjDp3rrnW1ESiwnFeIRzzVHZletuUoyI0Mnj6KPka 0AIpvKLJuSYU3xXVN0Ruu7ZefwWCx18POJE+Mc+hnzt3MONPBoVkCcI0VWg1FlUnIPB9 dRBQYhoZoCCN9/gjiQDFMlQHLeMlRc06cBiWc9Av/zGFG/7u2G4N2GlJAXS/D3+R+bX+ xooO9De6crFfftnJFxt1zZ4xqbSToVXytbHzkPMGzula/rsuDBq7bhU5qK7XI8Xfawj6 lND7amVIOZUEICMIwu1er1Crkm60Mm0U/KVRIZCIJbA+D4gizxO52kndEn68a30z/f3y 6uqg== X-Gm-Message-State: AOJu0YyQ+XKhMDXxkua8w2g4NhF/UijAeWlh5IUoUrUD43RVfbc2al9D qyeWQn94z0Y50xIyVfCN3RNp5vyDSJgycxC28r6N33b0KHA95FtFMZqZKMVqekz5Ipp50ZzqyXq dmUpgfrqYw5F5diy++H5JrmcvL+byCN3lKix/Qoz/XjM3HTmAXaXw5qF5IfG7RQy4zo0CHehVy7 kO37P1L7lNy9kkIflAXbdF9YGBJB64ItYaM5giR8wX7EM= X-Received: by 2002:a17:902:c40f:b0:1e4:4537:40ab with SMTP id k15-20020a170902c40f00b001e4453740abmr4026315plk.12.1714156446226; Fri, 26 Apr 2024 11:34:06 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id j23-20020a170902759700b001deecb4f897sm15713152pll.100.2024.04.26.11.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 11:34:05 -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 , linux-rdma@vger.kernel.org (open list:MELLANOX MLX4 core VPI driver), Paolo Abeni Subject: [PATCH net-next v2 0/3] mlx4: Add support for netdev-genl API Date: Fri, 26 Apr 2024 18:33:52 +0000 Message-Id: <20240426183355.500364-1-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Greetings: Welcome to v2. This series adds support to mlx4 for the netdev-genl API which makes it much easier for users and user programs to map NAPI IDs back to ifindexes, queues, and IRQs. This is extremely useful for a number of use cases, including epoll-based busy poll. In addition, this series includes a patch to generate per-queue statistics using the netlink API, as well. To facilitate the stats, patch 1/3 makes use of an existing field, "dropped" which was already being exported in the ethtool stats by the driver, but was never incremented. As of patch 1/3, it is now being incremented by the driver in an appropriate place and used in patch 3/3 as alloc_fail. Please note: I do not have access to mlx4 hardware, but I've been working closely with Martin Karsten from University of Waterloo (CC'd) who has very graciously tested my patches on their mlx4 hardware (hence his Tested-by attribution in each commit). His latest research work is particularly interesting [1] and this series helps to support that (and future) work. Martin has re-tested this v2 using Jakub's tool [2] and the stats.pkt_byte_sum and stats.qstat_by_ifindex tests passed. [1]: https://dl.acm.org/doi/pdf/10.1145/3626780 [2]: https://lore.kernel.org/lkml/20240423175718.4ad4dc5a@kernel.org/ Thanks, Joe v1 -> v2: - Patch 1/3 now initializes dropped to 0. - Patch 2/3 fix use of uninitialized qtype warning. - Patch 3/3 includes several changes: - mlx4_get_queue_stats_rx and mlx4_get_queue_stats_tx check if i is valid before proceeding. - All initialization to 0xff for stats fields has been omit. The network stack does this before calling into the driver functions, so I've adjusted the driver functions to only set values if there is data to set, leaving the network stack's 0xff in place if not. - mlx4_get_base_stats set all stat fields to 0 individually if there are RX and TX queues. Joe Damato (3): net/mlx4: Track RX allocation failures in a stat net/mlx4: link NAPI instances to queues and IRQs net/mlx4: support per-queue statistics via netlink drivers/net/ethernet/mellanox/mlx4/en_cq.c | 14 ++++ .../net/ethernet/mellanox/mlx4/en_netdev.c | 79 +++++++++++++++++++ drivers/net/ethernet/mellanox/mlx4/en_port.c | 5 +- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 4 +- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 + 5 files changed, 101 insertions(+), 2 deletions(-) -- 2.25.1