From patchwork Wed May 3 07:09:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89583 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1131196vqo; Wed, 3 May 2023 00:12:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63keYJK1zh42dJOZ5vOvgpo/4UyQuK18h+VpjgCPkXrgzp0umNpdVcPHDhNBgz9gERWdlK X-Received: by 2002:a17:902:b787:b0:1a9:c07f:93f4 with SMTP id e7-20020a170902b78700b001a9c07f93f4mr1266695pls.55.1683097963616; Wed, 03 May 2023 00:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683097963; cv=none; d=google.com; s=arc-20160816; b=FFtfnYXIvxzccZAgJGYyt0dZxLdtTtxQnBDxDU3TlGfgNd9jFjMBNm2W9HSzyDITCj YMedEKZooq5zVcx7vwpqsfwArpUSfAb0jLRFe+TRBMKYcyj8PZ+Q0JIhdUM85DB8sDj5 9DfdQyaFhZb9P6b7NgiWVep72GgxId0lBOUNzFT62cfFcIZbOWT6Ao1SJvhe36X10p0B ReVhUSKwikzVDyjtU7Gw6n5YHf/eVZdVeJTc7pboTheDM5aXxXlx1Osd3VPSdISnkCLn 1xbXgtRVPnuWMfIkESp/PNbka0p4qu9UVvUOYLosZMLDb99NxLsaKe0KLiyGsgMtb6Ck Kmhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jw7FfDLMGTKpgSF5ca1sdut6Rpkx65gv2wVX/lQRlLQ=; b=jwngCKLyfQq89NG478arzm19GUuaLC+FKgplW29qMiiaSeAJ3pqaLXeAJ/y80J2aJc b0t2hrNgAMSaoABLXm03b4jVBH4xU7ndmUI+dT+7z4XArMtzepkOvIbN1cYHUH0WR4ax r4KdP5+arBglEcCkgC0duq4IfSkZyRZ/ZWUNaxeHy40bqwb2AzCV7/+bIC/pPd7ec2p6 sXvOsvEkAiHVMXiT7F2q+LCICw1X+j/EYXaFy06ezLYkMP1u10C+eVotvGZOM7M6I6TW 7gcNC0ubL/ThfjOetnmnIii32GFehI6WppTir+sT8eVHoYm21LNW+RMRTwLQE+KB5aMw vPlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=c7uFZC9e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju20-20020a170903429400b001aaf3ac2fe3si6557842plb.177.2023.05.03.00.12.27; Wed, 03 May 2023 00:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=c7uFZC9e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbjECHK0 (ORCPT + 99 others); Wed, 3 May 2023 03:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjECHKV (ORCPT ); Wed, 3 May 2023 03:10:21 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF1340FD; Wed, 3 May 2023 00:10:15 -0700 (PDT) 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 34369xss003337; Wed, 3 May 2023 00:10:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=jw7FfDLMGTKpgSF5ca1sdut6Rpkx65gv2wVX/lQRlLQ=; b=c7uFZC9ejNA8rmTM8RFX3PhIwYPS0Sru1ymFJmHttqwGrpJ2PjU04hCFWn/Kk+La4CbN w7MgtWvuq8l+NCtJaFKS3ZXs03Oe6FwxvU1sfP7MdDzo/FvBgjrgT9JYp8cKyZhikTo3 Xj+7lte1GHQH/vSbKdCDaEbyVpcX5LEm/qgPHHaJjFlPDkTF4k44oFvEKxrcQs5H4aBT tgC26KlYxzjK/o2bz26W2hvggp7USS5Cw4hP02SVv27Xjumltd3qxjU8JmlzV2PwWo3O 8X0orTwR6pd6AcSfVH3h+iW49ReyrmC8WSdGJhNDhq0qII0BV2Aly/uls+swu4mxHyXi mA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m6s-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:09:59 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:09:56 -0700 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; Wed, 3 May 2023 00:09:55 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id C67A73F707B; Wed, 3 May 2023 00:09:51 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Sai Krishna Subject: [net PATCH v5 01/11] octeontx2-af: Secure APR table update with the lock Date: Wed, 3 May 2023 12:39:34 +0530 Message-ID: <20230503070944.960190-2-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: D_1w4CZRsf0yk7a9uvP9KixEeLBlDBtm X-Proofpoint-GUID: D_1w4CZRsf0yk7a9uvP9KixEeLBlDBtm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856130265198559?= X-GMAIL-MSGID: =?utf-8?q?1764856130265198559?= From: Geetha sowjanya APR table contains the lmtst base address of PF/VFs. These entries are updated by the PF/VF during the device probe. The lmtst address is fetched from HW using "TXN_REQ" and "ADDR_RSP_STS" registers. The lock tries to protect these registers from getting overwritten when multiple PFs invokes rvu_get_lmtaddr() simultaneously. For example, if PF1 submit the request and got permitted before it reads the response and PF2 got scheduled submit the request then the response of PF1 is overwritten by the PF2 response. Fixes: 893ae97214c3 ("octeontx2-af: cn10k: Support configurable LMTST regions") Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman --- .../net/ethernet/marvell/octeontx2/af/rvu_cn10k.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cn10k.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cn10k.c index 4ad9ff025c96..0e74c5a2231e 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cn10k.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cn10k.c @@ -60,13 +60,14 @@ static int rvu_get_lmtaddr(struct rvu *rvu, u16 pcifunc, u64 iova, u64 *lmt_addr) { u64 pa, val, pf; - int err; + int err = 0; if (!iova) { dev_err(rvu->dev, "%s Requested Null address for transulation\n", __func__); return -EINVAL; } + mutex_lock(&rvu->rsrc_lock); rvu_write64(rvu, BLKADDR_RVUM, RVU_AF_SMMU_ADDR_REQ, iova); pf = rvu_get_pf(pcifunc) & 0x1F; val = BIT_ULL(63) | BIT_ULL(14) | BIT_ULL(13) | pf << 8 | @@ -76,12 +77,13 @@ static int rvu_get_lmtaddr(struct rvu *rvu, u16 pcifunc, err = rvu_poll_reg(rvu, BLKADDR_RVUM, RVU_AF_SMMU_ADDR_RSP_STS, BIT_ULL(0), false); if (err) { dev_err(rvu->dev, "%s LMTLINE iova transulation failed\n", __func__); - return err; + goto exit; } val = rvu_read64(rvu, BLKADDR_RVUM, RVU_AF_SMMU_ADDR_RSP_STS); if (val & ~0x1ULL) { dev_err(rvu->dev, "%s LMTLINE iova transulation failed err:%llx\n", __func__, val); - return -EIO; + err = -EIO; + goto exit; } /* PA[51:12] = RVU_AF_SMMU_TLN_FLIT0[57:18] * PA[11:0] = IOVA[11:0] @@ -89,8 +91,9 @@ static int rvu_get_lmtaddr(struct rvu *rvu, u16 pcifunc, pa = rvu_read64(rvu, BLKADDR_RVUM, RVU_AF_SMMU_TLN_FLIT0) >> 18; pa &= GENMASK_ULL(39, 0); *lmt_addr = (pa << 12) | (iova & 0xFFF); - - return 0; +exit: + mutex_unlock(&rvu->rsrc_lock); + return err; } static int rvu_update_lmtaddr(struct rvu *rvu, u16 pcifunc, u64 lmt_addr) From patchwork Wed May 3 07:09:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1132748vqo; Wed, 3 May 2023 00:16:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bNDsXUTJQCuhpEXAOEQwmLXqSApFjprXHnrC08Nw6sYf3EoobRfMBLqruerFNipVoEt/T X-Received: by 2002:a05:6a20:7d9b:b0:f8:5cc:d869 with SMTP id v27-20020a056a207d9b00b000f805ccd869mr25063521pzj.35.1683098171190; Wed, 03 May 2023 00:16:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098171; cv=none; d=google.com; s=arc-20160816; b=q8no7t3jwRuLHk5V5CLtfeJXW9DdIGjvkmQTHY1XVL6yXceH2wQCxhtpYKbR8zJ+kp xdEXj1zxkBI/p2ZqEgwjUy05FUIzVYKR2la5B79PGfZj5yRE1ZqMeS7vFswYkEg9+QSE yHb3+n/DTWNhYKgjToqlO0TDVn04smHrlddMRHFIneaSU7mo/7pjD6FM3yOFPP6YoLCK kYDfqHlzp5Qs2NdSiwS59GLI6NNhLY/McuTw9YndPoARwTUvuVOx/k8Ce3cEcPz8YVmN JN5x218mjXjzG+E7833tXeeddWfsGAQx9SL+A4Si86zC6mqAUsX8+knm8tLZjZ44btuo qLDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z6k/sUirye6gC9Hi9CvYYgb4LzEDa09KdOIf49LemB4=; b=pbDSPVP+Z83JNzD4VwqVZd9ZJUMPjaVUfYsKW5johXfV90iSWcYDTr6/aCwSsG/Ybo 5E9hXrtrRDQPGfumksOqYlqUL8sZCKDMQQ90rb+N7VXiV658/2uNIy8EByBbcbmXILDr 8wv07Yz2vtJ/on+C3dmC7/sB2ZeD7eohVD63L8cQmwzCXeyGEpTPy/CbZsPn4W9r39A9 7CpKl2ZsRJqQkwYgN2JsSBK0cFISyKlcaArFGIN4PnaME7PEqT3cphcZENpc4jgKsqKl zOIhDOIVBANWPS00+ZpzBlwFE9RXdKaU6XvjdVWeYhIWDLogPmCNm/j1IflBb+Ul3/X6 /WbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="iEBZW0B/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a63f742000000b005073e333addsi32431037pgk.390.2023.05.03.00.15.57; Wed, 03 May 2023 00:16:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="iEBZW0B/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229678AbjECHKV (ORCPT + 99 others); Wed, 3 May 2023 03:10:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbjECHKU (ORCPT ); Wed, 3 May 2023 03:10:20 -0400 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13B9335B0; Wed, 3 May 2023 00:10:13 -0700 (PDT) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 342KDRwE026291; Wed, 3 May 2023 00:10:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=z6k/sUirye6gC9Hi9CvYYgb4LzEDa09KdOIf49LemB4=; b=iEBZW0B/QlAJyoejwYz1F+cHS1+qnJwdGSscQJ8k2BDk3SoRSA7BZYWfDR2uKK7f7lVY 38nR3m0rgWaUXrdDDcfqF23qJgZ3t4j9Ph9gQpcLz14D+mNSnrmdl0pW3YD9h6UDifHP 0Akib0t0Zze0wbROB1SvdkMGlIhekcIMI7RmBiCFX/nWxyGgspFu0ji41qFdYsIwWlxv cKtsO/GYcvS375bB9g8h0CGQ59gngyF6q9KxpXqQ8lVH6VsS4uWxGUppv1nebzbKhwGL GGnROSYLuUHhzp+Axba3CCWmw2Ae2Wa1pfcOBOlk6rvVTgatBnWLYN5jvWuoIneIWp4p Kg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qavhenavq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:02 -0700 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; Wed, 3 May 2023 00:10:01 -0700 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; Wed, 3 May 2023 00:10:00 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 76EF03F70B4; Wed, 3 May 2023 00:09:56 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Ratheesh Kannoth , Sai Krishna Subject: [net PATCH v5 02/11] octeontx2-af: Fix start and end bit for scan config Date: Wed, 3 May 2023 12:39:35 +0530 Message-ID: <20230503070944.960190-3-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: prle1tTwbR5vhXbDGIg_2V0wX2lVIYv5 X-Proofpoint-GUID: prle1tTwbR5vhXbDGIg_2V0wX2lVIYv5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856347785621234?= X-GMAIL-MSGID: =?utf-8?q?1764856347785621234?= From: Ratheesh Kannoth In the current driver, NPC exact match feature was not getting enabled as configured bit was not read properly. for_each_set_bit_from() need end bit as one bit post position in the bit map to read NPC exact nibble enable bits properly. This patch fixes the same. Fixes: b747923afff8 ("octeontx2-af: Exact match support") Signed-off-by: Ratheesh Kannoth Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c index 006beb5cf98d..f15efd41972e 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c @@ -594,8 +594,7 @@ static int npc_scan_kex(struct rvu *rvu, int blkaddr, u8 intf) */ masked_cfg = cfg & NPC_EXACT_NIBBLE; bitnr = NPC_EXACT_NIBBLE_START; - for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, - NPC_EXACT_NIBBLE_START) { + for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, NPC_EXACT_NIBBLE_END + 1) { npc_scan_exact_result(mcam, bitnr, key_nibble, intf); key_nibble++; } From patchwork Wed May 3 07:09:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89587 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1134490vqo; Wed, 3 May 2023 00:20:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iWKN7FRUvQtsluq6Dcnz7yQyxrPlIO7hfTR/JFWZIfmDo8Sn9iXS8I+a91bYkNLZGsVBb X-Received: by 2002:a17:90b:4c43:b0:247:6c32:37e5 with SMTP id np3-20020a17090b4c4300b002476c3237e5mr21144666pjb.13.1683098426062; Wed, 03 May 2023 00:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098426; cv=none; d=google.com; s=arc-20160816; b=oglAQGSq1ZJ6rxWwClK0Jybp4wLF5/t76CEBjr9vSmA8GuKtcZSst3qGZCM1LfuDkH kDk8avN/6S2zo7R40wEP5JRNGY3iUd+AfVItGDxJchuox28jATvmF92bOVc6z1UJHAEL 9f2vtg5UMZYJupGWJWDAkz1UDVdfPdW6r3uMlIrU1nkKP0jPPm6BlyN0cKcSEbJyAU6E fcAcaxhhcXU/yhSu1PPb5aXsthQxJr18afBvOu2aLUe1SUz3Rm6mSVpsUvfk5pF5/ic/ ZfUCG64Q1OvGyfYMeDU2Drt3qGlcatMeTKTxdjNEs4lAoaZn1SM5XGYB4Ch8TBkzuLBH Un5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oeASTIACqjLqjgo40S/3synelPRRKm5Hez+ARr3FyuI=; b=f+hqRLPYl5piO12Zrp6Il7vwdRjTZLD78p7pODw8B29iut6LVEz0J7Rumvi5dJTaBu 1erDtHHenUgL8f25aVHslkQGLVwPxZQh9LTINCeTphPwU3A5VIVbvPbcd/q/+SGd+/y6 8Xz4+SX+qGfzkm7tc5/81kRh3wokpU4npClTXYvoCqzf0w5UG9tKe2RI1Cdh5AFs4Vwn OXAREJGEQOeFW+76L1H+mwQlyRSXeFccbctUbfpMwmbmkGxkCXDHn/7xZOrLJGfvaVcL KJ5kOUb5n5AU7qHhe3qtHvGItxlM13TjUMYFoG26m8+baO7EOj6dT5EegGDh/x9M2/UN JudA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=K1zeGR+Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a17090a4f4b00b0024e0361745csi868790pjl.186.2023.05.03.00.20.10; Wed, 03 May 2023 00:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=K1zeGR+Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbjECHK2 (ORCPT + 99 others); Wed, 3 May 2023 03:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbjECHKW (ORCPT ); Wed, 3 May 2023 03:10:22 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50065272A; Wed, 3 May 2023 00:10:18 -0700 (PDT) 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 3436ACSu003519; Wed, 3 May 2023 00:10:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=oeASTIACqjLqjgo40S/3synelPRRKm5Hez+ARr3FyuI=; b=K1zeGR+Ze2e6EVuRB8VBScy+D1zT9DwVQ7IjsLHvApDGvr1QIHAE7gqb3fZKQkXFRs7A lDtCu1N/ObIy1Pty883QadcvHIWhSOKvLrYU3/K1ShNMkEXDhgO/XN5VasH0maZgywBh njJv8KeGNul1b2hxUPnS6nTLiyfL7Lh0V3IWGnBwxharGbK+8xNoaEpu5PmQnVulZqSW +ZUiCCIKr7eYiMNAGUGTenyVVGxxLiNaJ45660I/9AqeOTSDqmSaGJvNi1yzGLZP6x8o KM1zC1xN106yjSGi+i2lj79li3f+2g0n78ta9lxn9O/Y3JF9Fd7Ddz3rxUBGfDUXOGPd 8A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m7g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:10 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:10:08 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 3 May 2023 00:10:07 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 68EE73F70B1; Wed, 3 May 2023 00:10:01 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Ratheesh Kannoth , Sai Krishna Subject: [net PATCH v5 03/11] octeontx2-af: Fix depth of cam and mem table. Date: Wed, 3 May 2023 12:39:36 +0530 Message-ID: <20230503070944.960190-4-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: BhsQlXW0er5M99E_iJ6uOqggZ91SIv2i X-Proofpoint-GUID: BhsQlXW0er5M99E_iJ6uOqggZ91SIv2i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856615420722881?= X-GMAIL-MSGID: =?utf-8?q?1764856615420722881?= From: Ratheesh Kannoth In current driver, NPC cam and mem table sizes are read from wrong register offset. This patch fixes the register offset so that correct values are populated on read. Fixes: b747923afff8 ("octeontx2-af: Exact match support") Signed-off-by: Ratheesh Kannoth Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 20ebb9c95c73..6597af84aa36 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -1868,9 +1868,9 @@ int rvu_npc_exact_init(struct rvu *rvu) rvu->hw->table = table; /* Read table size, ways and depth */ - table->mem_table.depth = FIELD_GET(GENMASK_ULL(31, 24), npc_const3); table->mem_table.ways = FIELD_GET(GENMASK_ULL(19, 16), npc_const3); - table->cam_table.depth = FIELD_GET(GENMASK_ULL(15, 0), npc_const3); + table->mem_table.depth = FIELD_GET(GENMASK_ULL(15, 0), npc_const3); + table->cam_table.depth = FIELD_GET(GENMASK_ULL(31, 24), npc_const3); dev_dbg(rvu->dev, "%s: NPC exact match 4way_2k table(ways=%d, depth=%d)\n", __func__, table->mem_table.ways, table->cam_table.depth); From patchwork Wed May 3 07:09:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89584 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1132036vqo; Wed, 3 May 2023 00:14:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4bZ8L3uMlRKr4gzFA0BCA2TntMWIVSC2/k4TEk7w0u3OueZB96DeTN7Jl3FJQymLzxshfx X-Received: by 2002:a17:90b:1989:b0:24d:fab5:5f57 with SMTP id mv9-20020a17090b198900b0024dfab55f57mr1455266pjb.17.1683098081383; Wed, 03 May 2023 00:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098081; cv=none; d=google.com; s=arc-20160816; b=Fg4T8WWuWaUFqHplD1wr/EUWPHv7sXFimJkxrH2rrvFNfBNxg/sUSlhqkHef1nahdD SZ7RBCXxJA3E09sA4UP5Njt+WAfQdZ2cG2TOROse7Z8K3oxFXRGEpifMh/9mMhtyMFEy iU6cj5kiQCr2ChRP1d3BibC3dbHrfAhVbE0NDVWuOyBzGBga3Rn+FDWiHEt6bJ4P+iki H0iZ1fl9SUsLzoODpK6A3Pn/AvBTG1wur38HyGpOeK7Ik6zzFywOn/47sv4ZkJBbSYo4 j1ZQQe89gLt2lnCn+VHNuEjiF/I5VxOx74H9R4rGvTx90uNM7QcJwBVwUxR20uloDfSB +Ajg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c3cSGBdd33u15K/8c9xWQAxDg4P0TadDZwx94vassMs=; b=b9AekI3bAUjot/4N3edCBh1FwW4Vv3qlfRjdXQp3Vru/tvL7wa02ZlDRO2rgacQh/u HVKm94+KUXWjyfAl9sA3UFL2c01tEg5X86S0/cb8mEBh3bMcNoPpCaCk0VzlKTQi1f2h KsZ07CJ7XR3rAOBNlhK+1pfiv/TOhR540IF/zoQ2cOrOF3w+/Tm0pGDedh7rcQ4r7o2L wZCIAUtabDnEhWLs7GBl8cDbSQ05g/LWpCUp1dpTJFbUNJMPIYHjyP4lhGdkSgcGWBqa apyekKEbbzMdw7MPJWufJWNrOyWyQYeuWWGyT0ZF16JQyGm/GsBAvYpdpJlo4T1CY9ao 7YPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=Os04Qm33; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a17090aad8e00b0024df2dbc7afsi7830565pjq.52.2023.05.03.00.14.28; Wed, 03 May 2023 00:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=Os04Qm33; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbjECHKb (ORCPT + 99 others); Wed, 3 May 2023 03:10:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbjECHKY (ORCPT ); Wed, 3 May 2023 03:10:24 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8944E4227; Wed, 3 May 2023 00:10:20 -0700 (PDT) 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 3436A4il003430; Wed, 3 May 2023 00:10:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=c3cSGBdd33u15K/8c9xWQAxDg4P0TadDZwx94vassMs=; b=Os04Qm33lUu9sprcuTfOqe110LksylE8pMgPmt77MGAe+6ZopDyN1PD6c1E6vumko6gB ObwnS9IO+Ezsnvc/xWYi72YCn/Cmlvh2Sv7ku0RL/WUQN8grplbeeBdCjGCGc5GQTTHc c6g0dFlqTXm45/DrPB+DJblQZ6T5CjunP2M+raGInJnc55T1J+VplzDVcTqv1sKdRyLn JzJMsqqJOuP5IvYJcpmPKcNAS4tAtswGdwvOwdYu8PhdNpAFing10a48R6pDw22GZ3tg 3Y6oO+95hOG+4ZwMfuofpV0N7NOdFak4H782Rj+ijiTGDkpzJp7ugXU8kkgPX8pXgTW1 CA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m7m-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:12 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:10:10 -0700 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; Wed, 3 May 2023 00:10:10 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 51B7A3F70EE; Wed, 3 May 2023 00:10:06 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Ratheesh Kannoth , Sai Krishna Subject: [net PATCH v5 04/11] octeontx2-pf: Increase the size of dmac filter flows Date: Wed, 3 May 2023 12:39:37 +0530 Message-ID: <20230503070944.960190-5-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 0O9sNZLQwZP1zBipVk47tyB6O5_zm8n9 X-Proofpoint-GUID: 0O9sNZLQwZP1zBipVk47tyB6O5_zm8n9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856253895960534?= X-GMAIL-MSGID: =?utf-8?q?1764856253895960534?= From: Ratheesh Kannoth CN10kb supports large number of dmac filter flows to be inserted. Increase the field size to accommodate the same Fixes: b747923afff8 ("octeontx2-af: Exact match support") Signed-off-by: Ratheesh Kannoth Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h index f42b2b65bfd7..0c8fc66ade82 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -335,11 +335,11 @@ struct otx2_flow_config { #define OTX2_PER_VF_VLAN_FLOWS 2 /* Rx + Tx per VF */ #define OTX2_VF_VLAN_RX_INDEX 0 #define OTX2_VF_VLAN_TX_INDEX 1 - u16 max_flows; - u8 dmacflt_max_flows; u32 *bmap_to_dmacindex; unsigned long *dmacflt_bmap; struct list_head flow_list; + u32 dmacflt_max_flows; + u16 max_flows; }; struct otx2_tc_info { From patchwork Wed May 3 07:09:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89591 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1136462vqo; Wed, 3 May 2023 00:25:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vxdPqaWj+Ij/BBLOqirD4A8qhzD3ZI8sKdwOfWrxbc5NuRuVqfn3/zPUHSBn5HQScolqJ X-Received: by 2002:a17:903:234b:b0:1aa:ed6f:29c2 with SMTP id c11-20020a170903234b00b001aaed6f29c2mr1481093plh.11.1683098719557; Wed, 03 May 2023 00:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098719; cv=none; d=google.com; s=arc-20160816; b=WQcZSi8wT4MQTBV0aCr+NmIuvxn52n95cPhcsMJTEKswRFlNR6uG3apN6hDti9BWav R6O6PrdRQiIzHlrN3SHdoLvtSmgtdaNcvfNHkuh+YuWUozOL5FEu7e3U7eVTHipKzn5x p7nCFkT/AfzlrgMed09wGUeGMVwKnCMirWMN1a/2Nku/DLkjAVwMrIrJw0b1RNRFE+cp rqHUvnCgG5Rz4TiMu8KwsZfoYq7aQEs+g/+e8NNFAe+oCb2mCeDO6QpuKi3xRPx9zNUD olc82n0H+4cgSM7vxSvTXMR/Epixpe/6/8W9ZuE4GGogrlW/vBB/42EcfdLwkJjKxw6x jc0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZlSrOLdBRNFKeLr7Ip+8w0eprD3EHpIspAhBFP9tXz8=; b=U4XfFwP7nlGktkEySm7fC7F4i+TwU4L/UOv3K1IeCJtr2dKLF8wbif6fgBvovnKHoj NwNxGMdbD7RW981tTJZwUnDPtyqwwlj/nwWybIsUcRjorRjuDWZbJCe+k7C+VTjPbVGD wfSl8qJQ19Gr1a9L5dj9CxHoJ3yLEyyeG12FZ/dL1tWEkqJuHbBjJx6ipJlPEJXK5zkD jZEEWTzp5D4sSmt9Wpgf0hhphYnMjFzXL/vNnDn05vktbzGHDvvYysl0BkrjIYezWc8r pcz6YPr9O6IQC2qywEq932wW3XLIniWGUSxM7f8/uycSe4JpTQ9Tg9uqsp8pu8UbwsxL tGwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=aAOHEL2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg1-20020a17090326c100b001aaf62c76cesi6376413plb.129.2023.05.03.00.25.03; Wed, 03 May 2023 00:25:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=aAOHEL2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbjECHKp (ORCPT + 99 others); Wed, 3 May 2023 03:10:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjECHKe (ORCPT ); Wed, 3 May 2023 03:10:34 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF2C4223; Wed, 3 May 2023 00:10:29 -0700 (PDT) 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 3436AsGR004505; Wed, 3 May 2023 00:10:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=ZlSrOLdBRNFKeLr7Ip+8w0eprD3EHpIspAhBFP9tXz8=; b=aAOHEL2RA4pToiPZJEbz48+w4sePaoB8HNfrvK2p+ABqkIORQ2CKkaT9PHP2T0apZk0a hQD5G99S+0iaOy5+TMa+myfvfGnTo4hARGXBdjJfr/uqwJp3ilQyp7N/P4QPnA1guCHn BoMMotlCysJhpdc3xplRIrvHTzP2ovfqqla58LUmZJhKYfXgFToFvWgFlfljzd1IgUVP TiyrX/vEHDl+7fvZMmKXUHDhAVUaPj0wNwiUYO+qsNZL72/wAEsvzfl84SdfWfiQ3eMI +cnZLY0FW4LpJGoY72NVTTyKe/gKfEZFjAlkMAeg+krcX20Fe0l5SJSoaEyhO6pzpCes gQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m7v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:17 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:10:15 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 3 May 2023 00:10:15 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 4379A3F7082; Wed, 3 May 2023 00:10:11 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Sai Krishna Subject: [net PATCH v5 05/11] octeontx2-af: Add validation for lmac type Date: Wed, 3 May 2023 12:39:38 +0530 Message-ID: <20230503070944.960190-6-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: mugEdnywIu1dptctzCkIXq5IiRZSHBAL X-Proofpoint-GUID: mugEdnywIu1dptctzCkIXq5IiRZSHBAL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856923143723016?= X-GMAIL-MSGID: =?utf-8?q?1764856923143723016?= From: Hariprasad Kelam Upon physical link change, firmware reports to the kernel about the change along with the details like speed, lmac_type_id, etc. Kernel derives lmac_type based on lmac_type_id received from firmware. In a few scenarios, firmware returns an invalid lmac_type_id, which is resulting in below kernel panic. This patch adds the missing validation of the lmac_type_id field. Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 35.321595] Modules linked in: [ 35.328982] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 5.4.210-g2e3169d8e1bc-dirty #17 [ 35.337014] Hardware name: Marvell CN103XX board (DT) [ 35.344297] Workqueue: events work_for_cpu_fn [ 35.352730] pstate: 40400089 (nZcv daIf +PAN -UAO) [ 35.360267] pc : strncpy+0x10/0x30 [ 35.366595] lr : cgx_link_change_handler+0x90/0x180 Fixes: 61071a871ea6 ("octeontx2-af: Forward CGX link notifications to PFs") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman --- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index 724df6398bbe..bd77152bb8d7 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -1231,6 +1231,14 @@ static inline void link_status_user_format(u64 lstat, linfo->an = FIELD_GET(RESP_LINKSTAT_AN, lstat); linfo->fec = FIELD_GET(RESP_LINKSTAT_FEC, lstat); linfo->lmac_type_id = FIELD_GET(RESP_LINKSTAT_LMAC_TYPE, lstat); + + if (linfo->lmac_type_id >= LMAC_MODE_MAX) { + dev_err(&cgx->pdev->dev, "Unknown lmac_type_id %d reported by firmware on cgx port%d:%d", + linfo->lmac_type_id, cgx->cgx_id, lmac_id); + strncpy(linfo->lmac_type, "Unknown", LMACTYPE_STR_LEN - 1); + return; + } + lmac_string = cgx_lmactype_string[linfo->lmac_type_id]; strncpy(linfo->lmac_type, lmac_string, LMACTYPE_STR_LEN - 1); } From patchwork Wed May 3 07:09:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89592 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1136737vqo; Wed, 3 May 2023 00:25:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77xmo2zdlfsmErT6BfU/w4qoCU+KZQQqwSiQnTiKjtet4mMyvU04NGG6EuFINrOV3UikMf X-Received: by 2002:a05:6a20:5493:b0:f2:5c65:b767 with SMTP id i19-20020a056a20549300b000f25c65b767mr28159013pzk.42.1683098757895; Wed, 03 May 2023 00:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098757; cv=none; d=google.com; s=arc-20160816; b=CERKRkEHyUyO/Ih3lwDYqPBZhO7/ffAs2bZd/M9pMTZmtK446Ba9bl+Y9xCohB+9I+ 1TjcxwvtIJL79N6Uc5UwDgoSjafNHchj1sJZS9YKwLrseCaSIZ3XxO5ZJWrn3wtPcW+B WDg3UNVuEL3TwpzW2Ntm4RQjnWrjHmErCvK3+LgSVDn+5GtiVZkW30wYbGw4MZtsbrSh sYkdaFKHDRHLugEVOznB9EzWpRGid2Yd6wueohPXUQoBeErh69k+AS7f7fe+K0iyui48 pWSeXSFzTt1ebxTvaZ3yVlWbmnK5wdpoMDiwATJqoZQQkSBK16/U0fvA9clOZ6WWQJbp qoHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ULQ0BrR7wzq3hufaukTzQqwThQaxiFl+ufv1LiMejOQ=; b=k9OUvdMXOGrVWOiDKCm3VaplkyY1VX4ZHIDROep9n1TFIXAw/lEt0rpeZNhfI6mHGg Gd80/Ece6ICwE1nLuiZ2WuEMODnwX9x4xU8jQzNzeX2CWemuDAK0fIFBU3HJo2awRzzH 47vuZryiMVKo7WcsIF2VdgruZKfcWPTeqAbOXGVwP5fXqXWcTFiW7i1LqH363ceND9fh BkbxmRLSgYpT0zelvlCjleDdqzdBF8UdQc0Xmzs/HD4QpBWvchcpe6i7ctdOLrk2m9Ze CxhNVaocMhjKcL4ZN6B621MRqg8ivKA9jDkvYVayk7fQF5X/8fcuDTZrFRv8mVuHhzz2 Ug3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=YB9SPuJu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a63eb0a000000b0052069c10102si31876972pgh.75.2023.05.03.00.25.43; Wed, 03 May 2023 00:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=YB9SPuJu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229733AbjECHKs (ORCPT + 99 others); Wed, 3 May 2023 03:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbjECHKl (ORCPT ); Wed, 3 May 2023 03:10:41 -0400 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 675E744B1; Wed, 3 May 2023 00:10:30 -0700 (PDT) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 342K5f0r026446; Wed, 3 May 2023 00:10:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=ULQ0BrR7wzq3hufaukTzQqwThQaxiFl+ufv1LiMejOQ=; b=YB9SPuJuRZ6s8tKQf1BUNCMUFL/Q+u37cb/BZT4keLVf8k3LILtVoCDjL+ey6Bhov4TU ZdrSWZMnoelLzfFUuQr3zMnIRNDmG0xLvO1asZV8ofu5J9DFDqkxtcPj/z053jadvFjb 8EcitTKxFXevaDfLroOlkf4xrpwGBln/D9edvA74O6JKHWcUU6MRnrqYxpbNhCvQPsuu 17ncgPeWf38XKcMe1d3p3wSS9sj/04X4lxYhWUx226YsK4aVgFYOGb8gtTtB2099s+Js nGvAIm3SQKqfMTs1CHJkjgybjJWJIq/VeLfbkSxL+MRrb4j4FaLcb9uXdCE6Gz7eRZJJ 6g== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qavhenawe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:23 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:10:21 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 3 May 2023 00:10:21 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id E1E5C3F70BC; Wed, 3 May 2023 00:10:15 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Suman Ghosh , Sai Krishna Subject: [net PATCH v5 06/11] octeontx2-af: Update correct mask to filter IPv4 fragments Date: Wed, 3 May 2023 12:39:39 +0530 Message-ID: <20230503070944.960190-7-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: cGKOW5124QrhFGNepVi5TuCyUXaI6Sav X-Proofpoint-GUID: cGKOW5124QrhFGNepVi5TuCyUXaI6Sav X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856963084387635?= X-GMAIL-MSGID: =?utf-8?q?1764856963084387635?= From: Suman Ghosh During the initial design, the IPv4 ip_flag mask was set to 0xff. Which results to filter only fragmets with (fragment_offset == 0). As part of the fix, updated the mask to 0x20 to filter all the fragmented packets irrespective of the fragment_offset value. Fixes: c672e3727989 ("octeontx2-pf: Add support to filter packet based on IP fragment") Signed-off-by: Suman Ghosh Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c index 044cc211424e..8392f63e433f 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c @@ -544,7 +544,7 @@ static int otx2_tc_prepare_flow(struct otx2_nic *nic, struct otx2_tc_flow *node, if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) { if (ntohs(flow_spec->etype) == ETH_P_IP) { flow_spec->ip_flag = IPV4_FLAG_MORE; - flow_mask->ip_flag = 0xff; + flow_mask->ip_flag = IPV4_FLAG_MORE; req->features |= BIT_ULL(NPC_IPFRAG_IPV4); } else if (ntohs(flow_spec->etype) == ETH_P_IPV6) { flow_spec->next_header = IPPROTO_FRAGMENT; From patchwork Wed May 3 07:09:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1136191vqo; Wed, 3 May 2023 00:24:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5n/gNxukngAe9/Lw4S8/yPPe1xBIXSQz1RxbplFoyHSrefyyH3uOo6smhW/GLo4TLX9vpt X-Received: by 2002:a05:6a00:1890:b0:63b:22e7:6ee6 with SMTP id x16-20020a056a00189000b0063b22e76ee6mr29956691pfh.31.1683098683582; Wed, 03 May 2023 00:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098683; cv=none; d=google.com; s=arc-20160816; b=w+WaK3GeLS6Ff/5+cRlleYD92xTUoA5/5D4oHfOprZe92BzTKLBvjz/nzk1dfMgOWo SBVgzj6/k7A6fcjXBi/6QJ02E1Wu7nu7v+n5UrfoPe6ftl/tqirJWJAhGsqXBoxMpBti N8vgmmBS8ERe4lLkpVmWQIScWPjAeRCUuVgENyhE0M3L3WzZG7ZiDoN3uZEeedCRe8nu NuZI39U97ESrxPH0qhjeBheVTVo5BzrRYfY4kshX858FJ0yaRrjtsjMkQyLOX1lygMnd EG04OWrpKlz6o2A8oHNDEFraz8e50pywirjaksmY9Lm2EQjbx5IJQp4pWZrFZJSQcJEA CVqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V6FJslOq6iIVW+dvi5p28GN+tdn6iGtf/2zEFNv36Co=; b=mbFAEI5qqAy+oqrX1CiPUQVXfj9Zi/FkycicWfvrDPUyy3iXLhmVJMdC5qAGEpAuhz Jbn3PgSZQDqmMlyGPsWuqt4stISSZwDCFYZGZ4j5Y4yM2gk251RrWovWyQFI+hO59KDy PE7Fdk7hQRMl4BuHW5tnjcyroC3OTN6tsJ3Y5ygzIbGJ4uMZFKaJ6TATbHOpS9GPK/cj rdMpmEsMCEgm4YGjQxUhECzAcNkNLrpJrKgtpbegMKjEyKC9LbGM5xd8NBDVwnaydvlk GXhtSSl44jlwN+0YnMu36YpBKxbVdicU+C89Dj4wXu3JFgP+aKGdRDY25+pRg7mAr3zq hXNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=T0a3WIHi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w186-20020a6262c3000000b0063d3dda6930si827902pfb.352.2023.05.03.00.24.27; Wed, 03 May 2023 00:24:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=T0a3WIHi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229701AbjECHLN (ORCPT + 99 others); Wed, 3 May 2023 03:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjECHLK (ORCPT ); Wed, 3 May 2023 03:11:10 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCDF740FD; Wed, 3 May 2023 00:10:41 -0700 (PDT) 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 3436BwZA005692; Wed, 3 May 2023 00:10:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=V6FJslOq6iIVW+dvi5p28GN+tdn6iGtf/2zEFNv36Co=; b=T0a3WIHidRztEyLf2oDBnSpl2ZtVvrA2YdM/u33C0MgPppLtCfE5fbXMWsVCUy7Qj/cO 4YMsaLDE5StDuDZPHnPDLYwSXPWRpcE4J5KiDMIcjhzB9mdY/xS102Tl+iHCL25BIgmL c+WpO47hIXvkHpNfR3uE6nSNN2t9/D4DCZO+OlMlI/LvU+yajb2vCZEMD1QEy97ZleQH DZIy00Z9ALkhM+1uYp1xExw+GHLSjyKPJ2u7QW7rrsWAwreXVAwKDa6dR1JbtuuhvNgw dzk8SpRTHFlXQqnMq3O62gm4aGL8chddrvLobroBr/fQfLgM488dsbl4p+TLoHc9xNrW NA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m8b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:27 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:10:25 -0700 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; Wed, 3 May 2023 00:10:25 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id CC23E3F70BA; Wed, 3 May 2023 00:10:20 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Ratheesh Kannoth , Sai Krishna Subject: [net PATCH v5 07/11] octeontx2-af: Update/Fix NPC field hash extract feature Date: Wed, 3 May 2023 12:39:40 +0530 Message-ID: <20230503070944.960190-8-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ajL5sflmNXcv_Fzs7hNK1H700mjgidnc X-Proofpoint-GUID: ajL5sflmNXcv_Fzs7hNK1H700mjgidnc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856885337534571?= X-GMAIL-MSGID: =?utf-8?q?1764856885337534571?= From: Ratheesh Kannoth 1. As per previous implementation, mask and control parameter to generate the field hash value was not passed to the caller program. Updated the secret key mbox to share that information as well, as a part of the fix. 2. Earlier implementation did not consider hash reduction of both source and destination IPv6 addresses. Only source IPv6 address was considered. This fix solves that and provides option to hash Fixes: 56d9f5fd2246 ("octeontx2-af: Use hashed field in MCAM key") Signed-off-by: Ratheesh Kannoth Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman --- .../net/ethernet/marvell/octeontx2/af/mbox.h | 16 +++++--- .../marvell/octeontx2/af/rvu_npc_hash.c | 37 ++++++++++++------- .../marvell/octeontx2/af/rvu_npc_hash.h | 6 +++ 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h index 8fb5cae7285b..4c1e374bb376 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h @@ -245,9 +245,9 @@ M(NPC_MCAM_READ_BASE_RULE, 0x6011, npc_read_base_steer_rule, \ M(NPC_MCAM_GET_STATS, 0x6012, npc_mcam_entry_stats, \ npc_mcam_get_stats_req, \ npc_mcam_get_stats_rsp) \ -M(NPC_GET_SECRET_KEY, 0x6013, npc_get_secret_key, \ - npc_get_secret_key_req, \ - npc_get_secret_key_rsp) \ +M(NPC_GET_FIELD_HASH_INFO, 0x6013, npc_get_field_hash_info, \ + npc_get_field_hash_info_req, \ + npc_get_field_hash_info_rsp) \ M(NPC_GET_FIELD_STATUS, 0x6014, npc_get_field_status, \ npc_get_field_status_req, \ npc_get_field_status_rsp) \ @@ -1524,14 +1524,20 @@ struct npc_mcam_get_stats_rsp { u8 stat_ena; /* enabled */ }; -struct npc_get_secret_key_req { +struct npc_get_field_hash_info_req { struct mbox_msghdr hdr; u8 intf; }; -struct npc_get_secret_key_rsp { +struct npc_get_field_hash_info_rsp { struct mbox_msghdr hdr; u64 secret_key[3]; +#define NPC_MAX_HASH 2 +#define NPC_MAX_HASH_MASK 2 + /* NPC_AF_INTF(0..1)_HASH(0..1)_MASK(0..1) */ + u64 hash_mask[NPC_MAX_INTF][NPC_MAX_HASH][NPC_MAX_HASH_MASK]; + /* NPC_AF_INTF(0..1)_HASH(0..1)_RESULT_CTRL */ + u64 hash_ctrl[NPC_MAX_INTF][NPC_MAX_HASH]; }; enum ptp_op { diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 6597af84aa36..68f813040363 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -110,8 +110,8 @@ static u64 npc_update_use_hash(int lt, int ld) * in KEX_LD_CFG */ cfg = KEX_LD_CFG_USE_HASH(0x1, 0x03, - ld ? 0x8 : 0x18, - 0x1, 0x0, 0x10); + ld ? 0x18 : 0x8, + 0x1, 0x0, ld ? 0x14 : 0x10); break; } @@ -134,7 +134,6 @@ static void npc_program_mkex_hash_rx(struct rvu *rvu, int blkaddr, if (mkex_hash->lid_lt_ld_hash_en[intf][lid][lt][ld]) { u64 cfg = npc_update_use_hash(lt, ld); - hash_cnt++; if (hash_cnt == NPC_MAX_HASH) return; @@ -149,6 +148,8 @@ static void npc_program_mkex_hash_rx(struct rvu *rvu, int blkaddr, mkex_hash->hash_mask[intf][ld][1]); SET_KEX_LD_HASH_CTRL(intf, ld, mkex_hash->hash_ctrl[intf][ld]); + + hash_cnt++; } } } @@ -171,7 +172,6 @@ static void npc_program_mkex_hash_tx(struct rvu *rvu, int blkaddr, if (mkex_hash->lid_lt_ld_hash_en[intf][lid][lt][ld]) { u64 cfg = npc_update_use_hash(lt, ld); - hash_cnt++; if (hash_cnt == NPC_MAX_HASH) return; @@ -187,8 +187,6 @@ static void npc_program_mkex_hash_tx(struct rvu *rvu, int blkaddr, SET_KEX_LD_HASH_CTRL(intf, ld, mkex_hash->hash_ctrl[intf][ld]); hash_cnt++; - if (hash_cnt == NPC_MAX_HASH) - return; } } } @@ -238,8 +236,8 @@ void npc_update_field_hash(struct rvu *rvu, u8 intf, struct flow_msg *omask) { struct npc_mcam_kex_hash *mkex_hash = rvu->kpu.mkex_hash; - struct npc_get_secret_key_req req; - struct npc_get_secret_key_rsp rsp; + struct npc_get_field_hash_info_req req; + struct npc_get_field_hash_info_rsp rsp; u64 ldata[2], cfg; u32 field_hash; u8 hash_idx; @@ -250,7 +248,7 @@ void npc_update_field_hash(struct rvu *rvu, u8 intf, } req.intf = intf; - rvu_mbox_handler_npc_get_secret_key(rvu, &req, &rsp); + rvu_mbox_handler_npc_get_field_hash_info(rvu, &req, &rsp); for (hash_idx = 0; hash_idx < NPC_MAX_HASH; hash_idx++) { cfg = rvu_read64(rvu, blkaddr, NPC_AF_INTFX_HASHX_CFG(intf, hash_idx)); @@ -311,13 +309,13 @@ void npc_update_field_hash(struct rvu *rvu, u8 intf, } } -int rvu_mbox_handler_npc_get_secret_key(struct rvu *rvu, - struct npc_get_secret_key_req *req, - struct npc_get_secret_key_rsp *rsp) +int rvu_mbox_handler_npc_get_field_hash_info(struct rvu *rvu, + struct npc_get_field_hash_info_req *req, + struct npc_get_field_hash_info_rsp *rsp) { u64 *secret_key = rsp->secret_key; u8 intf = req->intf; - int blkaddr; + int i, j, blkaddr; blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); if (blkaddr < 0) { @@ -329,6 +327,19 @@ int rvu_mbox_handler_npc_get_secret_key(struct rvu *rvu, secret_key[1] = rvu_read64(rvu, blkaddr, NPC_AF_INTFX_SECRET_KEY1(intf)); secret_key[2] = rvu_read64(rvu, blkaddr, NPC_AF_INTFX_SECRET_KEY2(intf)); + for (i = 0; i < NPC_MAX_HASH; i++) { + for (j = 0; j < NPC_MAX_HASH_MASK; j++) { + rsp->hash_mask[NIX_INTF_RX][i][j] = + GET_KEX_LD_HASH_MASK(NIX_INTF_RX, i, j); + rsp->hash_mask[NIX_INTF_TX][i][j] = + GET_KEX_LD_HASH_MASK(NIX_INTF_TX, i, j); + } + } + + for (i = 0; i < NPC_MAX_INTF; i++) + for (j = 0; j < NPC_MAX_HASH; j++) + rsp->hash_ctrl[i][j] = GET_KEX_LD_HASH_CTRL(i, j); + return 0; } diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h index 3efeb09c58de..65936f4aeaac 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h @@ -31,6 +31,12 @@ rvu_write64(rvu, blkaddr, \ NPC_AF_INTFX_HASHX_MASKX(intf, ld, mask_idx), cfg) +#define GET_KEX_LD_HASH_CTRL(intf, ld) \ + rvu_read64(rvu, blkaddr, NPC_AF_INTFX_HASHX_RESULT_CTRL(intf, ld)) + +#define GET_KEX_LD_HASH_MASK(intf, ld, mask_idx) \ + rvu_read64(rvu, blkaddr, NPC_AF_INTFX_HASHX_MASKX(intf, ld, mask_idx)) + #define SET_KEX_LD_HASH_CTRL(intf, ld, cfg) \ rvu_write64(rvu, blkaddr, \ NPC_AF_INTFX_HASHX_RESULT_CTRL(intf, ld), cfg) From patchwork Wed May 3 07:09:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89586 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1133018vqo; Wed, 3 May 2023 00:16:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ztZdvek7lR4rVazMiQ3LAfoXQ7Mh2s2bgCaPP7LHaCIDS9aBuXDC6LESvotSjHxxbuYgg X-Received: by 2002:a17:902:cecc:b0:19c:3d78:6a54 with SMTP id d12-20020a170902cecc00b0019c3d786a54mr967043plg.14.1683098210138; Wed, 03 May 2023 00:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098210; cv=none; d=google.com; s=arc-20160816; b=NTGRN0UU6Mvbd4WV6+ceqEZtXwZQS0KvYMTotyPjuFPvEK00Y53IUWOSK/mY7Zu5is PcZzRv5sKRASX4vYviQpI9APH2xg301BVa0fS/jXEdObjy5qbQc98X6OWHjKdKpMCd6N MR5DbisN844PVPIU+nuiFSgxOQf/bfoFFLvlHBMTusmY0av/4COTM2JDa70bSaloOscu 9Bww2tBManPvQsZ3+HilCOIEA5lB2HhxoXe6bh2TLHAV1vnOB/dscMQEEHcuIOcKDFQy /rEJHOPxRiYuB9BOJBdS8pKjYNsC2WJksS5gIyAzmrLAdT3dTtFlKmNpV7cmaL7vH94F xlhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OsrEqUhvjSXhCe4JLbW2Ai9IhBGYHEXxlGPlVSn4gL0=; b=Kjg1iMFKVSAeTKKw80JKcIdlj57c0n3O25nwJBNgo5Kg49Ts+/SsUU6OJ94vue3/iH /4n6UzY7SowHS2ocWHmn6awGpvt4iT+HqNbcmgeV5RuB94P1iwPaJ+9OmWakAtB1H3Rr NlpEGuOAhm2d+uvKo/xRuDthrpS25CjmGfth1va2Qt9Sbo8LooKCs1vhdu91WKkDcyMx 65PPAVk6y2NW8dPmpasQ04vnOuU/+wxPRXZXdfiynTCJf3Lo4vdyWaiEefMFKxdy0LGX BxD6Uh+ySqhxEzNs9V25VXG1SxGh2aC231/3Q5TU8CsIGDIuoev8nW41UwL9//+VkWRX AZoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=ZWlrxfQR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be8-20020a170902aa0800b001a6f0e81ec7si18286044plb.237.2023.05.03.00.16.37; Wed, 03 May 2023 00:16:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=ZWlrxfQR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbjECHL0 (ORCPT + 99 others); Wed, 3 May 2023 03:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjECHLZ (ORCPT ); Wed, 3 May 2023 03:11:25 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52BDB49D0; Wed, 3 May 2023 00:10:54 -0700 (PDT) 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 3436AsGV004505; Wed, 3 May 2023 00:10:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=OsrEqUhvjSXhCe4JLbW2Ai9IhBGYHEXxlGPlVSn4gL0=; b=ZWlrxfQRBmQ+fQH4mAso7tIL1pSsOaPvcr1GquQKil6CCILFMCUNdpz2Qp79mDr0jj/B vsf/nyPjmgVUYaRblYXUAx8MSOJfucz//3L1amEyqXKRPCr3uFyunZnkQ4TkIGpUPMC9 n+eol2XmsPS+kTtSAFirDRp48c7YHBNHdsqmmVsrSmStzNyEK/Tan/7FdAUcbIszNztr FvSJDYgBJyAsPkf4yWHXVOi1ubCWZD3tqP1r9/+W55Y5DtSVrIuAMXd/4Re2fhXJT55l I7YQauiaSjzEq9pTQE+wHY2M3ZYHmGdVeexKW7kLSdwRT5AwfVFl3Nrqtqls7A07H/Xb Mg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m8w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:32 -0700 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; Wed, 3 May 2023 00:10:30 -0700 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; Wed, 3 May 2023 00:10:30 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id B43313F7074; Wed, 3 May 2023 00:10:25 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Ratheesh Kannoth , Sai Krishna Subject: [net PATCH v5 08/11] octeontx2-af: Fix issues with NPC field hash extract Date: Wed, 3 May 2023 12:39:41 +0530 Message-ID: <20230503070944.960190-9-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: kR063eEY_0bpyTXePUIiGqqlVquEvJ1C X-Proofpoint-GUID: kR063eEY_0bpyTXePUIiGqqlVquEvJ1C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856388835665043?= X-GMAIL-MSGID: =?utf-8?q?1764856388835665043?= From: Ratheesh Kannoth 1. Allow field hash configuration for both source and destination IPv6. 2. Configure hardware parser based on hash extract feature enable flag for IPv6. 3. Fix IPv6 endianness issue while updating the source/destination IP address via ntuple rule. Fixes: 56d9f5fd2246 ("octeontx2-af: Use hashed field in MCAM key") Signed-off-by: Ratheesh Kannoth Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman --- .../marvell/octeontx2/af/rvu_npc_fs.c | 23 +++-- .../marvell/octeontx2/af/rvu_npc_fs.h | 4 + .../marvell/octeontx2/af/rvu_npc_hash.c | 88 ++++++++++--------- .../marvell/octeontx2/af/rvu_npc_hash.h | 4 +- 4 files changed, 69 insertions(+), 50 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c index f15efd41972e..952319453701 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c @@ -13,11 +13,6 @@ #include "rvu_npc_fs.h" #include "rvu_npc_hash.h" -#define NPC_BYTESM GENMASK_ULL(19, 16) -#define NPC_HDR_OFFSET GENMASK_ULL(15, 8) -#define NPC_KEY_OFFSET GENMASK_ULL(5, 0) -#define NPC_LDATA_EN BIT_ULL(7) - static const char * const npc_flow_names[] = { [NPC_DMAC] = "dmac", [NPC_SMAC] = "smac", @@ -442,6 +437,7 @@ static void npc_handle_multi_layer_fields(struct rvu *rvu, int blkaddr, u8 intf) static void npc_scan_ldata(struct rvu *rvu, int blkaddr, u8 lid, u8 lt, u64 cfg, u8 intf) { + struct npc_mcam_kex_hash *mkex_hash = rvu->kpu.mkex_hash; struct npc_mcam *mcam = &rvu->hw->mcam; u8 hdr, key, nr_bytes, bit_offset; u8 la_ltype, la_start; @@ -490,8 +486,21 @@ do { \ NPC_SCAN_HDR(NPC_SIP_IPV4, NPC_LID_LC, NPC_LT_LC_IP, 12, 4); NPC_SCAN_HDR(NPC_DIP_IPV4, NPC_LID_LC, NPC_LT_LC_IP, 16, 4); NPC_SCAN_HDR(NPC_IPFRAG_IPV6, NPC_LID_LC, NPC_LT_LC_IP6_EXT, 6, 1); - NPC_SCAN_HDR(NPC_SIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 8, 16); - NPC_SCAN_HDR(NPC_DIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 24, 16); + if (rvu->hw->cap.npc_hash_extract) { + if (mkex_hash->lid_lt_ld_hash_en[intf][lid][lt][0]) + NPC_SCAN_HDR(NPC_SIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 8, 4); + else + NPC_SCAN_HDR(NPC_SIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 8, 16); + + if (mkex_hash->lid_lt_ld_hash_en[intf][lid][lt][1]) + NPC_SCAN_HDR(NPC_DIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 24, 4); + else + NPC_SCAN_HDR(NPC_DIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 24, 16); + } else { + NPC_SCAN_HDR(NPC_SIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 8, 16); + NPC_SCAN_HDR(NPC_DIP_IPV6, NPC_LID_LC, NPC_LT_LC_IP6, 24, 16); + } + NPC_SCAN_HDR(NPC_SPORT_UDP, NPC_LID_LD, NPC_LT_LD_UDP, 0, 2); NPC_SCAN_HDR(NPC_DPORT_UDP, NPC_LID_LD, NPC_LT_LD_UDP, 2, 2); NPC_SCAN_HDR(NPC_SPORT_TCP, NPC_LID_LD, NPC_LT_LD_TCP, 0, 2); diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.h index bdd65ce56a32..3f5c9042d10e 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.h @@ -9,6 +9,10 @@ #define __RVU_NPC_FS_H #define IPV6_WORDS 4 +#define NPC_BYTESM GENMASK_ULL(19, 16) +#define NPC_HDR_OFFSET GENMASK_ULL(15, 8) +#define NPC_KEY_OFFSET GENMASK_ULL(5, 0) +#define NPC_LDATA_EN BIT_ULL(7) void npc_update_entry(struct rvu *rvu, enum key_fields type, struct mcam_entry *entry, u64 val_lo, diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 68f813040363..51209119f0f2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -78,42 +78,43 @@ static u32 rvu_npc_toeplitz_hash(const u64 *data, u64 *key, size_t data_bit_len, return hash_out; } -u32 npc_field_hash_calc(u64 *ldata, struct npc_mcam_kex_hash *mkex_hash, - u64 *secret_key, u8 intf, u8 hash_idx) +u32 npc_field_hash_calc(u64 *ldata, struct npc_get_field_hash_info_rsp rsp, + u8 intf, u8 hash_idx) { u64 hash_key[3]; u64 data_padded[2]; u32 field_hash; - hash_key[0] = secret_key[1] << 31; - hash_key[0] |= secret_key[2]; - hash_key[1] = secret_key[1] >> 33; - hash_key[1] |= secret_key[0] << 31; - hash_key[2] = secret_key[0] >> 33; + hash_key[0] = rsp.secret_key[1] << 31; + hash_key[0] |= rsp.secret_key[2]; + hash_key[1] = rsp.secret_key[1] >> 33; + hash_key[1] |= rsp.secret_key[0] << 31; + hash_key[2] = rsp.secret_key[0] >> 33; - data_padded[0] = mkex_hash->hash_mask[intf][hash_idx][0] & ldata[0]; - data_padded[1] = mkex_hash->hash_mask[intf][hash_idx][1] & ldata[1]; + data_padded[0] = rsp.hash_mask[intf][hash_idx][0] & ldata[0]; + data_padded[1] = rsp.hash_mask[intf][hash_idx][1] & ldata[1]; field_hash = rvu_npc_toeplitz_hash(data_padded, hash_key, 128, 159); - field_hash &= mkex_hash->hash_ctrl[intf][hash_idx] >> 32; - field_hash |= mkex_hash->hash_ctrl[intf][hash_idx]; + field_hash &= FIELD_GET(GENMASK(63, 32), rsp.hash_ctrl[intf][hash_idx]); + field_hash += FIELD_GET(GENMASK(31, 0), rsp.hash_ctrl[intf][hash_idx]); return field_hash; } -static u64 npc_update_use_hash(int lt, int ld) +static u64 npc_update_use_hash(struct rvu *rvu, int blkaddr, + u8 intf, int lid, int lt, int ld) { - u64 cfg = 0; - - switch (lt) { - case NPC_LT_LC_IP6: - /* Update use_hash(bit-20) and bytesm1 (bit-16:19) - * in KEX_LD_CFG - */ - cfg = KEX_LD_CFG_USE_HASH(0x1, 0x03, - ld ? 0x18 : 0x8, - 0x1, 0x0, ld ? 0x14 : 0x10); - break; - } + u8 hdr, key; + u64 cfg; + + cfg = rvu_read64(rvu, blkaddr, NPC_AF_INTFX_LIDX_LTX_LDX_CFG(intf, lid, lt, ld)); + hdr = FIELD_GET(NPC_HDR_OFFSET, cfg); + key = FIELD_GET(NPC_KEY_OFFSET, cfg); + + /* Update use_hash(bit-20) to 'true' and + * bytesm1(bit-16:19) to '0x3' in KEX_LD_CFG + */ + cfg = KEX_LD_CFG_USE_HASH(0x1, 0x03, + hdr, 0x1, 0x0, key); return cfg; } @@ -132,11 +133,13 @@ static void npc_program_mkex_hash_rx(struct rvu *rvu, int blkaddr, for (lt = 0; lt < NPC_MAX_LT; lt++) { for (ld = 0; ld < NPC_MAX_LD; ld++) { if (mkex_hash->lid_lt_ld_hash_en[intf][lid][lt][ld]) { - u64 cfg = npc_update_use_hash(lt, ld); + u64 cfg; if (hash_cnt == NPC_MAX_HASH) return; + cfg = npc_update_use_hash(rvu, blkaddr, + intf, lid, lt, ld); /* Set updated KEX configuration */ SET_KEX_LD(intf, lid, lt, ld, cfg); /* Set HASH configuration */ @@ -170,11 +173,13 @@ static void npc_program_mkex_hash_tx(struct rvu *rvu, int blkaddr, for (lt = 0; lt < NPC_MAX_LT; lt++) { for (ld = 0; ld < NPC_MAX_LD; ld++) if (mkex_hash->lid_lt_ld_hash_en[intf][lid][lt][ld]) { - u64 cfg = npc_update_use_hash(lt, ld); + u64 cfg; if (hash_cnt == NPC_MAX_HASH) return; + cfg = npc_update_use_hash(rvu, blkaddr, + intf, lid, lt, ld); /* Set updated KEX configuration */ SET_KEX_LD(intf, lid, lt, ld, cfg); /* Set HASH configuration */ @@ -264,44 +269,45 @@ void npc_update_field_hash(struct rvu *rvu, u8 intf, * is hashed to 32 bit value. */ case NPC_LT_LC_IP6: - if (features & BIT_ULL(NPC_SIP_IPV6)) { + /* ld[0] == hash_idx[0] == Source IPv6 + * ld[1] == hash_idx[1] == Destination IPv6 + */ + if ((features & BIT_ULL(NPC_SIP_IPV6)) && !hash_idx) { u32 src_ip[IPV6_WORDS]; be32_to_cpu_array(src_ip, pkt->ip6src, IPV6_WORDS); - ldata[0] = (u64)src_ip[0] << 32 | src_ip[1]; - ldata[1] = (u64)src_ip[2] << 32 | src_ip[3]; + ldata[1] = (u64)src_ip[0] << 32 | src_ip[1]; + ldata[0] = (u64)src_ip[2] << 32 | src_ip[3]; field_hash = npc_field_hash_calc(ldata, - mkex_hash, - rsp.secret_key, + rsp, intf, hash_idx); npc_update_entry(rvu, NPC_SIP_IPV6, entry, - field_hash, 0, 32, 0, intf); + field_hash, 0, + GENMASK(31, 0), 0, intf); memcpy(&opkt->ip6src, &pkt->ip6src, sizeof(pkt->ip6src)); memcpy(&omask->ip6src, &mask->ip6src, sizeof(mask->ip6src)); - break; - } - - if (features & BIT_ULL(NPC_DIP_IPV6)) { + } else if ((features & BIT_ULL(NPC_DIP_IPV6)) && hash_idx) { u32 dst_ip[IPV6_WORDS]; be32_to_cpu_array(dst_ip, pkt->ip6dst, IPV6_WORDS); - ldata[0] = (u64)dst_ip[0] << 32 | dst_ip[1]; - ldata[1] = (u64)dst_ip[2] << 32 | dst_ip[3]; + ldata[1] = (u64)dst_ip[0] << 32 | dst_ip[1]; + ldata[0] = (u64)dst_ip[2] << 32 | dst_ip[3]; field_hash = npc_field_hash_calc(ldata, - mkex_hash, - rsp.secret_key, + rsp, intf, hash_idx); npc_update_entry(rvu, NPC_DIP_IPV6, entry, - field_hash, 0, 32, 0, intf); + field_hash, 0, + GENMASK(31, 0), 0, intf); memcpy(&opkt->ip6dst, &pkt->ip6dst, sizeof(pkt->ip6dst)); memcpy(&omask->ip6dst, &mask->ip6dst, sizeof(mask->ip6dst)); } + break; } } diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h index 65936f4aeaac..a1c3d987b804 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h @@ -62,8 +62,8 @@ void npc_update_field_hash(struct rvu *rvu, u8 intf, struct flow_msg *omask); void npc_config_secret_key(struct rvu *rvu, int blkaddr); void npc_program_mkex_hash(struct rvu *rvu, int blkaddr); -u32 npc_field_hash_calc(u64 *ldata, struct npc_mcam_kex_hash *mkex_hash, - u64 *secret_key, u8 intf, u8 hash_idx); +u32 npc_field_hash_calc(u64 *ldata, struct npc_get_field_hash_info_rsp rsp, + u8 intf, u8 hash_idx); static struct npc_mcam_kex_hash npc_mkex_hash_default __maybe_unused = { .lid_lt_ld_hash_en = { From patchwork Wed May 3 07:09:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1136055vqo; Wed, 3 May 2023 00:24:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/NsDUTdhtUnLRbF9ZH0sIXmN8YaJNRd6sGlrWgSRN8AxkRu2VoAfQNnUbkY7BUr3Zihb1 X-Received: by 2002:a17:902:ce8e:b0:1aa:efad:f2d4 with SMTP id f14-20020a170902ce8e00b001aaefadf2d4mr1410210plg.63.1683098665763; Wed, 03 May 2023 00:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098665; cv=none; d=google.com; s=arc-20160816; b=yFACS3Y7EA7nSTZiG4wUs0UaZ6ucDTYKh8spdWEehKOECfs7P1KI/vcJZEZBOrUpYn lBQxLcqSU5Mok0WKxLLNl2NYzS8bWISvU28dumnv/ApWnFwp/CeZphVCnuKQxSvmR4lF omKLhutElaMAGrJB6UkdU+4oJgm1QJHzcR4IZ19UBt8dMnjz5WRfmdXLbSBtR3npVhIL gMCp5cQmhq4UvMfdEIzEkczv5Y7MObKB2cI0YDscpzGUNjqSoIeDQ5fWZmkwbiypjACE HiBibmGV/3gqNm9QY6KqArVbV2i40wSloyEuKr0fGxFrBzxy7Tq/EIhMM7qcaW65q8I2 +cRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xZvyToeaK1W2JT4JkTnQw9ZfFcsIfpcDBm8H0SF0wso=; b=p3De0zR6+TkshiUfpcJXp3UbU6g+wq9CgjToFTGlKX9YudXxgn45M8QqnUrATyTgLP I562UbO1TRwYfJju+Ywk0v0BJLxmEvFr4gaPcng4KOBiiHKPCX47aVhJqpy7FQZ3cwgZ w4WbfRHyjxBbREvKDsNAp7Ddhy2OZzh3Q3AwnSdjPcXoQNHN8UqoPsvFoloLitbYJt7m ZN5/8/beFmdplZHsNbYF4AEvHcPgV5lEuzf4Q9OH+/JxXOItejKADfv/X0dIoVBWU8+U 3ZY1Fz2URlpMWGeX+ssp3Xdb/zrX6VmCoVCyJyDL66IoNtc3UidvM1Cbe1fjTg6oZqu3 2BvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=M8hlm53r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a1709026e0100b001a97dac4664si20358943plk.480.2023.05.03.00.24.09; Wed, 03 May 2023 00:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=M8hlm53r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229506AbjECHLl (ORCPT + 99 others); Wed, 3 May 2023 03:11:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjECHLh (ORCPT ); Wed, 3 May 2023 03:11:37 -0400 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32CB4272A; Wed, 3 May 2023 00:11:02 -0700 (PDT) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 342K7RTd026341; Wed, 3 May 2023 00:10:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=xZvyToeaK1W2JT4JkTnQw9ZfFcsIfpcDBm8H0SF0wso=; b=M8hlm53r6aY1z9TGwFLE/i9hUPTptJag634iKyA8R9kCq0dCmlrbW/lURluNyRMxeeQK hMnNrFbCCWBOg/hcmwG4DgalTkpBY7PWEGZJwx0VrYrym3Y9fwRMxyQtWUDgaESBcBSH tuuTWFfCrCrAAcs4ziEXyxmqBKYGpK+NbO5OD9s+EMdPsopG+3h2VZ4DIJ1ENSSExIzy GxTycctVhrl1Zv7udxIHALnjQ3SLrJoMr/EqbY2s9/dd2OC6/HYbMmXWQTC1f5AmGfir 1dNsKHfC465zMX2I/6rv9mrQptz8CLqxX6KpFAfHNtNZAMmd+hzZkepZ8Xt3zaE+HBag QA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qavhenaxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:37 -0700 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; Wed, 3 May 2023 00:10:35 -0700 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; Wed, 3 May 2023 00:10:35 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 9DCB53F707B; Wed, 3 May 2023 00:10:30 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Ratheesh Kannoth , Sai Krishna Subject: [net PATCH v5 09/11] octeontx2-af: Skip PFs if not enabled Date: Wed, 3 May 2023 12:39:42 +0530 Message-ID: <20230503070944.960190-10-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: f4RQxnCKosFmbiW1WFrFoL_YWzPmICC_ X-Proofpoint-GUID: f4RQxnCKosFmbiW1WFrFoL_YWzPmICC_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856866407366971?= X-GMAIL-MSGID: =?utf-8?q?1764856866407366971?= From: Ratheesh Kannoth Firmware enables PFs and allocate mbox resources for each of the PFs. Currently PF driver configures mbox resources without checking whether PF is enabled or not. This results in crash. This patch fixes this issue by skipping disabled PF's mbox initialization. Fixes: 9bdc47a6e328 ("octeontx2-af: Mbox communication support btw AF and it's VFs") Signed-off-by: Ratheesh Kannoth Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna --- .../net/ethernet/marvell/octeontx2/af/mbox.c | 5 +- .../net/ethernet/marvell/octeontx2/af/mbox.h | 3 +- .../net/ethernet/marvell/octeontx2/af/rvu.c | 49 +++++++++++++++---- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.c b/drivers/net/ethernet/marvell/octeontx2/af/mbox.c index 2898931d5260..9690ac01f02c 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.c @@ -157,7 +157,7 @@ EXPORT_SYMBOL(otx2_mbox_init); */ int otx2_mbox_regions_init(struct otx2_mbox *mbox, void **hwbase, struct pci_dev *pdev, void *reg_base, - int direction, int ndevs) + int direction, int ndevs, unsigned long *pf_bmap) { struct otx2_mbox_dev *mdev; int devid, err; @@ -169,6 +169,9 @@ int otx2_mbox_regions_init(struct otx2_mbox *mbox, void **hwbase, mbox->hwbase = hwbase[0]; for (devid = 0; devid < ndevs; devid++) { + if (!test_bit(devid, pf_bmap)) + continue; + mdev = &mbox->dev[devid]; mdev->mbase = hwbase[devid]; mdev->hwbase = hwbase[devid]; diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h index 4c1e374bb376..6389ed83637d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h @@ -96,9 +96,10 @@ void otx2_mbox_destroy(struct otx2_mbox *mbox); int otx2_mbox_init(struct otx2_mbox *mbox, void __force *hwbase, struct pci_dev *pdev, void __force *reg_base, int direction, int ndevs); + int otx2_mbox_regions_init(struct otx2_mbox *mbox, void __force **hwbase, struct pci_dev *pdev, void __force *reg_base, - int direction, int ndevs); + int direction, int ndevs, unsigned long *bmap); void otx2_mbox_msg_send(struct otx2_mbox *mbox, int devid); int otx2_mbox_wait_for_rsp(struct otx2_mbox *mbox, int devid); int otx2_mbox_busy_poll_for_rsp(struct otx2_mbox *mbox, int devid); diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index 8683ce57ed3f..9f673bda9dbd 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c @@ -2282,7 +2282,7 @@ static inline void rvu_afvf_mbox_up_handler(struct work_struct *work) } static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr, - int num, int type) + int num, int type, unsigned long *pf_bmap) { struct rvu_hwinfo *hw = rvu->hw; int region; @@ -2294,6 +2294,9 @@ static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr, */ if (type == TYPE_AFVF) { for (region = 0; region < num; region++) { + if (!test_bit(region, pf_bmap)) + continue; + if (hw->cap.per_pf_mbox_regs) { bar4 = rvu_read64(rvu, BLKADDR_RVUM, RVU_AF_PFX_BAR4_ADDR(0)) + @@ -2315,6 +2318,9 @@ static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr, * RVU_AF_PF_BAR4_ADDR register. */ for (region = 0; region < num; region++) { + if (!test_bit(region, pf_bmap)) + continue; + if (hw->cap.per_pf_mbox_regs) { bar4 = rvu_read64(rvu, BLKADDR_RVUM, RVU_AF_PFX_BAR4_ADDR(region)); @@ -2343,20 +2349,41 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, int err = -EINVAL, i, dir, dir_up; void __iomem *reg_base; struct rvu_work *mwork; + unsigned long *pf_bmap; void **mbox_regions; const char *name; + u64 cfg; - mbox_regions = kcalloc(num, sizeof(void *), GFP_KERNEL); - if (!mbox_regions) + pf_bmap = bitmap_zalloc(num, GFP_KERNEL); + if (!pf_bmap) return -ENOMEM; + /* RVU VFs */ + if (type == TYPE_AFVF) + bitmap_set(pf_bmap, 0, num); + + if (type == TYPE_AFPF) { + /* Mark enabled PFs in bitmap */ + for (i = 0; i < num; i++) { + cfg = rvu_read64(rvu, BLKADDR_RVUM, RVU_PRIV_PFX_CFG(i)); + if (cfg & BIT_ULL(20)) + set_bit(i, pf_bmap); + } + } + + mbox_regions = kcalloc(num, sizeof(void *), GFP_KERNEL); + if (!mbox_regions) { + err = -ENOMEM; + goto free_bitmap; + } + switch (type) { case TYPE_AFPF: name = "rvu_afpf_mailbox"; dir = MBOX_DIR_AFPF; dir_up = MBOX_DIR_AFPF_UP; reg_base = rvu->afreg_base; - err = rvu_get_mbox_regions(rvu, mbox_regions, num, TYPE_AFPF); + err = rvu_get_mbox_regions(rvu, mbox_regions, num, TYPE_AFPF, pf_bmap); if (err) goto free_regions; break; @@ -2365,7 +2392,7 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, dir = MBOX_DIR_PFVF; dir_up = MBOX_DIR_PFVF_UP; reg_base = rvu->pfreg_base; - err = rvu_get_mbox_regions(rvu, mbox_regions, num, TYPE_AFVF); + err = rvu_get_mbox_regions(rvu, mbox_regions, num, TYPE_AFVF, pf_bmap); if (err) goto free_regions; break; @@ -2396,16 +2423,19 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, } err = otx2_mbox_regions_init(&mw->mbox, mbox_regions, rvu->pdev, - reg_base, dir, num); + reg_base, dir, num, pf_bmap); if (err) goto exit; err = otx2_mbox_regions_init(&mw->mbox_up, mbox_regions, rvu->pdev, - reg_base, dir_up, num); + reg_base, dir_up, num, pf_bmap); if (err) goto exit; for (i = 0; i < num; i++) { + if (!test_bit(i, pf_bmap)) + continue; + mwork = &mw->mbox_wrk[i]; mwork->rvu = rvu; INIT_WORK(&mwork->work, mbox_handler); @@ -2414,8 +2444,7 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, mwork->rvu = rvu; INIT_WORK(&mwork->work, mbox_up_handler); } - kfree(mbox_regions); - return 0; + goto free_regions; exit: destroy_workqueue(mw->mbox_wq); @@ -2424,6 +2453,8 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw, iounmap((void __iomem *)mbox_regions[num]); free_regions: kfree(mbox_regions); +free_bitmap: + bitmap_free(pf_bmap); return err; } From patchwork Wed May 3 07:09:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1143246vqo; Wed, 3 May 2023 00:42:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nKReOxwA9rh3bZDUX0GeskqTVafq1+ODESaPJ22Gy52CVtABlvgOEea/9gFVTXsge3o3y X-Received: by 2002:a17:903:1d2:b0:1a9:581e:d809 with SMTP id e18-20020a17090301d200b001a9581ed809mr1263961plh.7.1683099730833; Wed, 03 May 2023 00:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099730; cv=none; d=google.com; s=arc-20160816; b=eNFIx9GW/pu0cQb5no3nelpR1Y9Mqjavh1PEmT7sIvDKPBAdGHAZl/puf+Sr2CBOmo 5HlFh3Unc+B5xi1F71N8UwKEQWACI4NHXZxeNHN6sGTWm4036Ff9Ls2ZsK+F+qvso06F Ssmaol0HabEGLZd+/CNOu6jI08xoVpzwCDmYKNvVtOysv2sOgOnFjWQNObZOeAPTVxSe JXWFnIMTeO+Jm8l3X0JmcG2crbwKeNti+yQOTGaprs1+aoogvn/7ik8Q+2EVI8VN0gHV /ckHrU3B8FCCMBD3DFbjaBIALSsc+eQTToT5Sv3oUkZW89xeL0AO5IgZlpDAR/XBn8sq +GPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=twsPib4scJxgTJGR3BfshOH9AmiqKYWWC6vegve+jxE=; b=NePFLitjYAH8+yP7JOCuhUtD6XenJDpptaPrAf3rJc2F9Kdp8L2sSnoREe2u01l3PN PcU8iTNYMTEnOAEF3v3am0lt0UU6KN1v8y/duwB1+BiLDk1NUOd6H2E0u3l4yos94OUI hrhjYlvYUM32AI3DUCcqcGJUWdhi51mx+fi2aRafDVGub/EClmTPYB6XYqDu99NRcM9y 9WHxrW9bRkrAcqKpMq+atk6mt7YhwWA03Iff4qLTSxucNDhZuj1sOyiqBExceVZF1o4g IsBTmT0QkMhfx0AOds5OaenxbKXuv+3EQP0kubRT/qO6ItjqLgAXhE+4SuCwUHo9dpHK Mr/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=PCv1IGAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik2-20020a170902ab0200b001a69f1cea63si30984677plb.223.2023.05.03.00.41.55; Wed, 03 May 2023 00:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=PCv1IGAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjECHMB (ORCPT + 99 others); Wed, 3 May 2023 03:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbjECHL7 (ORCPT ); Wed, 3 May 2023 03:11:59 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 860CA46A8; Wed, 3 May 2023 00:11:27 -0700 (PDT) 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 3436ACT0003519; Wed, 3 May 2023 00:10:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=twsPib4scJxgTJGR3BfshOH9AmiqKYWWC6vegve+jxE=; b=PCv1IGAPYRSra/Ya78e2yJTN5rnAyMYT5qPWwAcS+25JFKrNfbPvZWBAvdy9+0js7Fbh jeH9IBmFuB9/s12z5Q0XqAfyf0oPSfJnNB+He34i9ghYdKuwspIizYtzlrVwvErujaTj 7ORqhGc9NDs1zQr0vnq+3qIfOTSrarBWN0iyjShwRuV8WHgoyQGx3ImQVh9wRDKTJavV eqUcPpiDnhga+VcIDTR+ZpCOb0ijdsABNPsj61JBVmsNYdeSUNHGjKmWoW33mPromi87 Zv8BIuOpXtlJbepzROC2ygVjoph1TwZdWSkd7WCKZK0rvVdt3t2Lnq1L7CbP4jzy/rvq eA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m9p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:41 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:10:39 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 3 May 2023 00:10:39 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 855583F7075; Wed, 3 May 2023 00:10:35 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Sai Krishna Subject: [net PATCH v5 10/11] octeontx2-pf: Disable packet I/O for graceful exit Date: Wed, 3 May 2023 12:39:43 +0530 Message-ID: <20230503070944.960190-11-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 3uLSDk6Ny9uxY9ZHzgQWmTRROiJZ0rpz X-Proofpoint-GUID: 3uLSDk6Ny9uxY9ZHzgQWmTRROiJZ0rpz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764857982974928605?= X-GMAIL-MSGID: =?utf-8?q?1764857982974928605?= From: Subbaraya Sundeep At the stage of enabling packet I/O in otx2_open, If mailbox timeout occurs then interface ends up in down state where as hardware packet I/O is enabled. Hence disable packet I/O also before bailing out. Fixes: 1ea0166da050 ("octeontx2-pf: Fix the device state on error") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index a75c944cc739..18284ad75157 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1835,13 +1835,22 @@ int otx2_open(struct net_device *netdev) otx2_dmacflt_reinstall_flows(pf); err = otx2_rxtx_enable(pf, true); - if (err) + /* If a mbox communication error happens at this point then interface + * will end up in a state such that it is in down state but hardware + * mcam entries are enabled to receive the packets. Hence disable the + * packet I/O. + */ + if (err == EIO) + goto err_disable_rxtx; + else if (err) goto err_tx_stop_queues; otx2_do_set_rx_mode(pf); return 0; +err_disable_rxtx: + otx2_rxtx_enable(pf, false); err_tx_stop_queues: netif_tx_stop_all_queues(netdev); netif_carrier_off(netdev); From patchwork Wed May 3 07:09:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Gajula X-Patchwork-Id: 89590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1136315vqo; Wed, 3 May 2023 00:25:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sqA0FNUg6l9dF8HaEWkKxpkKyWFQld4E2Tr8KVvEYVsTyqdbn/ZXuRev8NMaeqc+X6LWT X-Received: by 2002:a17:902:b20e:b0:1a9:3a8c:d590 with SMTP id t14-20020a170902b20e00b001a93a8cd590mr1085793plr.16.1683098701345; Wed, 03 May 2023 00:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098701; cv=none; d=google.com; s=arc-20160816; b=C4lORX72XcoQK2oRNafDhJCuzY/N8Bb/R4LtzqtCwHnXRrsaR5OFiGELVGEKPAzOEb 65OOchqNOkiQSHq95KAPlFC40s76C0KqDUUDzqdUAlo0BGWTto/nVyauQX8h8xPl4L/W MpdsnumJVyGLZGqI/RI0+K+NIRK6KAN4XjpnV1pteLm8ZmiZOjMNnlEzV3Ruq1sYO1Th K0SAuMiDuMpquf+ugjULhB3X5+CSpWJrdN3nDDPtU4uSV4iCAJ9W//ydUIoBt0yGSzE9 +rcqP9ruyuJPkn1E6/G5R6J2i4iA7m5mG0cspnSYqodmo9vuYalfug9m1ufMstLHqWH2 GJgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5HrD54QwttedTiMCbzETL8O5YJkhYL91l0aEKVc53W0=; b=DQcSKkRowyduVIWq9cDOUGaUYeWRa3BeLqTZWgLyAFURVWAsy/CoRiMaZQ4lb1SwE/ 8OhWCnRLsgABDeAyp8HtVVRyp33h62XLvY6eDjyxEgE2fJIcCkiw1KW5F9nmsY3JbqCx BHw2EO2d3kAixKiOSfjSBpP6HxUxgIaxqul09Bz6/GDVNseWjkf+uchg3p857hZkli0s mXXcIx/ZJw/zcF2sdQmgxii8mJz5xBHu8o0hJEIKBayNw6ZO5hrXp/nasl1Dgq0b5wNh uJKPOqiZqrG0jEqndcWRQFx6poagwAyZzkEK2/2NDfy0Jam5uhhm14blG88da9724MFQ xMRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=KqSEDTN5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a170902eb8800b001a6933b3a67si31584174plg.531.2023.05.03.00.24.46; Wed, 03 May 2023 00:25:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=KqSEDTN5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbjECHM0 (ORCPT + 99 others); Wed, 3 May 2023 03:12:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjECHMY (ORCPT ); Wed, 3 May 2023 03:12:24 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2892E468F; Wed, 3 May 2023 00:11:56 -0700 (PDT) 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 3436AsGX004505; Wed, 3 May 2023 00:10:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=5HrD54QwttedTiMCbzETL8O5YJkhYL91l0aEKVc53W0=; b=KqSEDTN5lU160vpS6cZapxPknbFsU6JDncNM9rAP0az1osAG4kPGRNUpcY2AkgT2rG5N IfglSHxkwaQI56zBEDn+TKPgYWR1YHalbRpWLlzbYkmExOB2f+6ld6wO/3wXJLHQkBSo 0tkYa9+yCX0QS1yZ/l26UQcJzfXXpitMe8De7gZlGklB1lky+t2PjguATwaHuDbjQqoV swH/HpgajkdbSEIY/Ct4LrbIIvIuRchqWCUKsE19dyx4wqXVYSawDdsFG8S51LLXPQHx lk+Ai+trl3/x45ZJERxYvO2ssX3nRfwAWYSBD2W9e3s/uhab99dPGmHUIR7VlpqZPiJ2 dw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q92rp3m9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 03 May 2023 00:10:46 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 May 2023 00:10:44 -0700 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; Wed, 3 May 2023 00:10:44 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 306F53F7082; Wed, 3 May 2023 00:10:39 -0700 (PDT) From: Sai Krishna To: , , , , , , , , , , , , , CC: Sai Krishna Subject: [net PATCH v5 11/11] octeontx2-vf: Detach LF resources on probe cleanup Date: Wed, 3 May 2023 12:39:44 +0530 Message-ID: <20230503070944.960190-12-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230503070944.960190-1-saikrishnag@marvell.com> References: <20230503070944.960190-1-saikrishnag@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: pOqeATa9YBOPTqoNVwqYwlAeXMd_-Ptn X-Proofpoint-GUID: pOqeATa9YBOPTqoNVwqYwlAeXMd_-Ptn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-03_04,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764856904171266951?= X-GMAIL-MSGID: =?utf-8?q?1764856904171266951?= From: Subbaraya Sundeep When a VF device probe fails due to error in MSIX vector allocation then the resources NIX and NPA LFs were not detached. Fix this by detaching the LFs when MSIX vector allocation fails. Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c index ab126f8706c7..53366dbfbf27 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c @@ -621,7 +621,7 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id) err = otx2vf_realloc_msix_vectors(vf); if (err) - goto err_mbox_destroy; + goto err_detach_rsrc; err = otx2_set_real_num_queues(netdev, qcount, qcount); if (err)