From patchwork Thu Dec 12 23:33:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Vazquez X-Patchwork-Id: 13906119 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 034AC1DEFD2 for ; Thu, 12 Dec 2024 23:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734046443; cv=none; b=WYa0GJOeG4rMOFwyVYwHFRQmrfka9xV1KlhGFdapLsw3YZ5bauN+TuhcgDeBs+rQ8yk7sF+rs4JQQtNOdzZ4WDNmY9/zdUOhOXsf06ulhQs3sYxH0VvziVvf4CZ0rFm9GBon8JKFkt7cFBEeLaS+b1eNv3O/Mm7UBYBFoQB0UhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734046443; c=relaxed/simple; bh=HWXJI55Bbef5Ohuw0UPjmcWf0sUSE1PZpO0/NCDoUBg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=VtpnQhO7YxP2dFsvxBoMzwYQPkyub0MZu3CDqHlctttV/QpMvz3zTWyuAJhyRErFnAtCIEqH9qYAJs4Nu+g2PkMhAfie2/LHi1+rE05C2WbC3L/6eJ9qvm8xUYfvMsgvaYbXexPwyOkC2bPke8TlZcLxQiy2blXh8ZwCMw13aKQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--brianvv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=fMmpPUqs; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--brianvv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="fMmpPUqs" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-21650d4612eso15790345ad.2 for ; Thu, 12 Dec 2024 15:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734046441; x=1734651241; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=OMUA0aQKK7WEbAxFgPhIKVdu3gMaz4/z872qXRxIgaM=; b=fMmpPUqsTOUHwUtCBz143lBisKzKKk/4U3Cc1toyNcErvtCd/pfv6d/UjFEBO9DmIl cGKlvxNTRcWiqIIbRpfOsDcbQ+gpMGuzDznP8YhCcUYAHSIYgFjb3rP1RsHrXqysrPQP TW0PkCYTRSCVb8LteDUAH+ruHOXMTrqvrq0aqJeQKsTKJ/3+vlKQ0z+YAPzaK1FwpJxo Kyiq6tgdwZ2iPPVmiVIQU7AbbQtNRCAEbDZaBQ1D2hj+1kTk3Aj4eoNN+QxoWTeMuYNt 0UzJbD+poLFn8c/O+IKSxYaTFRmjYQW/7yACk6LXryckssiRQ6Y2PKw+jsy2KPWYIsMt Ha3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734046441; x=1734651241; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OMUA0aQKK7WEbAxFgPhIKVdu3gMaz4/z872qXRxIgaM=; b=f1QK9QsnmPya+E0S7+mDqXvSBlvv4VltvqKoRxUDtTYxD3gKgEA1ByfUCM59LgORD6 BPsY8Autuw4yA22nHIMKZPyRNQEoCWfVfXeapfsWod2qp2Sbx3e4Wz21N8VX08oBlrN7 WVKGOesQ4cp7oWnzxTewBLfkN6zkeWHgD1sFPdAL0BYq4JBhqL2GqWjYzXDzVmNEwPcm cHSDunzDTMu8mHp9u3qgn6DLeBuSQkfwB3V1rhEVp1zyTBBLboHjej9y1a+q5/oiu+KX VExRkSxBtJqqp6thIpNQ1BZmIVw85AhZ8jj/GzhmvDPzCQ+Z6M02jwgdsaPvJf6MYuKd sWoA== X-Forwarded-Encrypted: i=1; AJvYcCWkgXTygOYmpW7D6B386u0FaIzAh522ocWbsvWF2vlmTPJFsKr9OvlGIcxz/lMkqMUjH28SuLo=@vger.kernel.org X-Gm-Message-State: AOJu0YwjumWI17rGlH48zZPy38qeUo+P1zs//wq0nB3OBjw1V8Lu+Ate QHeWE4NKpU6mGiyXALVka5IOfrNBv4tZl6p1Wz0Avbopehu0IDfxBZ+zqxqwRPlaqxu5JsyHBtK ZFiPH0g== X-Google-Smtp-Source: AGHT+IE6+YFyK2dOzazpuXzKcJ5JcNJCjFmXnz48CKNFl7+T+IEVuHoS2q1LN0WlazSasZY8hBgWv75KCl4D X-Received: from pgbds10.prod.google.com ([2002:a05:6a02:430a:b0:7fd:483d:9d10]) (user=brianvv job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:cf0a:b0:216:56c7:98a7 with SMTP id d9443c01a7336-21892a53c03mr9937645ad.53.1734046441368; Thu, 12 Dec 2024 15:34:01 -0800 (PST) Date: Thu, 12 Dec 2024 23:33:31 +0000 In-Reply-To: <20241212233333.3743239-1-brianvv@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241212233333.3743239-1-brianvv@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241212233333.3743239-2-brianvv@google.com> Subject: [iwl-next PATCH v3 1/3] idpf: Acquire the lock before accessing the xn->salt From: Brian Vazquez To: Brian Vazquez , Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org Cc: David Decotigny , Vivek Kumar , Anjali Singhai , Sridhar Samudrala , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, emil.s.tantilov@intel.com, Manoj Vishwanathan , Brian Vazquez , Jacob Keller , Pavan Kumar Linga X-Patchwork-Delegate: kuba@kernel.org From: Manoj Vishwanathan The transaction salt was being accessed before acquiring the idpf_vc_xn_lock when idpf has to forward the virtchnl reply. Fixes: 34c21fa894a1 ("idpf: implement virtchnl transaction manager") Signed-off-by: Manoj Vishwanathan Signed-off-by: David Decotigny Signed-off-by: Brian Vazquez Reviewed-by: Jacob Keller Reviewed-by: Pavan Kumar Linga --- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index d46c95f91b0d..13274544f7f4 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -612,14 +612,15 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter, return -EINVAL; } xn = &adapter->vcxn_mngr->ring[xn_idx]; + idpf_vc_xn_lock(xn); salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info); if (xn->salt != salt) { dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n", xn->salt, salt); + idpf_vc_xn_unlock(xn); return -EINVAL; } - idpf_vc_xn_lock(xn); switch (xn->state) { case IDPF_VC_XN_WAITING: /* success */ From patchwork Thu Dec 12 23:33:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Vazquez X-Patchwork-Id: 13906120 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40E721DEFD2 for ; Thu, 12 Dec 2024 23:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734046446; cv=none; b=r/yzmb5IQr13zBjiiAMYuPNPqjTLXVcLgzsZX1TWHNIDCqtPg7CMd4aPLtYpmkSNgwYanoW3JVBGBiBWAQXfYIBTWEX7xmw6qTuSenGJFvhYk1rd4QxrESZt4mVRnW8HIlFhb2K4TvdV+2gdI35jnYxo/OiU85nRJPs1WDu4FT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734046446; c=relaxed/simple; bh=Duaisv63OuGEXKabu1B70YdNEWCFhEY6uZDg/YUCXJM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I8hDjKAkJz4Dyd3nOoAIFhFd0PCd7GVT++Vxfx8zCDnG9IG4gxKWJmGGLzkg2dj874vPOe8XJqxzk5IFLiiDQ/WFtyNTOKkNCiqecYlaAMFb0XJ+f3Fj6lfmzuWI3P7MRMj5ggEAnSc07/3k9WXTMpRt3c7+rd8d6GbcULz3tYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--brianvv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=R54ls08+; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--brianvv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="R54ls08+" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-7ea69eeb659so789832a12.0 for ; Thu, 12 Dec 2024 15:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734046444; x=1734651244; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=gW4H2/TOHS2zfDTwC9BxNBGpe/B9ZolBHNbHz0o02es=; b=R54ls08+Dwky3/b2gCh56a+rkP/2RSJPYDVXji1CnnVHD8/ry8Ls1lFjPW+CrUFcce rPHuujo83SpIp9oGGdNz+HPVsKXPWJozRyYe8ZgD7yRIc7VQCm3EnfAG+XOY9e4HeKys ZoQ0AJLomBvGduZx5PRJvkk0sdpXJPpBCcjZ94an8+gqnwn3IzlueveZPgmqdHBNNMlO MI066YqCdOOu/y5KtcMao16CmipUi/S/IesnGof3+pn3aHavWUTpasOJpuSv7rpljkgf p96SvNrAMDqJ2kejSltrn3+S/iHW+kRcyvgvySYnphkkgOPLsmjaEJyo5Vj5Fd8ypm9V 9kmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734046444; x=1734651244; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gW4H2/TOHS2zfDTwC9BxNBGpe/B9ZolBHNbHz0o02es=; b=hj9Nf8V8e8kDFA+9Ik4iPNeB4WpYfUkrKAA8s9t+z7XJnba/2WYaCRBznL8W7DvqJa 5ATK7zb7smStqKQb1Pw9V8f34xmhVIMVTSSudwKvN1PyoF2kwkX1DYcwEcpvRCheq4Ph +UolBMgVFEaljCxr4PKGxlr0FKfuZ4OT8SkQh3sqncjlk+fXxXChgpxcHMy0Cj9CEWZG ypJA4ML5mpLTx5ZdNm6+QUE+HthefJ/ZmrBM88J/CnK1SWtDSMTCLg2qS9lqSTFUEn1P cK6CsrAu4ffbhn5lGmfb2HAZHcFOJATYPI2eEaZMIv/FjX7UFWodC7COIqdUj1pNiTUu TkzA== X-Forwarded-Encrypted: i=1; AJvYcCU8GgIWncuaCAySr5O3RwNayhPuFtBue9++gTq7IGyMJvgR9b8MV2hb+Lyiyks0fEv0nRx/xzU=@vger.kernel.org X-Gm-Message-State: AOJu0YxvOCLJBYVFh3kF1NnhEQI/Kc1xmUNxpxNNW8oiXY+7Y8o4Eo3u qFXeKd3s44EJknvVQ/HFlHGuKMfDit7Jfo5mV1ghr2mABRLijEsr8eaniOh6s/RIFbgn58Sntps tAezGag== X-Google-Smtp-Source: AGHT+IHU8mSWUn2mLx+n7J9NPzZpWnWI7NTiMfpqSFskCF7VTr1LGMNcspFpdCFJLMvJCyEp1oQx/n1+r+p4 X-Received: from pjuj8.prod.google.com ([2002:a17:90a:d008:b0:2e0:aba3:662a]) (user=brianvv job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4ac1:b0:2ee:8430:b831 with SMTP id 98e67ed59e1d1-2f28fa50f7fmr901600a91.2.1734046444500; Thu, 12 Dec 2024 15:34:04 -0800 (PST) Date: Thu, 12 Dec 2024 23:33:32 +0000 In-Reply-To: <20241212233333.3743239-1-brianvv@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241212233333.3743239-1-brianvv@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241212233333.3743239-3-brianvv@google.com> Subject: [iwl-next PATCH v3 2/3] idpf: convert workqueues to unbound From: Brian Vazquez To: Brian Vazquez , Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org Cc: David Decotigny , Vivek Kumar , Anjali Singhai , Sridhar Samudrala , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, emil.s.tantilov@intel.com, Marco Leogrande , Manoj Vishwanathan , Brian Vazquez , Jacob Keller , Pavan Kumar Linga X-Patchwork-Delegate: kuba@kernel.org From: Marco Leogrande When a workqueue is created with `WQ_UNBOUND`, its work items are served by special worker-pools, whose host workers are not bound to any specific CPU. In the default configuration (i.e. when `queue_delayed_work` and friends do not specify which CPU to run the work item on), `WQ_UNBOUND` allows the work item to be executed on any CPU in the same node of the CPU it was enqueued on. While this solution potentially sacrifices locality, it avoids contention with other processes that might dominate the CPU time of the processor the work item was scheduled on. This is not just a theoretical problem: in a particular scenario misconfigured process was hogging most of the time from CPU0, leaving less than 0.5% of its CPU time to the kworker. The IDPF workqueues that were using the kworker on CPU0 suffered large completion delays as a result, causing performance degradation, timeouts and eventual system crash. Tested: * I have also run a manual test to gauge the performance improvement. The test consists of an antagonist process (`./stress --cpu 2`) consuming as much of CPU 0 as possible. This process is run under `taskset 01` to bind it to CPU0, and its priority is changed with `chrt -pQ 9900 10000 ${pid}` and `renice -n -20 ${pid}` after start. Then, the IDPF driver is forced to prefer CPU0 by editing all calls to `queue_delayed_work`, `mod_delayed_work`, etc... to use CPU 0. Finally, `ktraces` for the workqueue events are collected. Without the current patch, the antagonist process can force arbitrary delays between `workqueue_queue_work` and `workqueue_execute_start`, that in my tests were as high as `30ms`. With the current patch applied, the workqueue can be migrated to another unloaded CPU in the same node, and, keeping everything else equal, the maximum delay I could see was `6us`. Fixes: 0fe45467a104 ("idpf: add create vport and netdev configuration") Signed-off-by: Marco Leogrande Signed-off-by: Manoj Vishwanathan Signed-off-by: Brian Vazquez Reviewed-by: Jacob Keller Reviewed-by: Pavan Kumar Linga --- drivers/net/ethernet/intel/idpf/idpf_main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c index 305958c4c230..da1e3525719f 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_main.c +++ b/drivers/net/ethernet/intel/idpf/idpf_main.c @@ -198,7 +198,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_master(pdev); pci_set_drvdata(pdev, adapter); - adapter->init_wq = alloc_workqueue("%s-%s-init", 0, 0, + adapter->init_wq = alloc_workqueue("%s-%s-init", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->init_wq) { @@ -207,7 +208,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_free; } - adapter->serv_wq = alloc_workqueue("%s-%s-service", 0, 0, + adapter->serv_wq = alloc_workqueue("%s-%s-service", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->serv_wq) { @@ -216,7 +218,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_serv_wq_alloc; } - adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", 0, 0, + adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->mbx_wq) { @@ -225,7 +228,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_mbx_wq_alloc; } - adapter->stats_wq = alloc_workqueue("%s-%s-stats", 0, 0, + adapter->stats_wq = alloc_workqueue("%s-%s-stats", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->stats_wq) { @@ -234,7 +238,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_stats_wq_alloc; } - adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", 0, 0, + adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->vc_event_wq) { From patchwork Thu Dec 12 23:33:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Vazquez X-Patchwork-Id: 13906121 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3752E1DF27B for ; Thu, 12 Dec 2024 23:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734046450; cv=none; b=j9dLe+KP5OetTGZe+7jHVyrX3QjxC8NKLSjJE3JIIRTHM8kSyt0td3lLZ/13xog3JYN6QtHkSgF1i5kUmX+SoA7cJhcE+XM++cTJeUHf6fUE5ZbaWYBg/Cmw2EP6CpzNF7jOuGo/XUP1GOXyJSypsbkYu4sLmNR0iy4SHsKqEIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734046450; c=relaxed/simple; bh=AoRYYxuyz7m5d82P6sXHJGPnueytngGYQ+K6deJQYew=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=eFXy0G/YLkoCU95NsdRDyfz67Z9Xyk1ihr0zX3JwObTzU7HjacoQa39xxKThk05QEPeY6PekVPupW4EIdMl3zxX4F9HhGwSmax9hw6v2qh06QcF9T9Q0+Mj4LDKjo16g4j6+qamUM/b7ivOJht1nx+vjj1z13xwJfWn1Mg+7oLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--brianvv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tGxAbfoT; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--brianvv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tGxAbfoT" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ef9204f898so1018180a91.2 for ; Thu, 12 Dec 2024 15:34:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734046448; x=1734651248; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=lVwHov0X10aPJDd/Xn/qoYct9Gn29vQtlHXe3AbUYiU=; b=tGxAbfoTjvERxPb/BpR68l8OIQO6kFlhcYZAZIPBXb7XUTF6EVV7+9B+yy3iKdq8vk B2HkaSoyx31ylSlVYxF/cnKG4TEsCKEEsnNc76tu0PYvFkSrfrIX/It5cSgAOen8W78A mfZRFgGatzCik4D3SxxUp7alsXTNj57hbfb8HDRPU62JgEE89oW46H1qXEw2S/SHjwjN nWe56WU3fK0W1PZ2rbe/wqg4ef2QRZzoOr6R5civjbGjU+KWYnLY/qeJuPALalSTJhU9 rhtwueYhlQPSUhGcDovDNKCM6aIzkPJnRpEk4XL8ROZo3cHljMQFC0p2eG+Q5f7As/t6 Gqbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734046448; x=1734651248; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lVwHov0X10aPJDd/Xn/qoYct9Gn29vQtlHXe3AbUYiU=; b=YhH9EjQ0hGH5m8TY+YJC8ctGIE/DS238tmOe8l9pCVKiRJIVWkkmOAtfcS8XDj/RL7 PezfaH9M4AKmWc7KAT5/5VgrGfSqMZF5AMdM2bS39Htzg461gIo38ubvOn8sAA8BNxYo ZWkyY6OZWJoSUNu5MBprSaVo/pV2XJ6FX0K6+T0bp0zMuGFsN9FPjGQBg7UG0Ljh3Ehb SWEQu4+tg2xkgn1DVFOU/2PsCVy1xTkajzLOCKlP+Nm0J6ltf2TKBvU8jemLa8imJmQ4 vGnJ/GHanPjXrNGvLGzlVxN+O+3NH7+PyCfEvVOFTJS+a7MpMXnE2rz9OWPpZIyoiySo 9KEw== X-Forwarded-Encrypted: i=1; AJvYcCVY1OAjhAuyio3dkhb/aTCVTLqN1Xx9C6S8uTJOBVFgN61pe0zU8wfz8cP5YyHIweXo11az4Ns=@vger.kernel.org X-Gm-Message-State: AOJu0YxgJYQsKOo/JECTArKPIZgva+jZdlC9g3KLMO/w/rl7yCDe19n1 TYPwExkT9XyqyJ0A0/5lgR3WjL7eYSO5buJglGt5f2q/3RKF/HvQJ7cdd81IG2CakoEhZEITB9b oy+HoIw== X-Google-Smtp-Source: AGHT+IGe7FiBmEImdX0XEsLZOBwrOk+VTTkGoZbu8+xZqBSfxUA2PcZQtkQcbVVi3V7YTKio7yX0EY8giLOl X-Received: from pji5.prod.google.com ([2002:a17:90b:3fc5:b0:2ea:4139:e72d]) (user=brianvv job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:53d0:b0:2ea:a9ac:eee1 with SMTP id 98e67ed59e1d1-2f28fb5fd68mr962924a91.10.1734046448532; Thu, 12 Dec 2024 15:34:08 -0800 (PST) Date: Thu, 12 Dec 2024 23:33:33 +0000 In-Reply-To: <20241212233333.3743239-1-brianvv@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241212233333.3743239-1-brianvv@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241212233333.3743239-4-brianvv@google.com> Subject: [iwl-next PATCH v3 3/3] idpf: add more info during virtchnl transaction time out From: Brian Vazquez To: Brian Vazquez , Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org Cc: David Decotigny , Vivek Kumar , Anjali Singhai , Sridhar Samudrala , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, emil.s.tantilov@intel.com, Manoj Vishwanathan , Brian Vazquez , Jacob Keller , Pavan Kumar Linga X-Patchwork-Delegate: kuba@kernel.org From: Manoj Vishwanathan Add more information related to the transaction like cookie, vc_op, salt when transaction times out and include similar information when transaction salt does not match. Info output for transaction timeout: ------------------- (op:5015 cookie:45fe vc_op:5015 salt:45 timeout:60000ms) ------------------- Signed-off-by: Manoj Vishwanathan Signed-off-by: Brian Vazquez Reviewed-by: Jacob Keller Reviewed-by: Pavan Kumar Linga Reviewed-by: Paul Menzel --- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index 13274544f7f4..c7d82f142f4e 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -517,8 +516,10 @@ static ssize_t idpf_vc_xn_exec(struct idpf_adapter *adapter, retval = -ENXIO; goto only_unlock; case IDPF_VC_XN_WAITING: - dev_notice_ratelimited(&adapter->pdev->dev, "Transaction timed-out (op %d, %dms)\n", - params->vc_op, params->timeout_ms); + dev_notice_ratelimited(&adapter->pdev->dev, + "Transaction timed-out (op:%d cookie:%04x vc_op:%d salt:%02x timeout:%dms)\n", + params->vc_op, cookie, xn->vc_op, + xn->salt, params->timeout_ms); retval = -ETIME; break; case IDPF_VC_XN_COMPLETED_SUCCESS: @@ -615,8 +613,9 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter, idpf_vc_xn_lock(xn); salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info); if (xn->salt != salt) { - dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n", - xn->salt, salt); + dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (exp:%d@%02x(%d) != got:%d@%02x)\n", + xn->vc_op, xn->salt, xn->state, + ctlq_msg->cookie.mbx.chnl_opcode, salt); idpf_vc_xn_unlock(xn); return -EINVAL; }