From patchwork Fri Oct 7 17:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=ny7wZGHg; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MkbdZ4xMDz20Zg for ; Sat, 8 Oct 2022 04:58:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E2E2F6068D; Fri, 7 Oct 2022 17:58:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E2E2F6068D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665165502; bh=ge9S5GLfQUIdjt7xzM+hlOKSwXvSpiaXP6dL04+49sw=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ny7wZGHg3WyxcjyJH4cYuk0BiiGvEY3Qjg062z8nbLLklAPv2ozfeaAQ9lRHDK1Qn OWMUnyfuXDQsUB/CiAaKiUSYhuokx0uToKHTuizWPVz5+MtqjQGBPxeOnmZwKPErQL BPNP3b5Pca7JpNSpa/IPuj+LK3wKkHvezh8RnlCWB9NupYI+0tZC2CWZA9x+HQbrRc sk1eeQfRJbN80VxIOQAeeGu0ZlL8Q4mS8sipjXzC3AprKOI2OHigRh7oy2bNTTlh8b 8UVNmbVJzdkdzozAQvY6Jg5IOmcLiuOyPlags4arWhjlc8XDKXe8GQ/bOoTqJDr1VT Jf/2rr85aiSFw== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4CzHAN0gAyH9; Fri, 7 Oct 2022 17:58:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 3C2FE60746; Fri, 7 Oct 2022 17:58:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3C2FE60746 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 5B9651BF279 for ; Fri, 7 Oct 2022 17:58:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 332A060746 for ; Fri, 7 Oct 2022 17:58:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 332A060746 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5x1Eu6p5Oy8U for ; Fri, 7 Oct 2022 17:58:19 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0B3C1606ED Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0B3C1606ED for ; Fri, 7 Oct 2022 17:58:18 +0000 (UTC) Received: by mail-pg1-x52f.google.com with SMTP id c7so5269979pgt.11 for ; Fri, 07 Oct 2022 10:58:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=KYs5i1UtSKwff4LZqDYKTEYs6XamWF2jUJRPKUQ5EPA=; b=GI9YplWcoxkl/b2oKWXJQJXb5sTlMZAlZiJcVSO4M8DPxTmrbuk2GQ7Inf5Uj/LnUf 6ZntAd70l0ilg4SDItsT1DkHGld7qrBO2krzJFzg+HNu52JaRE1skdeNicLQYQfFvcal SAhLRpunzvOpV6gJx6O0cqJ1SglJiLtanhrs9XwW3JAk4u7dM1SdJ9lmT5B34ADSKPuY Dnz3mmyjv1+iEbkiLLTKn/leEAfmrWKVXiHy7a/s0AO+a/To65gVDI5PB4TF4JNHdJ/o 5JrvhbJ0WJEmbur04MZTSGEEY+crvlf3wKam9lBiabzHVYP4yovmoTLHDuUIlDb7QVvN ULwQ== X-Gm-Message-State: ACrzQf07cu4iP3KxlhGrWzA1rtu6Xym3GAazvItsw8UcHQ/COMjuTHTe nC8WU9jUDhvx79FxR6ruAPpiKIqev2BmwBbRNvU9eBO1rod6QXNyMv9egGgpf2+y3vq7w0Sb+eE uaKt8oUU7sroBkP01bRbrqYl1KDy7eCwjNEZiz4MxtFc0oLcHDyvrzXXz5zZSD4oEDgPEycf/2c hdcIk5pg== X-Google-Smtp-Source: AMsMyM6W03wcqwAG9RpMDEjUqqAZTlA/ogFZ7vSBkI6/0T292dzmkF+4xoA0WXqqZ1lC2+ClDPlhZg== X-Received: by 2002:a05:6a00:21c2:b0:52b:ff44:6680 with SMTP id t2-20020a056a0021c200b0052bff446680mr6492275pfj.57.1665165498124; Fri, 07 Oct 2022 10:58:18 -0700 (PDT) Received: from localhost.localdomain (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id a29-20020a631a1d000000b0045c5a749a8fsm1937498pga.61.2022.10.07.10.58.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 10:58:17 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 10:57:24 -0700 Message-Id: <1665165447-1802-2-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665165447-1802-1-git-send-email-jdamato@fastly.com> References: <1665165447-1802-1-git-send-email-jdamato@fastly.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=KYs5i1UtSKwff4LZqDYKTEYs6XamWF2jUJRPKUQ5EPA=; b=QQwz1yhXpBlKXl/lwsNiWYara4M4y1mpfLgFqQL9UrYYwCrCy+lM90LF1g+CCipFiR fYGhF6iuJUJ2A+lf/kpAXGb0dv0Ej4gchNBCTJ1dF17nG1ELHzajsa1RJkykNkHsK+QA rTM3EMkVOVWZAg6bcjbW2XxpqansrVbZN8bI4= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=QQwz1yhX Subject: [Intel-wired-lan] [RFC, next-queue 1/4] i40e: Store the irq number in i40e_q_vector X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Damato MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Make it easy to figure out the IRQ number for a particular i40e_q_vector by storing the assigned IRQ in the structure itself. Signed-off-by: Joe Damato --- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 9926c4e..8e1f395 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -992,6 +992,7 @@ struct i40e_q_vector { struct rcu_head rcu; /* to avoid race with update stats on free */ char name[I40E_INT_NAME_STR_LEN]; bool arm_wb_state; + int irq_num; /* IRQ assigned to this q_vector */ } ____cacheline_internodealigned_in_smp; /* lan device */ diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 6b7535a..6efe130 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -4123,6 +4123,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename) } /* register for affinity change notifications */ + q_vector->irq_num = irq_num; q_vector->affinity_notify.notify = i40e_irq_affinity_notify; q_vector->affinity_notify.release = i40e_irq_affinity_release; irq_set_affinity_notifier(irq_num, &q_vector->affinity_notify); From patchwork Fri Oct 7 17:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=WDWdG3CI; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mkbdd4VWSz20Zg for ; Sat, 8 Oct 2022 04:58:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5483360008; Fri, 7 Oct 2022 17:58:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5483360008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665165506; bh=nxpBvJy3mUIEdrOU66+w2nhHqY4tA2en6UKNbZZKgeU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=WDWdG3CIbKsVl/187Eu85f4KykqXtNEKWr4Av2OheQqRI4E1OR3g/d0JPGdzJgjED KHHZIgs2xR0J6VqBwL5UGDZYwKXBOkKoBsnb9peSZX3tbFhbf1aHpQCbZCe96ehaIi c46xTZKO+s/HWO+9zCgwYrLoCzBnd5vOnFv9TP74lQW/ew+65xriytSH/6GT1iAkhc QaWuERCT75ywNrDJXibQoBglPVrLL7w9V4/piC9M6RBY9anQfxKmq5L0832a/D1P4d D7tU5PxTTiuWlEwF5uxJ4+CjiKPhFmSJuNyOB4X5509goWvZLoer3gGBrWzXPrDX1e 2TUpzgRl5wjxg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iNygxmriL_yy; Fri, 7 Oct 2022 17:58:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 31D7360009; Fri, 7 Oct 2022 17:58:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 31D7360009 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id DAC841BF279 for ; Fri, 7 Oct 2022 17:58:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B555B81775 for ; Fri, 7 Oct 2022 17:58:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B555B81775 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y9T6y5l18MDL for ; Fri, 7 Oct 2022 17:58:20 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0E29581760 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by smtp1.osuosl.org (Postfix) with ESMTPS id 0E29581760 for ; Fri, 7 Oct 2022 17:58:19 +0000 (UTC) Received: by mail-pg1-x52e.google.com with SMTP id 78so5250891pgb.13 for ; Fri, 07 Oct 2022 10:58:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=xNDjKLhwL2kTGNEr27xp8J5TsBdq4kDpkXlCpFhKrQ4=; b=CBzKedN6JCm0BiNevsE3hI+VdwzKspT4T634TkHiZQxBw+a9VeUpQ7eLhccf3fVjnY 6BQ3ZCfpAioXqShpnk888yBFONpdbeBP4A/cYtobLs3ZvPe/N8X26c9wcH3FM9ZIxcS8 YYwJ2U9lQ5xGk7F10UCcqLIYRtTdbKwykCkCxzvQbFCTTGfUxFPF3JPZsBG3RFPR+MoI kgrv7qxCO6qoAnsiqWuQHyAm9aXatyFjf437Hv50ki9uIlGOQyOtfmPe2ttlQ8ajGNXt zeUSxl8FIJeSzmBebCPpFUicNmTOB+flg2+Sh7+PNn3wTMorkSX4xJTYSlEmlO8ZQ+cT 01Ww== X-Gm-Message-State: ACrzQf0Dr41pK7BWvPmn2qyOZz82QPeEW3dWiN20BHdvIanUqid12H7M ebZXJeL39YzW+iFxORngYAl1mOF2YFAtQK2EOhP54PcxId4n+N2RcLHDsreuKnC4Q1BMCKAU6Wm 95tC/XmGGUt8M4Q3O+AcyC6lcbXV+YAh1g9u7jmcutuGmMf+eywEBMfoWshJiJRQbFlzhObe8IQ V2p4bH4Q== X-Google-Smtp-Source: AMsMyM7IChpX/p2Wi8BTYVgni+zYgmhYaNERksxzKmCqopDt+4St7h9AF/7EolCye6XF02Z+DY4dyg== X-Received: by 2002:a62:ea09:0:b0:562:a86f:63af with SMTP id t9-20020a62ea09000000b00562a86f63afmr6247367pfh.71.1665165499206; Fri, 07 Oct 2022 10:58:19 -0700 (PDT) Received: from localhost.localdomain (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id a29-20020a631a1d000000b0045c5a749a8fsm1937498pga.61.2022.10.07.10.58.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 10:58:18 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 10:57:25 -0700 Message-Id: <1665165447-1802-3-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665165447-1802-1-git-send-email-jdamato@fastly.com> References: <1665165447-1802-1-git-send-email-jdamato@fastly.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=xNDjKLhwL2kTGNEr27xp8J5TsBdq4kDpkXlCpFhKrQ4=; b=lLX2Y0kWHsstVysx6Gv7fOhnhvqzIzAvNoAn/thw7uqhn1mzMu8fAPyObWHDv8bROk ae3+0gIQvIali3pi3pkj9+COsGxLlXPko6l4L4LkOzd/Fo+WLQ6o7GltwprGp+YVgzou yBf14RSrDGfzlxn24NDSpBp9F0BowQCpc4nMg= X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=lLX2Y0kW Subject: [Intel-wired-lan] [RFC, next-queue 2/4] i40e: Record number TXes cleaned during NAPI X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Damato MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Update i40e_clean_tx_irq to take an out parameter (tx_cleaned) which stores the number TXs cleaned. No XDP related TX code is touched. Care has been taken to avoid changing the control flow of i40e_clean_tx_irq and i40e_napi_poll. Signed-off-by: Joe Damato --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index b97c95f..274de1c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -923,11 +923,13 @@ void i40e_detect_recover_hung(struct i40e_vsi *vsi) * @vsi: the VSI we care about * @tx_ring: Tx ring to clean * @napi_budget: Used to determine if we are in netpoll + * @tx_cleaned: Out parameter set to the number of TXes cleaned * * Returns true if there's any budget left (e.g. the clean is finished) **/ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi, - struct i40e_ring *tx_ring, int napi_budget) + struct i40e_ring *tx_ring, int napi_budget, + unsigned int *tx_cleaned) { int i = tx_ring->next_to_clean; struct i40e_tx_buffer *tx_buf; @@ -1048,6 +1050,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi, } } + *tx_cleaned = total_packets; return !!budget; } @@ -2689,10 +2692,12 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) container_of(napi, struct i40e_q_vector, napi); struct i40e_vsi *vsi = q_vector->vsi; struct i40e_ring *ring; + bool tx_clean_complete = true; bool clean_complete = true; bool arm_wb = false; int budget_per_ring; int work_done = 0; + unsigned int tx_cleaned = 0; if (test_bit(__I40E_VSI_DOWN, vsi->state)) { napi_complete(napi); @@ -2705,10 +2710,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) i40e_for_each_ring(ring, q_vector->tx) { bool wd = ring->xsk_pool ? i40e_clean_xdp_tx_irq(vsi, ring) : - i40e_clean_tx_irq(vsi, ring, budget); + i40e_clean_tx_irq(vsi, ring, budget, &tx_cleaned); if (!wd) { - clean_complete = false; + clean_complete = tx_clean_complete = false; continue; } arm_wb |= ring->arm_wb; From patchwork Fri Oct 7 17:57:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=IKzjlUZx; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mkbdm458Xz20Zg for ; Sat, 8 Oct 2022 04:58:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D4CC760008; Fri, 7 Oct 2022 17:58:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D4CC760008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665165514; bh=iBo2VPlG6bKRmJ2NtaIoi49WgElDP/v7TSZAD4xEe40=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=IKzjlUZx/FsX45M79hvsyhiFNCSsniNJ78sffmSgy6o7nTTE84bBUxl6flSzv0Otq 6HjfzmAP05CFT3qfUKCJ/tV+gDYhq1y25r87IexzKZhZ3nii09ZkJBrZK0cJgr6ZUb tgfdTVBjmskJtUjDeH7Eq3EVGbHobf0k64FZ9Nn+CcB8RhpbNA0tnHQhclolNW6gWX cJa5HWQQZY2dTy6WrNwRNUqMjH/XmBBTc2RlQra+hhzurVEBKCAro5efAu7/obor+c 2BEmL2vGt7xdKs644n9IuxcyD4JZRzLQ8p1D7G5svzDAohzLW4FSLy02LeGJmIQ7Pq I5FYpW4th/LIg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cSGk1-EVENVk; Fri, 7 Oct 2022 17:58:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id D027B6006A; Fri, 7 Oct 2022 17:58:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D027B6006A X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id A9F111BF279 for ; Fri, 7 Oct 2022 17:58:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8393A40358 for ; Fri, 7 Oct 2022 17:58:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8393A40358 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P6Kz8w2xaA7Y for ; Fri, 7 Oct 2022 17:58:21 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2F4CC4033D Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2F4CC4033D for ; Fri, 7 Oct 2022 17:58:21 +0000 (UTC) Received: by mail-pf1-x435.google.com with SMTP id y136so5552533pfb.3 for ; Fri, 07 Oct 2022 10:58:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=9/BPnj1Nhn6MgzQqr2NDRl2Vn5kg5dhYp/e0DPKsG20=; b=xOJa/z+XDHreQC7CDGfWFpX/Y/ZDSeKXF13YKLbJbSH/1X1Tcuqvr32uaqHsiunzdS bP74mw71URnTV559IPdVwwj+P23Oa2xPfb7deRCb0mg4YAZou62rVe55k85rAPxWiNGF 8I3EzBBPOIl52znsZGshGe9ZghUUNU4sGMeHZ15qCdceFwLh7MeaA7LBV3X6t0lkgnXj ysWH1LGFUW+czc5S8QsBwVGuLKBPfjEmFNOmniYOLa4/RoUZTGx4+GKnjj49XCaqCW+P 4cUTn55OPbWmEMEIIVCrdm3+FByriydVe+HZbK86yFngbi/uWwsD9i+75J9HC3Xuv8Cz evdw== X-Gm-Message-State: ACrzQf1iYBNSnfiqhCU2m5319ffDzruCwueaifwmuzhe85uNMb1Tg0fK 2jhqsRwytsjdQQXKrwPWdbJRxCiVhdKrCY6llNu0yZA6o/VSiWm5x7JEIXYf93XTf8aOfr1lYAW TysMlI82T9ojarTYgc+6Qyf7BceFy5fPtz1PCg3Jy2RN4f5FsYzb3gNW2l6Duk0Q4gD0WDNkhmE +jO4Xcww== X-Google-Smtp-Source: AMsMyM6doWmXubRGQFViO9/No29FfEL31RgE/kfG5wJjPiPp69zH2aTzFmBsByXRCmmIZVkQd1C3LA== X-Received: by 2002:a63:f349:0:b0:43a:b82b:1173 with SMTP id t9-20020a63f349000000b0043ab82b1173mr5716443pgj.534.1665165500291; Fri, 07 Oct 2022 10:58:20 -0700 (PDT) Received: from localhost.localdomain (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id a29-20020a631a1d000000b0045c5a749a8fsm1937498pga.61.2022.10.07.10.58.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 10:58:20 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 10:57:26 -0700 Message-Id: <1665165447-1802-4-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665165447-1802-1-git-send-email-jdamato@fastly.com> References: <1665165447-1802-1-git-send-email-jdamato@fastly.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=9/BPnj1Nhn6MgzQqr2NDRl2Vn5kg5dhYp/e0DPKsG20=; b=Ehy/sHsBL6/C8V7k/Mjypt8k4/+lFXGCfy4ZRd4ntYJzxvuPNhA6mU7k02qDlAZ4xZ 6SB/Ka+htHErtt856BkiSysNLJOiMUst4XR2TNLf18nvmYizZP+0oQtWTrXPWvRsxCQy v3RvVXsgkOzMXtrgcKIVDZVXSHPZPmkdg5YfM= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=Ehy/sHsB Subject: [Intel-wired-lan] [RFC, next-queue 3/4] i40e: Record number of RXes cleaned during NAPI X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Damato MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Adjust i40e_clean_rx_irq to accept an out parameter which records the number of RX packets cleaned. No XDP related code is modified and care has been taken to avoid changing control flow. Signed-off-by: Joe Damato --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 274de1c..5901e58 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -2425,6 +2425,7 @@ static void i40e_inc_ntc(struct i40e_ring *rx_ring) * i40e_clean_rx_irq - Clean completed descriptors from Rx ring - bounce buf * @rx_ring: rx descriptor ring to transact packets on * @budget: Total limit on number of packets to process + * @rx_cleaned: Out parameter of the number of packets processed * * This function provides a "bounce buffer" approach to Rx interrupt * processing. The advantage to this is that on systems that have @@ -2433,7 +2434,8 @@ static void i40e_inc_ntc(struct i40e_ring *rx_ring) * * Returns amount of work completed **/ -static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) +static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget, + unsigned int *rx_cleaned) { unsigned int total_rx_bytes = 0, total_rx_packets = 0, frame_sz = 0; u16 cleaned_count = I40E_DESC_UNUSED(rx_ring); @@ -2570,6 +2572,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) i40e_update_rx_stats(rx_ring, total_rx_bytes, total_rx_packets); + *rx_cleaned = total_rx_packets; + /* guarantee a trip back through this routine if there was a failure */ return failure ? budget : (int)total_rx_packets; } @@ -2693,11 +2697,13 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) struct i40e_vsi *vsi = q_vector->vsi; struct i40e_ring *ring; bool tx_clean_complete = true; + bool rx_clean_complete = true; bool clean_complete = true; bool arm_wb = false; int budget_per_ring; int work_done = 0; unsigned int tx_cleaned = 0; + unsigned int rx_cleaned = 0; if (test_bit(__I40E_VSI_DOWN, vsi->state)) { napi_complete(napi); @@ -2738,12 +2744,12 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) i40e_for_each_ring(ring, q_vector->rx) { int cleaned = ring->xsk_pool ? i40e_clean_rx_irq_zc(ring, budget_per_ring) : - i40e_clean_rx_irq(ring, budget_per_ring); + i40e_clean_rx_irq(ring, budget_per_ring, &rx_cleaned); work_done += cleaned; /* if we clean as many as budgeted, we must not be done */ if (cleaned >= budget_per_ring) - clean_complete = false; + clean_complete = rx_clean_complete = false; } /* If work not completed, return budget and polling will return */ From patchwork Fri Oct 7 17:57:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687581 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=ci6/kagQ; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mkbds0cHPz20Zg for ; Sat, 8 Oct 2022 04:58:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3502D4033D; Fri, 7 Oct 2022 17:58:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3502D4033D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665165519; bh=fyafK+s3M0bgXeeMGAVxSTHMTlakr/EcFm1vuyKWOgY=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ci6/kagQogiJeZZM8vFk8Yz2kmpFuHydSaPFpm2UgWHdtkuIp00AeaGbIkI3bHvhQ I0WZOPWa8WZvdD2uAZo9UVjUk3Yo4Mi4CgaWAHw2TI/6AFWsK8e8kbR2q6sQlsbl0k b7b56cYdjIBRqR02xC5J9vmsX5JPtN2I07wOxp9j2yCyTvGOK9oUkINZygHuobgfmc kYuwgFYxJYAoGkNdGArRmt8Lz2VQ8UftQwG5P/C0Eh5EdhEGrV83k3QOHnOjUpc5gl 5XLkeQ1O31Y6YSlEzbNWMqYrsjQqJ9tTNJCOe6md0cKj0wBwOjEQ/lEk4Opz3oE8pO Qj2E0VVMJZlpg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d9EPpvZTwRBF; Fri, 7 Oct 2022 17:58:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id CB80A4088D; Fri, 7 Oct 2022 17:58:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CB80A4088D X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7B18F1BF279 for ; Fri, 7 Oct 2022 17:58:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 56243400E4 for ; Fri, 7 Oct 2022 17:58:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 56243400E4 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xojnlprej-QR for ; Fri, 7 Oct 2022 17:58:22 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5E420400C7 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5E420400C7 for ; Fri, 7 Oct 2022 17:58:22 +0000 (UTC) Received: by mail-pf1-x42a.google.com with SMTP id w2so5605970pfb.0 for ; Fri, 07 Oct 2022 10:58:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=XWctEXDnmuICt7Ye8VLx7Vw64U+4Ns0RSzzBPrWXVB4=; b=d9hc1v1jqkvekUNRalnqqE/FMRgD4E5C5uYXRG8XZWKUJ+J7Z5RZA5iLN1WcLPqcFV 6O2Y5zbbFrsRMJZx/FPK8eSEzHeFBAo4tv7LcspIiZT2viN73P7RZnnQpFNbVJ7K4GTH 2sWGt7O7lWDeQM/tefDaxXHwUxhrZHX+FcKajPDT+iCOTjUYtqwXwB20xWPQqBS3rrzu HM34zLrn/yD8t9W775rZ8LVWty4Vf5law1xnDbqOQk5nC3uzJ6RGu1XJrcGuxO/nQMJK m3qH1nwsbjfLWo+JFRX0yqNKTB8YUg6Lsrm9plO5iwCaCyKcPi0ip6R0KQsG8F//0Ffx oE1Q== X-Gm-Message-State: ACrzQf2zkW0CakWhMxvKbRgG/WjiQ+rUPYsuWYk4cCxaMG1+drN0kAX4 nVRwu9Kl9PjHD/BxmnWlko0dFQ43RpEExR1iHCpx9FZTtJIyNDc1X9Wdc6KfM/nZQmR9tJtH2+y bbtrX6ztaNcvBnE346wLua1k/JhG+1ZREnH9WxKL7MMQpwvlHN6c5kahpAgjtfvi8QRibPl1Ac7 ogVh/Cxw== X-Google-Smtp-Source: AMsMyM67hwMZVnyGZTcEu105OM7FprOnJwfjl7LTdkbF4+mdeeblnZLQBwUOIpFnj8opbMnIXbArhw== X-Received: by 2002:a63:9141:0:b0:447:afc1:b803 with SMTP id l62-20020a639141000000b00447afc1b803mr5688447pge.135.1665165501468; Fri, 07 Oct 2022 10:58:21 -0700 (PDT) Received: from localhost.localdomain (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id a29-20020a631a1d000000b0045c5a749a8fsm1937498pga.61.2022.10.07.10.58.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 10:58:21 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 10:57:27 -0700 Message-Id: <1665165447-1802-5-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665165447-1802-1-git-send-email-jdamato@fastly.com> References: <1665165447-1802-1-git-send-email-jdamato@fastly.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=XWctEXDnmuICt7Ye8VLx7Vw64U+4Ns0RSzzBPrWXVB4=; b=v7TNYv4t+EMrgZz/+rMVC8vceQ4qQH1bp1eJZHItBF5bzYZK4kdpFzVPgde7AED2Q0 OGD9XP+jF5n+aCDZE/WkKiiIwXz/AookJnSLb9XOtNZ1PzmT14BLp6rf1wQkgScQ6N/x GmCD6AzebOv7sAROwgxUhkHpPpAKEbw0wSLa4= X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=v7TNYv4t Subject: [Intel-wired-lan] [RFC, next-queue 4/4] i40e: Add i40e_napi_poll tracepoint X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Damato MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Add a tracepoint for i40e_napi_poll that allows users to get detailed information about the amount of work done. This information can help users better tune the correct NAPI parameters (like weight and budget), as well as debug NIC settings like rx-usecs and tx-usecs, etc. When perf is attached, this tracepoint only fires when not in XDP mode. An example of the output from this tracepoint: $ sudo perf trace -e i40e:i40e_napi_poll -a --call-graph=fp --libtraceevent_print [..snip..] 388.258 :0/0 i40e:i40e_napi_poll(i40e_napi_poll on dev eth2 q i40e-eth2-TxRx-9 irq 346 irq_mask 00000000,00000000,00000000,00000000,00000000,00800000 curr_cpu 23 budget 64 bpr 64 rx_cleaned 28 tx_cleaned 0 rx_clean_complete 1 tx_clean_complete 1) i40e_napi_poll ([i40e]) i40e_napi_poll ([i40e]) __napi_poll ([kernel.kallsyms]) net_rx_action ([kernel.kallsyms]) __do_softirq ([kernel.kallsyms]) common_interrupt ([kernel.kallsyms]) asm_common_interrupt ([kernel.kallsyms]) intel_idle_irq ([kernel.kallsyms]) cpuidle_enter_state ([kernel.kallsyms]) cpuidle_enter ([kernel.kallsyms]) do_idle ([kernel.kallsyms]) cpu_startup_entry ([kernel.kallsyms]) [0x243fd8] ([kernel.kallsyms]) secondary_startup_64_no_verify ([kernel.kallsyms]) Signed-off-by: Joe Damato --- drivers/net/ethernet/intel/i40e/i40e_trace.h | 49 ++++++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_txrx.c | 4 +++ 2 files changed, 53 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_trace.h b/drivers/net/ethernet/intel/i40e/i40e_trace.h index b5b1229..7d7c161 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_trace.h +++ b/drivers/net/ethernet/intel/i40e/i40e_trace.h @@ -55,6 +55,55 @@ * being built from shared code. */ +#define NO_DEV "(i40e no_device)" + +TRACE_EVENT(i40e_napi_poll, + + TP_PROTO(struct napi_struct *napi, struct i40e_q_vector *q, int budget, + int budget_per_ring, unsigned int rx_cleaned, unsigned int tx_cleaned, + bool rx_clean_complete, bool tx_clean_complete), + + TP_ARGS(napi, q, budget, budget_per_ring, rx_cleaned, tx_cleaned, + rx_clean_complete, tx_clean_complete), + + TP_STRUCT__entry( + __field(int, budget) + __field(int, budget_per_ring) + __field(unsigned int, rx_cleaned) + __field(unsigned int, tx_cleaned) + __field(int, rx_clean_complete) + __field(int, tx_clean_complete) + __field(int, irq_num) + __field(int, curr_cpu) + __string(qname, q->name) + __string(dev_name, napi->dev ? napi->dev->name : NO_DEV) + __bitmask(irq_affinity, nr_cpumask_bits) + ), + + TP_fast_assign( + __entry->budget = budget; + __entry->budget_per_ring = budget_per_ring; + __entry->rx_cleaned = rx_cleaned; + __entry->tx_cleaned = tx_cleaned; + __entry->rx_clean_complete = rx_clean_complete; + __entry->tx_clean_complete = tx_clean_complete; + __entry->irq_num = q->irq_num; + __entry->curr_cpu = get_cpu(); + __assign_str(qname, q->name); + __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV); + __assign_bitmask(irq_affinity, cpumask_bits(&q->affinity_mask), + nr_cpumask_bits); + ), + + TP_printk("i40e_napi_poll on dev %s q %s irq %d irq_mask %s curr_cpu %d " + "budget %d bpr %d rx_cleaned %lu tx_cleaned %lu " + "rx_clean_complete %d tx_clean_complete %d", + __get_str(dev_name), __get_str(qname), __entry->irq_num, + __get_bitmask(irq_affinity), __entry->curr_cpu, __entry->budget, + __entry->budget_per_ring, __entry->rx_cleaned, __entry->tx_cleaned, + __entry->rx_clean_complete, __entry->tx_clean_complete) +); + /* Events related to a vsi & ring */ DECLARE_EVENT_CLASS( i40e_tx_template, diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 5901e58..f2b1b94 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -2752,6 +2752,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) clean_complete = rx_clean_complete = false; } + if (!i40e_enabled_xdp_vsi(vsi)) + trace_i40e_napi_poll(napi, q_vector, budget, budget_per_ring, rx_cleaned, + tx_cleaned, rx_clean_complete, tx_clean_complete); + /* If work not completed, return budget and polling will return */ if (!clean_complete) { int cpu_id = smp_processor_id();