From patchwork Sat Nov 25 16:34:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Subbaraya Sundeep X-Patchwork-Id: 169753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2040572vqx; Sat, 25 Nov 2023 08:35:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVaGimVIWl+QIn7TKP2o+FFAqtfBYDO0QaUoy5N94fXVbRqt03eml7mjj3jBdvY9/notI9 X-Received: by 2002:a17:90b:1803:b0:283:2932:e904 with SMTP id lw3-20020a17090b180300b002832932e904mr6415575pjb.2.1700930136854; Sat, 25 Nov 2023 08:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700930136; cv=none; d=google.com; s=arc-20160816; b=xjVfNqySJr4EbXKmvF4hlOssRyPwqejoeJtaz3vIru5Mc/TCfvjYgin12S90H21fAR hxv4NRhC09oBntNDGApFwvqybc+dp8qCl+tPENO4i8vK3pQ3mzPIb6SLmiOpX2WdPaIE Gv2jxh+6MaA7v7y1yIdQT4V7NE4Hxll5y8UVR/Htnqo0I7y33HQjOoDise2OjYnBJio4 FTtXWA5JUqPlUUp5h6Jf56fatPRJ9fMsNx6XGLWJg+dbM1JnKSGPQ1NTwWVj29TDxZV0 VCcdKnfa3rHjEydxwQhjuGI7Up4mx9Ty/T4jy+SoY9C4jCn/99/+kCSBSJsTBNNpMBEK 56Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=TEkupid8sBlLpSL/3VjNIN1K1+OhyKNF+UyoG9pF3cc=; fh=XH5TQEuSqvRK8iWR7cgl1LZixvfhe5JTwhFT61cZd0M=; b=I6H9GRvfmqJMqJkt+5ks1zLAAUyH3/cZNNZA7MMdQZKGeDjDS/Hzj1dIkbA7iKTqK6 dFwsGtUDQlLDe47SJe/o9F8uDaiePkbp3TZd+L5XhGv6xm5UX6npqlkxMawwcKoPCCbt KYpjTETjqHcLMRCaZvQCrM1doOrsWDSqythFQASmpKmJsSmejTf9h7ZndMmiegMjukv0 HhSm9SUswrl6JiCIunr3iuQEDkdQ/aiKPVnzhzPeQPzSw/49MpZpA0Ge0oXAOr5pa7fg eGWnlqF1+UBNeJzrqBgqiaStZCGaChVghgZCxwfUpxyv3u+BJrvhwzZvo2b06U5HqWtk bnfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=jisgnSV1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id t3-20020a17090ae50300b002802d12083fsi5989839pjy.54.2023.11.25.08.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 08:35:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=jisgnSV1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 94184803E9E6; Sat, 25 Nov 2023 08:35:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232385AbjKYQfL (ORCPT + 99 others); Sat, 25 Nov 2023 11:35:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232440AbjKYQek (ORCPT ); Sat, 25 Nov 2023 11:34:40 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C9B1A6; Sat, 25 Nov 2023 08:34:27 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3APGUF86003778; Sat, 25 Nov 2023 08:34:16 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=TEkupid8sBlLpSL/3VjNIN1K1+OhyKNF+UyoG9pF3cc=; b=jisgnSV1dx2kCVFd0y+QYuj+MWrEqT+Xho0eLKpQn6i+eDFgtnF4q9fMV7iIjkX1S3ln gbmZKrK2bVCsjUgrFw9iO8jYqNtWtU4wzQgKfjT5YUjDiwooWfC7L+/XITz145LE0vnk vUexBCoy42Vr9Vx8gL7dH0INxEdxcbftAXnztkFWL/bD22lZzxU7LeSPMpK7zR0EHqXb PaafgWObufiVlw/s543M8aYz+H9KG0Lh+3wKSwpEvvK6EUfVc3z7beFsl7Z95t52Dcu2 7EeCsKeCtgz6SEMOplapxGez49+7Jqlz7/VqKNsIgH1UD6r4bDSyX+clH5sv/JdKg3zP ug== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ukhauga5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 25 Nov 2023 08:34:16 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 25 Nov 2023 08:34:14 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sat, 25 Nov 2023 08:34:14 -0800 Received: from hyd1358.marvell.com (unknown [10.29.37.11]) by maili.marvell.com (Postfix) with ESMTP id 265325C68EA; Sat, 25 Nov 2023 08:34:10 -0800 (PST) From: Subbaraya Sundeep To: , CC: , , , , , , , Subbaraya Sundeep Subject: [PATCH net] octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 Date: Sat, 25 Nov 2023 22:04:02 +0530 Message-ID: <1700930042-5400-1-git-send-email-sbhatta@marvell.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: hfRqkjpy2dM6dk8JfR1WPjA2bU5zDA_a X-Proofpoint-GUID: hfRqkjpy2dM6dk8JfR1WPjA2bU5zDA_a X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-25_16,2023-11-22_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 25 Nov 2023 08:35:30 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783554518901872306 X-GMAIL-MSGID: 1783554518901872306 From: Geetha sowjanya When more than 64 VFs are enabled for a PF then mbox communication between VF and PF is not working as mbox work queueing for few VFs are skipped due to wrong calculation of VF numbers. Fixes: d424b6c02415 ("octeontx2-pf: Enable SRIOV and added VF mbox handling") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index ba95ac9..6d56fc1 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -566,7 +566,9 @@ static irqreturn_t otx2_pfvf_mbox_intr_handler(int irq, void *pf_irq) otx2_write64(pf, RVU_PF_VFPF_MBOX_INTX(1), intr); otx2_queue_work(mbox, pf->mbox_pfvf_wq, 64, vfs, intr, TYPE_PFVF); - vfs -= 64; + if (intr) + trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr); + vfs = 64; } intr = otx2_read64(pf, RVU_PF_VFPF_MBOX_INTX(0)); @@ -574,7 +576,8 @@ static irqreturn_t otx2_pfvf_mbox_intr_handler(int irq, void *pf_irq) otx2_queue_work(mbox, pf->mbox_pfvf_wq, 0, vfs, intr, TYPE_PFVF); - trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr); + if (intr) + trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr); return IRQ_HANDLED; }