From patchwork Fri Oct 7 21:38:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687638 X-Patchwork-Delegate: anthony.l.nguyen@intel.com 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=Sh8MnB0Y; 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 4MkhXz4r8bz23jL for ; Sat, 8 Oct 2022 08:39:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9142460AB9; Fri, 7 Oct 2022 21:39:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9142460AB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665178783; bh=bwtl2JYpWpDyGbmcHMPmgChKIIJxrDQS5Fo0U+iCi34=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Sh8MnB0YjS7VtoxlHSJ9yagpRxaA1NAREATdeXaOhk3IdGQ/wEcvs0omzx/2hW91H IKladB9eqqQJDxZ9Vx0RRtRGtZwyz62JMFbr+o5boc86LDAoYTXBOs0dTCNDF/c5xo 4LCFpNWCY/jqT4QI2QbZPoEH1ogGYJOaaChfgESzOzK3aCkeHUmr0y8sN2uzPYxJDD tDt2zotmZ+PFVpl/yei9I26GZRI5Mp33Z5TCKj1hEZl6L9YFvwU1T2z4TtkfMl72p7 ygoenDK5JBE89pP81uqWQBRHPORAAkmH1RjgThckYRtgB9JjBui1z3JqBIA05hHPyB DTExoL7zCJghw== 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 pEXp7VtGpWqv; Fri, 7 Oct 2022 21:39:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 8EAAF60ADC; Fri, 7 Oct 2022 21:39:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8EAAF60ADC 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 35A5F1BF3D4 for ; Fri, 7 Oct 2022 21:39:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 10FA64049B for ; Fri, 7 Oct 2022 21:39:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 10FA64049B 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 29_BLb3Ib5E4 for ; Fri, 7 Oct 2022 21:39:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5C2BE4018F Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5C2BE4018F for ; Fri, 7 Oct 2022 21:39:37 +0000 (UTC) Received: by mail-pj1-x102c.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so8329005pjq.3 for ; Fri, 07 Oct 2022 14:39:37 -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=eahtucVHdG81huhJm8/Cz/GmI9h1getEoGvrIDntCUs=; b=hbUtBHQZbZB6r7evPnV3hwWhNq9819stujw0ER8VOtSLtiuReNx7C1a03PwC4xV3U7 nrUFAyvQsg3aT7U2rKh7NdASAE/OyM0n8vnyyC4vF9XfLU3D/ZKg1bvA+6eNNbnhFJMC 3OLxsUVH49n3ElcyE20jsS1VlVnV0DMpRw6CdowU6N8rEpa4DpUPurEixAR3XZGb9IhW W0bvBak7VFXmsUYnoZkADtN6QnCqPhxuH107WIz6y4z5JUe2csrOQh1STMISUQh2mq2G rbIZlXzVj/78rqsSJ9Ww3B1PNt3MaBfnGSM878FNw+KyrZWH0Jy46rGncYescjRXr0KC JWoQ== X-Gm-Message-State: ACrzQf1b0Opi7i/Lqz/oWqEoj0K1mflq7zWtL9yh/tQhw1JqhxYV6cxe Z3Mgol0rK+yoKvVlkqGbyL9BufoRhHVe5Ca1FqiZbRwQWaFUW2gnLxUEsXTasVDVIETd3+Rmq9w DpS5S4p8TER5yoDJtTLc8+Z/p/A68A88posUzvdKDij7gjT5Xs1yRj4vxC0TvlQRwvdVb/x/u4m FpgD+4Jg== X-Google-Smtp-Source: AMsMyM52/lUKswCS/qZYuMBJ9BEqQth2q6NFgpmZ+k4uSbNmCL63VQOtZl3dYuhLGZOySTf1AZzGDQ== X-Received: by 2002:a17:903:1d0:b0:178:1d5b:faf8 with SMTP id e16-20020a17090301d000b001781d5bfaf8mr6878942plh.9.1665178776544; Fri, 07 Oct 2022 14:39:36 -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 m24-20020a17090a7f9800b001f2fa09786asm2012655pjl.19.2022.10.07.14.39.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 14:39:36 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 14:38:40 -0700 Message-Id: <1665178723-52902-2-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665178723-52902-1-git-send-email-jdamato@fastly.com> References: <1665178723-52902-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=eahtucVHdG81huhJm8/Cz/GmI9h1getEoGvrIDntCUs=; b=yRBYm3Q1SVvY1Gms/XvF4cWbV6d5C+lkm6N9bQvWLNTX1hoEDMrjmDZV390YdoWDKB aN+24OuHYHPnMKLS2ws2LAzDWu6OMee5tV8Zsz2WwiABj2Iza5IWDGhIr6kD2yPkMCTs sfgoQBnijBo9uIDBaLuKaAhqFWTIBdK96NlX0= 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=yRBYm3Q1 Subject: [Intel-wired-lan] [next-queue v4 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: netdev@vger.kernel.org, Joe Damato , kuba@kernel.org, davem@davemloft.net 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 Acked-by: Jesse Brandeburg Acked-by: Sridhar Samudrala Tested-by: Gurucharan (A Contingent worker at Intel) --- 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 21:38:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687639 X-Patchwork-Delegate: anthony.l.nguyen@intel.com 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::133; helo=smtp2.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=YPSYNiKT; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4MkhY13Q7lz23jL for ; Sat, 8 Oct 2022 08:39:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8C4F74018F; Fri, 7 Oct 2022 21:39:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 8C4F74018F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665178787; bh=m4x0R1EUM8YzWb6NOBmywJjhPunFoIbkvMhrx1jX7j4=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=YPSYNiKTlHuqNXtI3VC93U170QV2KHNYJ5akPzjijI57wpYyJchj3IaLfrCHRmjmf hXDXGTlofN3S7cndUB+WmLkqk74i/5M7tYKjgf6Ctch7SP3d6QA3NzB3YDXsaEL5rY anLf5RYB5uEKp0jL+MuseEfpVNxpNNRRz/XjHgteRo2pKqPWXvaytsV9+v2qZWGPNt CiONdgbvjf5QJbHA7y1joPXbzUBL1lz7qIV+5axrQrGjZrz/FJER92DtesRS1DOBH7 CPrpu58/mS65KgJFkYGzHTUqLkewdJqX4geXphBDcuvGzw0EYgEzJ2vMQmtUE37vvh h9PTNrc2LR47w== 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 XRVT8AO4JS3s; Fri, 7 Oct 2022 21:39:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 7FFF64049B; Fri, 7 Oct 2022 21:39:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7FFF64049B 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 5FB271BF3D4 for ; Fri, 7 Oct 2022 21:39:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3B0C0823C0 for ; Fri, 7 Oct 2022 21:39:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3B0C0823C0 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 0KC01fl0cSDh for ; Fri, 7 Oct 2022 21:39:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 930FA823AB Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by smtp1.osuosl.org (Postfix) with ESMTPS id 930FA823AB for ; Fri, 7 Oct 2022 21:39:38 +0000 (UTC) Received: by mail-pl1-x62e.google.com with SMTP id x6so5630180pll.11 for ; Fri, 07 Oct 2022 14:39:38 -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=Y3GVIVAxpMC/VnvFXwEMfwYlp9ueZhYknYrdLAirqlQ=; b=A2ovVdoc0jIj+4h6qk20D8EdprVyIBgcsA06viAyx+9iCA7EceUDxn3b8UyT2G7SuG Yae5x+nAZAvMowCb0kdOJ4Fbx8hUTC+//IsnkZkmYJM/S+XE6tlbERUMaw725EqwrqOT OK+FwzPtiRPcQrmkECkLdvxI2+o4OMKqno/qgiRs8+cQTjKbNRU9Iv2sAeweQ/vZmJ4F VmcgyqRXAZJSAtYCE8SWnUtBqoTPjHx8rvQ+S5BGOCKql4kyH39LUJArByLFI57LpZfV bMQlf87NwOqjRoNT5gR7Lk2GqD7M5VN11LttrAiVsQCW/tZYECoEP8uOzzpVg/JzJbwg xa4A== X-Gm-Message-State: ACrzQf1bqiVAO3tmFh1uAel+lXYkGNwoBJHYkVIcsFaeZoijdTt/7637 xfND02Ed2DRcqY8ySq2jA+paZJv3Dnmxdz6nwy6odOfCPXUHnYbVSbHnuT4oHK/dZOnCenpLRtV 8fQS0gtee7BKX4Z6EFHOQmoQ+UdvMvR9d/Ig8wYWNtNEBvMoUXwINtxLMWD1qQG4lOs0REVSmJl xV3GgTjw== X-Google-Smtp-Source: AMsMyM6/lTafg+rb5cud9MMRvCMsoKqjewZRYjWiYreiHgG3mxPfZcTUeNMIVwuQKq2qm+OQdJC0QQ== X-Received: by 2002:a17:90b:1648:b0:20b:f0ae:2169 with SMTP id il8-20020a17090b164800b0020bf0ae2169mr3552539pjb.173.1665178777793; Fri, 07 Oct 2022 14:39:37 -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 m24-20020a17090a7f9800b001f2fa09786asm2012655pjl.19.2022.10.07.14.39.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 14:39:37 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 14:38:41 -0700 Message-Id: <1665178723-52902-3-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665178723-52902-1-git-send-email-jdamato@fastly.com> References: <1665178723-52902-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=Y3GVIVAxpMC/VnvFXwEMfwYlp9ueZhYknYrdLAirqlQ=; b=YCYdesFSWl3TBBzu9F3NZFzbTzkw8Cd/2GtZLkYwG//aCVv9mcG/9eBTJQx9a3/uzl MGvNbvpjTM0/8ucETvsQo3Y6Uo7xXW6K6UAyow5lZzvNQ//SmhoKY8Tu4lbOhrcXnOsy 2w1Z2yPlseZw6m8gV6a0EpAMq0xwPHnwfLgS8= 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=YCYdesFS Subject: [Intel-wired-lan] [next-queue v4 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: netdev@vger.kernel.org, Joe Damato , kuba@kernel.org, davem@davemloft.net 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 Acked-by: Jesse Brandeburg Acked-by: Sridhar Samudrala Tested-by: Gurucharan (A Contingent worker at Intel) --- 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 21:38:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687640 X-Patchwork-Delegate: anthony.l.nguyen@intel.com 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=Mxyk7rIj; 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 4MkhY56Q95z23jL for ; Sat, 8 Oct 2022 08:39:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0B65E60AB9; Fri, 7 Oct 2022 21:39:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0B65E60AB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665178792; bh=ymPhcxtOZrkP/JpKg105iRiI09gC5chCCA5ReWm90OU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Mxyk7rIjdFGJcn6nTQmu0/bm1XFtqSlvhorV1AvgEizH/2nOfuT306hLRWhwUWKKi 79St2QCEmPVUatFCH+cxJqUMIcquKwpBEx6u91Qp6FYly44F6Jitv+IGFasMPZlrOH v9+Qv7QwzB4DzIW3LApckiyga+rFYNjw3JXz2oRdGRDq5fij/hqjyAdnTmbqoY6D5I 632oD0Ud6dxpeTir1Bi68Kdy/ASssw0t72i60Fllg4/i5pqfRysEN13TJhm4qgJ/bJ 0sFPxca/LJHg/Q8NRU6BlJU6gVlZyRuquHhNjrZV+qWpq8cMMPl2EuavrxIpUtfee/ UxAyGILUBbJsA== 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 Zr-OCv6IlsiH; Fri, 7 Oct 2022 21:39:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 1F7BE60B05; Fri, 7 Oct 2022 21:39:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1F7BE60B05 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 C62B11BF3D4 for ; Fri, 7 Oct 2022 21:39:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 99402404F5 for ; Fri, 7 Oct 2022 21:39:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 99402404F5 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 nrAkShFZ8MD2 for ; Fri, 7 Oct 2022 21:39:39 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D3F304018F Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by smtp2.osuosl.org (Postfix) with ESMTPS id D3F304018F for ; Fri, 7 Oct 2022 21:39:39 +0000 (UTC) Received: by mail-pg1-x533.google.com with SMTP id s206so5734297pgs.3 for ; Fri, 07 Oct 2022 14:39:39 -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=UYcP5d4aVc4DITBtO91mYOhK66gC9vjutv9fpNeGoEE=; b=WHbyoDyKg8Imd7yYSBStjz5/GYAHhc4jR7CG8SjlBDj0kygHCguPkHsv1cxlJpXAwU Qh5LxyBeTCFTeyVotExIU5ibqRQ0NWKm88TUAkkCFrEumWLL4PBocNtFNHIRPzXjZO8+ q1wKrMC3DNgaeO3hk9xxVpmid9IrDDSOTA5uGCdtHtD8iiIbnlSOl99VHa3zjgxgnUgI ZOtuQWyzdSEZlkBoHv7wwvWW42IOrnuT3xrdHDoFsvL/g08VHvXqyBQMiqofUDdKOCT5 dX5uJc0d0I08JDG6bxRmGUpA1AJBIKtrBkFHCZs5H1ExMvSljsXYfvvgHs/2vOuO/0KQ 6D/g== X-Gm-Message-State: ACrzQf0R2Pt7w+FD9hpL4u42CzhLmKW+opiZ0keqWEHV6xhuhlDLgjML v74NyNWl+J5Goc1W0oe60OG3uVZHaGbdNJYYPoZBxdHaYffQzVl/tVzXCQ0MJ5dUWV5P8QUIhGW ryrZasnKX69ADeZ3I1jrvlQIbcr8ZyyPw8q6ni6hDqV+qeEPfa5u2sH8cIMWsnYE76y23fZNlaR BoYLXhrg== X-Google-Smtp-Source: AMsMyM7SgX9AMYL0vd3xtRxUfxWspnAMPI59qKWwlBPrnOOSJU5qX01Y/y02OzY8zAeUL8dxBnnk7w== X-Received: by 2002:a63:6cca:0:b0:43c:7998:8a78 with SMTP id h193-20020a636cca000000b0043c79988a78mr6207622pgc.600.1665178779014; Fri, 07 Oct 2022 14:39:39 -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 m24-20020a17090a7f9800b001f2fa09786asm2012655pjl.19.2022.10.07.14.39.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 14:39:38 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 14:38:42 -0700 Message-Id: <1665178723-52902-4-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665178723-52902-1-git-send-email-jdamato@fastly.com> References: <1665178723-52902-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=UYcP5d4aVc4DITBtO91mYOhK66gC9vjutv9fpNeGoEE=; b=pT0mtqDkL/bP+4d+lqvFN2dJQDnjGK14Rqw0b7yhQGYYDv5bwcCIhxZt/BY2mkZigD wKYZy5oX6XkX9i4Obo0Pr+o/bK9OGWRHzhREVTKgN3wP85Bz72SIflioIeB6rFbn2Mso KrpzPq9Y1n9WPZ7efNFIHhx1cfNeN1OnkPsRI= 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=pT0mtqDk Subject: [Intel-wired-lan] [next-queue v4 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: netdev@vger.kernel.org, Joe Damato , kuba@kernel.org, davem@davemloft.net 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 Acked-by: Jesse Brandeburg Acked-by: Sridhar Samudrala Tested-by: Gurucharan (A Contingent worker at Intel) --- 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 21:38:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1687641 X-Patchwork-Delegate: anthony.l.nguyen@intel.com 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=BK1eG9C3; 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 4MkhY96gQxz23jL for ; Sat, 8 Oct 2022 08:39:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 38E3860B43; Fri, 7 Oct 2022 21:39:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 38E3860B43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1665178796; bh=VDK8LCryApBlp+mgwHvQ8CyE1g7zmHuEyk1fNB2RvJU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=BK1eG9C3fhFuTt9R1BHBAfmoM/JkVv31tUmG4jHfB99FzcTu9eoUFv7G9Ccksuw3m W8JivxFGJLNkdPr45n5EWcyevfGrNBErP1Um30TkxLRs250pER2tXOcspFTMaUqKZT c5qrA5w0Bsu0P4PuhtPyeiiYWERARhhNLRHpFJxLzuxwq/K9H4e5ukPOmhQYKAEBgs nlAwZUf884xwe6SgAKFdNjDzWhaNuzgJpzLI7SxB6VYmXhAZoiwlJbLPSei5Hi/o6m YJ6btRW/enSSWD4BoFsAR8GzwY8sra0ZugpxXg3etexlwpPFnUNuHhxNGdJS4+m5L5 6UR/1VLxiMyuQ== 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 UtIiXv8hs2zt; Fri, 7 Oct 2022 21:39:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 0B68060B55; Fri, 7 Oct 2022 21:39:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0B68060B55 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 398261BF3D4 for ; Fri, 7 Oct 2022 21:39:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1446960ADC for ; Fri, 7 Oct 2022 21:39:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1446960ADC 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 snCR_P0ehxgE for ; Fri, 7 Oct 2022 21:39:41 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 45C6F60AB9 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by smtp3.osuosl.org (Postfix) with ESMTPS id 45C6F60AB9 for ; Fri, 7 Oct 2022 21:39:41 +0000 (UTC) Received: by mail-pj1-x102a.google.com with SMTP id l1-20020a17090a72c100b0020a6949a66aso5822164pjk.1 for ; Fri, 07 Oct 2022 14:39:41 -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=z0vFULdBKwrocYcOtwwM7mQLQOp60to46d8PtAxnk1M=; b=HuffC5qF9lUx9L4nqZv9b2mnBIXxPgNRvcR8rNdpfe2w/HjQYOpm2Mt70KbnFF/nX1 g2kkq+SrBOp+oBJ6c4nOI4zgr0mWxt8W5vUBM6EgoA56UbiZE8DeguU0xsZvAGdWOQln ny6QbVWqcPGtkN/5Rznlg0l5Ni039FrRqD2dl00SRM/8t15ScR3Ua0U4yZPgCOeqqM3d ymJTUaj7iS0PV7WvoUPcKcsVV8FJPGjYgYjG56MT/L+2kyZSrx2tjbsS/VLUpAwiGjFY nWNZHFZI1Ie8oGRaaxJdoeZtKZCMlcB/5VpUWc2kUr6iQjL4JPENP1x6pz5srExKNM6h agiQ== X-Gm-Message-State: ACrzQf2C9WC3zzJn5blZWssMX0e4CpaJr8/JNp4du4jvlg/Dvqlz9J4N /IAKafSFeR7wlbj69Du6L8VggpPGbYi370fQMmdLIPPLfzsnfsIsDqlOrpwAloJ/4oSqupxFQIs BT7LGflgzaVcsYzc/P8tQ4+esRy5bop8gWrovRhk/P1IUJwy0WKBL2c78to0ghLJWR2mBITiAx8 M3lem9zg== X-Google-Smtp-Source: AMsMyM7GDXRatllZhBdz3awwyEocviEAFfinyRSstgbzMXRwYLTSpU8/bjhHjP5rAJIc3/ygK9POJQ== X-Received: by 2002:a17:90b:1d4c:b0:20a:8db1:da52 with SMTP id ok12-20020a17090b1d4c00b0020a8db1da52mr18088096pjb.98.1665178780266; Fri, 07 Oct 2022 14:39:40 -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 m24-20020a17090a7f9800b001f2fa09786asm2012655pjl.19.2022.10.07.14.39.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 14:39:39 -0700 (PDT) From: Joe Damato To: intel-wired-lan@lists.osuosl.org Date: Fri, 7 Oct 2022 14:38:43 -0700 Message-Id: <1665178723-52902-5-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665178723-52902-1-git-send-email-jdamato@fastly.com> References: <1665178723-52902-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=z0vFULdBKwrocYcOtwwM7mQLQOp60to46d8PtAxnk1M=; b=UgrFMxcroGOVU8LnSMIcenQy8uSEnuAYINFxotf9XLElzqCAf5s4lEORyi4Uw2VDRJ 868Mvbg12HUfoSxa24GfnEgzq3s22kH74yUbuZVSyBCNuCud4j5zJAeCYT594Z+OzkTn d9l3/q21azUcz2FZ2LqvNrQEFGJtJzjpKeJ3k= 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=UgrFMxcr Subject: [Intel-wired-lan] [next-queue v4 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: netdev@vger.kernel.org, Joe Damato , kuba@kernel.org, davem@davemloft.net 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 Acked-by: Jesse Brandeburg Acked-by: Sridhar Samudrala Tested-by: Gurucharan (A Contingent worker at Intel) --- 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..79d587a 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 %u tx_cleaned %u " + "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();