Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp251021lqa; Sat, 27 Apr 2024 00:27:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtAZUGQgStWOhGzf/jnftSwHv2mqetF087AnI9qMAHNwxelnb3BWktMXyKLu/1SUkCaV6oVR45s+FhDVo+rlFc2GKgGdsNOiBYXN1saA== X-Google-Smtp-Source: AGHT+IHMZS+Qw2lo5X6VB9kaV+A/J2ll+edZSAOOVxJiPinQDMKSiIAiJ0YrJN/nJAacrvwf8jEv X-Received: by 2002:a17:906:3a85:b0:a55:b272:ea02 with SMTP id y5-20020a1709063a8500b00a55b272ea02mr2964689ejd.75.1714202851694; Sat, 27 Apr 2024 00:27:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714202851; cv=pass; d=google.com; s=arc-20160816; b=dQthKmvZg+RzJAobaR4t9M8GZL46sZWWeGFvqqIOqT1QrPD1Qsbo02IwtYiOAVRzYS in8wUkvIj4pDLNBNtgX8iV6dHHB6fksRp0GKjzoaSMHi2mzHABpDIwAz9/OjbFQJiMz2 5bRamliKLlVQLg4T2Bqolj1exF4FX3xoNK7veVXEnblHATJKWNEmijb10D0mGQj4+KRg Fv5Y4g3BnQT2TIM0TiM6les1i3KTceSoVnlkkdqDqY3rEt+HKaA+KeT5+0h0Ng4b8Mrv THDHHZDqhII535+heiNUo8vxCwoUe8vew2in2J84wNkmgqiJ/F4lHdMvrm8EFRvt0e3n tuuw== 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=bWCAnD1jZ3nDtPosCAWW0dfALxgzSh64Qpv1vVnvFZM=; fh=K0Z9i3lJIeY5eGvtJ/RSrPA0uTZKuKLMJp+SMwJXpTk=; b=P4G2J9rcVi9v2Y6K3KWCndgmmxZ6YADAytMCSd9M+KFF9UTx4R1+HIBE5x/G7zKRw3 IXJ3nTbRG509mQM2iTXR6O5+Mt6iAmVo26CQkM9tBM3Lta92mo+he/jgf7z5tv7Xa103 ctneUGT+53MykeKk2hJDPzj9U0oiaUmQHdVFp73Uh0hNbF3R3ufaV+QaBTedmUEC3qXq L05kE9lAD25jglpQBVN/XK7a4gSJcqjQ+8tM+QisDkCKm0RTezI5aOUzZBkhtQ3EEdNP runGRi63iIXF2pPPRkHqR72hSTzsZmwmdQm2G3qitfto2zTcNS+iE/jHp2FZKAZz0Qub tLAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VkD9lmb8; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-160940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 bm19-20020a170906c05300b00a5882a4035bsi5277230ejb.272.2024.04.27.00.27.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 00:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160940-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=@redhat.com header.s=mimecast20190719 header.b=VkD9lmb8; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-160940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 6DF3A1F22608 for ; Sat, 27 Apr 2024 07:27:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D757C48CC6; Sat, 27 Apr 2024 07:26:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VkD9lmb8" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 895F946548 for ; Sat, 27 Apr 2024 07:26:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714202793; cv=none; b=e7RzWt5YzIxbUNkZYrmhS5tKWNpvR8xZiMUY1fzCit/YMG0KfOTyE6mthY4vVfhuQnfsVu6ip4/WodjWRCWS9+OdtbMsQORqc4SWamPGoLzy6WkTzwBMuBWlRiGj460YhqCN4VtnRrcp7d3Z9y39S11n15nVJ3uz61QbVVVCF3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714202793; c=relaxed/simple; bh=qiY2hlTGyOxiwxVTtNlPshBl7QKx1czprCJM15jCIQg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ks3zlQpqj2whJuSQ9YkDHwwFuxlgTHfsHG8HASGIdZ5VNVqFXlm2ATOThrCjlM4kpkVp3suM1SXF1pfk+yW/z8PBajqOjAwa9+/MQN1bP37K42a+MusIuSrPjzMh8bE0LGbJq5zSRVZJqRHAJm/nFvye8asTDzs5qT+voSPlHg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VkD9lmb8; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714202790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bWCAnD1jZ3nDtPosCAWW0dfALxgzSh64Qpv1vVnvFZM=; b=VkD9lmb8/pubw2AzpDgjWxDtga3/JFgNBQMIyBnI4adQvm2rjEKsHWlk/0Tig2HwcoOKNe TkYkqG6Xc/c8nKs8Frw1wtY/DVPJ2K0FjwppruXXDLOj0+pezTa0AU9x+CTStkUYLWa19D zOkd7Fm+UUbeBPFq5qSpuXWZawMDsV4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-375-aI-aaikKOEqtVD15u6Ou4A-1; Sat, 27 Apr 2024 03:26:26 -0400 X-MC-Unique: aI-aaikKOEqtVD15u6Ou4A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 162813800086; Sat, 27 Apr 2024 07:26:26 +0000 (UTC) Received: from p1.luc.cera.cz (unknown [10.45.225.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E958492BC7; Sat, 27 Apr 2024 07:26:24 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Michal Schmidt , Tony Nguyen , Pucha Himasekhar Reddy , Jesse Brandeburg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org (moderated list:INTEL ETHERNET DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next v4 3/7] i40e: Refactor argument of i40e_detect_recover_hung() Date: Sat, 27 Apr 2024 09:26:04 +0200 Message-ID: <20240427072615.226151-4-ivecera@redhat.com> In-Reply-To: <20240427072615.226151-1-ivecera@redhat.com> References: <20240427072615.226151-1-ivecera@redhat.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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Commit 07d44190a389 ("i40e/i40evf: Detect and recover hung queue scenario") changes i40e_detect_recover_hung() argument type from i40e_pf* to i40e_vsi* to be shareable by both i40e and i40evf. Because the i40evf does not exist anymore and the function is exclusively used by i40e we can revert this change. Reviewed-by: Michal Schmidt Reviewed-by: Tony Nguyen Tested-by: Pucha Himasekhar Reddy Signed-off-by: Ivan Vecera --- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 10 ++++++---- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index aa874d6ff8c3..4291001d0053 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11267,7 +11267,7 @@ static void i40e_service_task(struct work_struct *work) return; if (!test_bit(__I40E_RECOVERY_MODE, pf->state)) { - i40e_detect_recover_hung(pf->vsi[pf->lan_vsi]); + i40e_detect_recover_hung(pf); i40e_sync_filters_subtask(pf); i40e_reset_subtask(pf); i40e_handle_mdd_event(pf); diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index bc9e766d88cb..fa08b0297925 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -861,13 +861,15 @@ u32 i40e_get_tx_pending(struct i40e_ring *ring, bool in_sw) /** * i40e_detect_recover_hung - Function to detect and recover hung_queues - * @vsi: pointer to vsi struct with tx queues + * @pf: pointer to PF struct * - * VSI has netdev and netdev has TX queues. This function is to check each of - * those TX queues if they are hung, trigger recovery by issuing SW interrupt. + * LAN VSI has netdev and netdev has TX queues. This function is to check + * each of those TX queues if they are hung, trigger recovery by issuing + * SW interrupt. **/ -void i40e_detect_recover_hung(struct i40e_vsi *vsi) +void i40e_detect_recover_hung(struct i40e_pf *pf) { + struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; struct i40e_ring *tx_ring = NULL; struct net_device *netdev; unsigned int i; diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h index 2cdc7de6301c..7c26c9a2bf65 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h @@ -470,7 +470,7 @@ void i40e_free_rx_resources(struct i40e_ring *rx_ring); int i40e_napi_poll(struct napi_struct *napi, int budget); void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector); u32 i40e_get_tx_pending(struct i40e_ring *ring, bool in_sw); -void i40e_detect_recover_hung(struct i40e_vsi *vsi); +void i40e_detect_recover_hung(struct i40e_pf *pf); int __i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size); bool __i40e_chk_linearize(struct sk_buff *skb); int i40e_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames, -- 2.43.2