From patchwork Tue Jun 11 18:42:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13694138 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 E9CA04F211; Tue, 11 Jun 2024 18:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131369; cv=none; b=WpaZOah5RyWotUSUeULWYlLBr0N57IuzK5swcsng7SBntZkFEQIPJvSjqvoppBMYTna67GvwxaT13pEXeE2z8wHL/1QsSKXyhwilhpj4h8k1obxxyIcKCwXBryxcai5JpQ79K6YGX+uBtpvF4/G+s7vIJ5Z1k/b0VRZQIMvREoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131369; c=relaxed/simple; bh=pgqcbifk+QMBXJDtWm7l+jmLQx98LRG/nmZSVdeoBW8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GRyof1rqtRMhMf9s6tIHIcjsjxPYixI55i3WdfSYCEaI8hBckxw7exsJ3VGfaguQm8FXc9rwHONML5lXJRJzOh9RaKcuiE7P2FdXBpDinpMKTDntQpNOqoL1G2Mi4vEBnXsb7MFKPg69VBE83BByGLAu6KG5oJA+lgs6wyzrhiY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Lsp5Gm4n; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Lsp5Gm4n" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718131368; x=1749667368; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pgqcbifk+QMBXJDtWm7l+jmLQx98LRG/nmZSVdeoBW8=; b=Lsp5Gm4nyhdKK1bQWRK9jFQ6sliq81cGhtme0WGJk0wjhgmRQ3LEIiut 8kFJdjaJ7PzNKFF3b5r6ds8xUAG+LW2KtGmWF0wZtqdBZlOMFXc+7EBb7 LsHudotx+8V4KKm9xTip64/K7KdjDQr/xT+sBdygPRDVbV/fYfvS6hGKk uoCdskUxVsMTLRRKoejnCR/CRtuh2/E3vdvvCkKgtHyuPPHbjWG+mfuPT AgOBzd5XhwNlpf9dDNdcebfxsGAdJjRhokvcRF9v8/OYq3XuK+tymt/2z NDHBZu62xmRWdEv/100FV9BKv7rZ4QOZ4cJHpZF8sx/37Ar/OBPPoYWTP w==; X-CSE-ConnectionGUID: NMiW9dsvQTqE9e0AvnUd9w== X-CSE-MsgGUID: 4IUxMXSZSRGqTWA1uu/vBg== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="12025537" X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="12025537" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 11:42:47 -0700 X-CSE-ConnectionGUID: pBSlb3dVRQeGRTA74QAGFg== X-CSE-MsgGUID: cUbu5gyETn6obSrH02vMkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="39592489" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa010.fm.intel.com with ESMTP; 11 Jun 2024 11:42:46 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Michal Kubiak , anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com, magnus.karlsson@intel.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, bpf@vger.kernel.org, Wojciech Drewek , George Kuruvinakunnel , Simon Horman Subject: [PATCH net 1/4] i40e: Fix XDP program unloading while removing the driver Date: Tue, 11 Jun 2024 11:42:35 -0700 Message-ID: <20240611184239.1518418-2-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> References: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Michal Kubiak The commit 6533e558c650 ("i40e: Fix reset path while removing the driver") introduced a new PF state "__I40E_IN_REMOVE" to block modifying the XDP program while the driver is being removed. Unfortunately, such a change is useful only if the ".ndo_bpf()" callback was called out of the rmmod context because unloading the existing XDP program is also a part of driver removing procedure. In other words, from the rmmod context the driver is expected to unload the XDP program without reporting any errors. Otherwise, the kernel warning with callstack is printed out to dmesg. Example failing scenario: 1. Load the i40e driver. 2. Load the XDP program. 3. Unload the i40e driver (using "rmmod" command). Fix this by improving checks in ".ndo_bpf()" to determine if that callback was called from the removing context and if the kernel wants to unload the XDP program. Allow for unloading the XDP program in such a case. Fixes: 6533e558c650 ("i40e: Fix reset path while removing the driver") Reviewed-by: Wojciech Drewek Signed-off-by: Michal Kubiak Tested-by: George Kuruvinakunnel Acked-by: Maciej Fijalkowski Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/i40e/i40e_main.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 284c3fad5a6e..2f478edb9f9f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -13293,6 +13293,20 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog, bool need_reset; int i; + /* Called from netdev unregister context. Unload the XDP program. */ + if (vsi->netdev->reg_state == NETREG_UNREGISTERING) { + xdp_features_clear_redirect_target(vsi->netdev); + old_prog = xchg(&vsi->xdp_prog, NULL); + if (old_prog) + bpf_prog_put(old_prog); + + return 0; + } + + /* VSI shall be deleted in a moment, just return EINVAL */ + if (test_bit(__I40E_IN_REMOVE, pf->state)) + return -EINVAL; + /* Don't allow frames that span over multiple buffers */ if (vsi->netdev->mtu > frame_size - I40E_PACKET_HDR_PAD) { NL_SET_ERR_MSG_MOD(extack, "MTU too large for linear frames and XDP prog does not support frags"); @@ -13301,14 +13315,9 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, struct bpf_prog *prog, /* When turning XDP on->off/off->on we reset and rebuild the rings. */ need_reset = (i40e_enabled_xdp_vsi(vsi) != !!prog); - if (need_reset) i40e_prep_for_reset(pf); - /* VSI shall be deleted in a moment, just return EINVAL */ - if (test_bit(__I40E_IN_REMOVE, pf->state)) - return -EINVAL; - old_prog = xchg(&vsi->xdp_prog, prog); if (need_reset) { From patchwork Tue Jun 11 18:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13694140 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 C148A57CB5 for ; Tue, 11 Jun 2024 18:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131370; cv=none; b=At4s1pxJTOhVoiLGiHl+eIUrd+iS+t6k8AghBfT9MpKojDOdC6FE3ugiGlUCOsgei1Tpf6W/aeqLi7uHfgrkcEtMHq4v6kOVQsmZVYn1kDhkjSc0isXSiJYv3uVoFfJnxfRcn/PXFw54H5o0B0vkAyDccov4LS8fj//B4mvUSCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131370; c=relaxed/simple; bh=cdci/UIHnxyuQxXe4uC5r8TNaiA1AXhAkgJObHOgHx0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VBnNQt50qeqLsDtrMx1cV8qHIsmeeohbiyd17r9n+rWgrDiv8tbtSQ/jdyPuwWMwZzM9RHVVOnHHK0k0ax2R1/6NJks+r+F/Hcm2+NBVMRk7+RI+It9nfeGQEEs+hdg4by8fVBpW+27BPV+ujLIp5s5PcznODlj7iV1pzjxDCrU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HOqRgn5y; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HOqRgn5y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718131369; x=1749667369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cdci/UIHnxyuQxXe4uC5r8TNaiA1AXhAkgJObHOgHx0=; b=HOqRgn5ylcp+yOqxsdA4N+kffRr9gBivb0prM/CqEeUParjIyrMqN19Y L51LNgAQPbML5ZIZEbqTaYzCQS/tyII0X72A6J6csNnq+aP6TJk+7YiDv /Pm7R7n8Omsq9/Gr2BF6qoKCM7jD0a7ca9FvvMMcsh3G2fwhldXk26s8O b7j87OT6jGr2aRfm29IojoVcHfRGc2p01UFfuBP7J9T6LjHBq5TNa2Qpw JGdbj0PjKnqT2kRxvDnUtsn72bwWgCU2q9/YcntrCkyt+7E3Vk13L9Xs9 oOUZZ+XzOB2KL8oa04Gn5fl3FHsRBCLvO03iCYmDHdsNcD1hKJzBpfEqn g==; X-CSE-ConnectionGUID: Oj8zziaISd+9QpNiyIxrjQ== X-CSE-MsgGUID: crGP+0ZvQc6XHixVBHpeGQ== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="12025544" X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="12025544" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 11:42:47 -0700 X-CSE-ConnectionGUID: YE4Rwdr9T+a98QVk8DQ3GA== X-CSE-MsgGUID: nZDG+s+nQz+3jfZ9qyyX+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="39592495" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa010.fm.intel.com with ESMTP; 11 Jun 2024 11:42:47 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: En-Wei Wu , anthony.l.nguyen@intel.com, david.m.ertman@intel.com, shiraz.saleem@intel.com, Cyrus Lien , Wojciech Drewek , Pucha Himasekhar Reddy Subject: [PATCH net 2/4] ice: avoid IRQ collision to fix init failure on ACPI S3 resume Date: Tue, 11 Jun 2024 11:42:36 -0700 Message-ID: <20240611184239.1518418-3-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> References: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: En-Wei Wu A bug in https://bugzilla.kernel.org/show_bug.cgi?id=218906 describes that irdma would break and report hardware initialization failed after suspend/resume with Intel E810 NIC (tested on 6.9.0-rc5). The problem is caused due to the collision between the irq numbers requested in irdma and the irq numbers requested in other drivers after suspend/resume. The irq numbers used by irdma are derived from ice's ice_pf->msix_entries which stores mappings between MSI-X index and Linux interrupt number. It's supposed to be cleaned up when suspend and rebuilt in resume but it's not, causing irdma using the old irq numbers stored in the old ice_pf->msix_entries to request_irq() when resume. And eventually collide with other drivers. This patch fixes this problem. On suspend, we call ice_deinit_rdma() to clean up the ice_pf->msix_entries (and free the MSI-X vectors used by irdma if we've dynamically allocated them). On resume, we call ice_init_rdma() to rebuild the ice_pf->msix_entries (and allocate the MSI-X vectors if we would like to dynamically allocate them). Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA") Tested-by: Cyrus Lien Signed-off-by: En-Wei Wu Reviewed-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 1b61ca3a6eb6..45d850514f4c 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -5564,7 +5564,7 @@ static int ice_suspend(struct device *dev) */ disabled = ice_service_task_stop(pf); - ice_unplug_aux_dev(pf); + ice_deinit_rdma(pf); /* Already suspended?, then there is nothing to do */ if (test_and_set_bit(ICE_SUSPENDED, pf->state)) { @@ -5644,6 +5644,11 @@ static int ice_resume(struct device *dev) if (ret) dev_err(dev, "Cannot restore interrupt scheme: %d\n", ret); + ret = ice_init_rdma(pf); + if (ret) + dev_err(dev, "Reinitialize RDMA during resume failed: %d\n", + ret); + clear_bit(ICE_DOWN, pf->state); /* Now perform PF reset and rebuild */ reset_type = ICE_RESET_PFR; From patchwork Tue Jun 11 18:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13694141 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 0634F59167 for ; Tue, 11 Jun 2024 18:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131370; cv=none; b=kruNvOWzibdmuFEz1gmqGc6hgtkejHuPhN39zURY5Y1Y5Eos301pwqrrq+mkHuXh9ALPDyK1PikqsaElnD1L6rvnDPF34eePtifmKv+IqDS8EKJZ33clJIZ6kDETfA+7DXcGw8L+oJCh63TvQAZgjR9xtGpPeGTiuAKceR24FN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131370; c=relaxed/simple; bh=pJgk+4GFxhSP9n+1P6GfF3XIwj+YEmPeHsu9OPdKcTo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K8ezqup2mqV8fw3j1RlAshfncTxgP7CZUVy7VS+V6hfCOykQOesImfFVnCI5jvCjst9jDVH5c68fL67vbyZFEW3lidj+clSTVCq+G2jePh0LIbXx1ivHwSFfzZJiyWZFkcKlkHqlYsC2JNzMQe0qC3CXUmlSHpMc4D11rgEI2ls= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WOYs5qvM; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WOYs5qvM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718131369; x=1749667369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pJgk+4GFxhSP9n+1P6GfF3XIwj+YEmPeHsu9OPdKcTo=; b=WOYs5qvMVRid4ebAE9IxuyfJvkGRxrtmc2Ax3Gvbq1NiI9CZAV5xJIUx swWyvQWlN3g8rg8HtHKGF17CjqIZshBoCesIOe0QHy0AbitGTacL0Pcgv /J8L+41KDBE/h2+LmH447grpTcZLizJthEZKuviFdqqN7Ne3P7VKAaNbr sz0poI6r9nVu0p5Tb2q6qE+8CaWFEmBd9YpGhBxskCd6lPwy/Mur23GLt vBJhSt+mLD966Zp0zvXW++P/nLVjFr2bLqonuhjt4lV6SJhIYpM8HB5mK KZlKQXjFiutZgzEYboaVf7tGy18mNh6TVtanQW33RlZhCAPB14gEGMgVY A==; X-CSE-ConnectionGUID: 8PNLrqubSBG2XJ6Uvm4Ckg== X-CSE-MsgGUID: XRr9BhaCT4mF5aTJC+08yA== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="12025550" X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="12025550" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 11:42:48 -0700 X-CSE-ConnectionGUID: Ry+A49y0SbiXMF3PTgPQzQ== X-CSE-MsgGUID: NdkJlj00TDyp3irne0NdrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="39592500" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa010.fm.intel.com with ESMTP; 11 Jun 2024 11:42:47 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Paul Greenwalt , anthony.l.nguyen@intel.com, Michal Swiatkowski , Jesse Brandeburg , Pucha Himasekhar Reddy Subject: [PATCH net 3/4] ice: fix 200G link speed message log Date: Tue, 11 Jun 2024 11:42:37 -0700 Message-ID: <20240611184239.1518418-4-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> References: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Paul Greenwalt Commit 24407a01e57c ("ice: Add 200G speed/phy type use") added support for 200G PHY speeds, but did not include 200G link speed message support. As a result the driver incorrectly reports Unknown for 200G link speed. Fix this by adding 200G support to ice_print_link_msg(). Fixes: 24407a01e57c ("ice: Add 200G speed/phy type use") Reviewed-by: Michal Swiatkowski Signed-off-by: Paul Greenwalt Reviewed-by: Jesse Brandeburg Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 45d850514f4c..1766230abfff 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -805,6 +805,9 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup) } switch (vsi->port_info->phy.link_info.link_speed) { + case ICE_AQ_LINK_SPEED_200GB: + speed = "200 G"; + break; case ICE_AQ_LINK_SPEED_100GB: speed = "100 G"; break; From patchwork Tue Jun 11 18:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13694142 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 B2A567404F for ; Tue, 11 Jun 2024 18:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131371; cv=none; b=YevXHWj3xK9mOXnIzNNcT2E+5/O9OFKGcVaW2y2vNLAPXNLGQTjEh5jJrHcuDgvcyUpz9C6LxMqnIspRxZ7IqCKMWhbj7e0IN6PFSym7oCixtScL/c9rn4yNlWuyKwIZ7Y/PEdN3qj+ABOrSVt4qJyIGDjs8nK/HjFAZYGOkiio= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718131371; c=relaxed/simple; bh=Kzn4+5NYzf3vBoHKEY1YRsaK1lMRlsJAo/vlsKmp0SY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fnk1qL70q0NqeJL7BhSRNnQJE7+mBlrqe3fPVTyQhAlbups+lrCvWsNOWzZlkpNGBTs9lBeUKsm6utxzkjLLpM7RXHV56eS9U74tN64VIdtGt4/8Dhqe0V2KIhRH+e7kDG719wq1JfhkVhPOkqCM+vXCb/Fs4PZ5YLumOT4Sajc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KF6oNd9i; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KF6oNd9i" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718131370; x=1749667370; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Kzn4+5NYzf3vBoHKEY1YRsaK1lMRlsJAo/vlsKmp0SY=; b=KF6oNd9iSMaLTVC9iWQwJWbY6nxBczt69m3siW4EypKQS6gc56aGXhAB k0/U/mC45gvTqSdMq2xBveFvMUjZmViOBH7GTzrEepfKROHJpxzPM9g/T m51Jdj4Ejl734jxjKhX0dWmQzhGlWNp5dzMHSl0N74ZweNASJUGhjFsG/ aHnyixB9uup9BhY7qCU/+3Dy7AcGv6uoRHC7J2zoUJ/x7Huik3o9x4qTx MNN8SAHWIEP/m54XEMKAXpyfrQGg+zULh/Imc1PC2QBUgroMmDzBbI9/C rTbVtjPPMDESqJuw9fM06cAdD9poV0BFJREK7r18AlDQBp/hplz/SVjTa w==; X-CSE-ConnectionGUID: 3u1uh3MoT3Kfe30mjqKhIQ== X-CSE-MsgGUID: hB7tDy+JTQeg/sQaHozWCQ== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="12025555" X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="12025555" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 11:42:48 -0700 X-CSE-ConnectionGUID: Jg8LAJs8RQ6ZeM6Loq/H/g== X-CSE-MsgGUID: TEOL35M3Sg+UAYRrg9UuTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="39592507" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa010.fm.intel.com with ESMTP; 11 Jun 2024 11:42:48 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Wojciech Drewek , anthony.l.nguyen@intel.com, Michal Swiatkowski , Brett Creeley , Przemek Kitszel , Pucha Himasekhar Reddy Subject: [PATCH net 4/4] ice: implement AQ download pkg retry Date: Tue, 11 Jun 2024 11:42:38 -0700 Message-ID: <20240611184239.1518418-5-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> References: <20240611184239.1518418-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Wojciech Drewek ice_aqc_opc_download_pkg (0x0C40) AQ sporadically returns error due to FW issue. Fix this by retrying five times before moving to Safe Mode. Sleep for 20 ms before retrying. This was tested with the 4.40 firmware. Fixes: c76488109616 ("ice: Implement Dynamic Device Personalization (DDP) download") Reviewed-by: Michal Swiatkowski Signed-off-by: Wojciech Drewek Reviewed-by: Brett Creeley Reviewed-by: Przemek Kitszel Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_ddp.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.c b/drivers/net/ethernet/intel/ice/ice_ddp.c index ce5034ed2b24..f182179529b7 100644 --- a/drivers/net/ethernet/intel/ice/ice_ddp.c +++ b/drivers/net/ethernet/intel/ice/ice_ddp.c @@ -1339,6 +1339,7 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start, for (i = 0; i < count; i++) { bool last = false; + int try_cnt = 0; int status; bh = (struct ice_buf_hdr *)(bufs + start + i); @@ -1346,8 +1347,26 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start, if (indicate_last) last = ice_is_last_download_buffer(bh, i, count); - status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE, last, - &offset, &info, NULL); + while (1) { + status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE, + last, &offset, &info, + NULL); + if (hw->adminq.sq_last_status != ICE_AQ_RC_ENOSEC && + hw->adminq.sq_last_status != ICE_AQ_RC_EBADSIG) + break; + + try_cnt++; + + if (try_cnt == 5) + break; + + msleep(20); + } + + if (try_cnt) + dev_dbg(ice_hw_to_dev(hw), + "ice_aq_download_pkg number of retries: %d\n", + try_cnt); /* Save AQ status from download package */ if (status) {