From patchwork Wed Jul 10 07:51:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srujana Challa X-Patchwork-Id: 13728977 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D40B5CB8; Wed, 10 Jul 2024 07:52:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720597973; cv=none; b=emHctS/HsZlARKZD443cudi1q1DyF0TNULE77S56FEgC8R9jH+PYQ+KLb80DyruL4COU6Tl8GPXuTM6GFupOHYLgfM5xTfNM6ybLd/7TGEroIHLoc3qwKswpnOIdc6FGG5eZ5dFW9lDN9ORpS8nMbLGZRUoQG1FRyQbI7umeVGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720597973; c=relaxed/simple; bh=2PFKWkKhSPHmpls7uAOXhTnAwAM9+qDsosLmiGqxaYY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=afiP1otu/QcJOegWBYeUBHMNnETeYG+5GuT8lC/hfVy8lOSAKpK3ICNDvbH2+FQEDNbksBB33ES8vVlSm0qOGnX2w62VsZmAjm8/0fOtQBiKDbJ5DN9rDyGo+g6TxhYWtrBoolQR66Pnlb/G3LdvY1Zhb5HTwFgySP2pGJE6DzI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=FmA8eo6H; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="FmA8eo6H" Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 469MQ88D022710; Wed, 10 Jul 2024 00:52:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=7 IxJjYfcrPnDxCKWi5guGHlYcsizf4wTIbtgyKp8Oas=; b=FmA8eo6H1wTFDfzQr MXrI8VueJh+798a4PFfeUbGJfb5/K9WUyr1VdAe4TuuKPIrPGWNArNImpcQy+Txc t5R5roBUOm/2m+AjTrab5dFipFzL1twjMyod4EOg0hXnxTru55Qwtzmpjfjx/1JA 43EOpO6Z8NucyIyAlVl9GHWPatvluTZt8/v2CnA08w40ucd9zvRUquJFJiwFZ6cj D9FWgvsTVrHzz8kvCmrq2yUS7ho+41IRJySZ+v3RaDhh/Va3uGjBEyiAbSPu9HQ/ LZPLuJp7e5VbSB4f/EMp743hoR6Gjkk4433xWq+8lZjgWylbDg6/npUVmqf287Ok QfL8w== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 409e061p0j-10 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 00:52:39 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 10 Jul 2024 00:51:36 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 10 Jul 2024 00:51:36 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 860063F705E; Wed, 10 Jul 2024 00:51:32 -0700 (PDT) From: Srujana Challa To: , CC: , , , , , , , , , , , Subject: [PATCH net,v2,1/5] octeontx2-af: replace cpt slot with lf id on reg write Date: Wed, 10 Jul 2024 13:21:23 +0530 Message-ID: <20240710075127.2274582-2-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240710075127.2274582-1-schalla@marvell.com> References: <20240710075127.2274582-1-schalla@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Sb8QWzcP8fJ9QMSb_6GRqxDSiogf_-ZU X-Proofpoint-GUID: Sb8QWzcP8fJ9QMSb_6GRqxDSiogf_-ZU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_04,2024-07-09_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org From: Nithin Dabilpuram Replace slot id with global CPT lf id on reg read/write as CPTPF/VF driver would send slot number instead of global lf id in the reg offset. And also update the mailbox response with the global lf's register offset. Fixes: ae454086e3c2 ("octeontx2-af: add mailbox interface for CPT") Signed-off-by: Nithin Dabilpuram --- .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c index f047185f38e0..3e09d2285814 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c @@ -696,7 +696,8 @@ int rvu_mbox_handler_cpt_rd_wr_register(struct rvu *rvu, struct cpt_rd_wr_reg_msg *req, struct cpt_rd_wr_reg_msg *rsp) { - int blkaddr; + u64 offset = req->reg_offset; + int blkaddr, lf; blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr); if (blkaddr < 0) @@ -707,17 +708,25 @@ int rvu_mbox_handler_cpt_rd_wr_register(struct rvu *rvu, !is_cpt_vf(rvu, req->hdr.pcifunc)) return CPT_AF_ERR_ACCESS_DENIED; - rsp->reg_offset = req->reg_offset; - rsp->ret_val = req->ret_val; - rsp->is_write = req->is_write; - if (!is_valid_offset(rvu, req)) return CPT_AF_ERR_ACCESS_DENIED; + /* Translate local LF used by VFs to global CPT LF */ + lf = rvu_get_lf(rvu, &rvu->hw->block[blkaddr], req->hdr.pcifunc, + (offset & 0xFFF) >> 3); + + /* Translate local LF's offset to global CPT LF's offset */ + offset &= 0xFF000; + offset += lf << 3; + + rsp->reg_offset = offset; + rsp->ret_val = req->ret_val; + rsp->is_write = req->is_write; + if (req->is_write) - rvu_write64(rvu, blkaddr, req->reg_offset, req->val); + rvu_write64(rvu, blkaddr, offset, req->val); else - rsp->val = rvu_read64(rvu, blkaddr, req->reg_offset); + rsp->val = rvu_read64(rvu, blkaddr, offset); return 0; } From patchwork Wed Jul 10 07:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srujana Challa X-Patchwork-Id: 13728978 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CC6F84A35; Wed, 10 Jul 2024 07:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720597974; cv=none; b=scmRdzcCEXxyPMNGN+LviVV10/DClWXQmjoQ4AHc4TRrKjUbJLs7F1vkX+n2dv+afnekoW2xoA44L3lwsapo8VNL+jKnrHE8rWUsTZvEbYTbQ9Kr/S4CHHvPOG6oRNKX03P1j+vPAU/JT7fsMj66vZkp/tAH3nu/m1C3eIi0XHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720597974; c=relaxed/simple; bh=eIVbos2XD4Je6J+mf78B3iFFLsBdefQ6yifI0hbuD5c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qVP1+PbGNGJFllzmOEatOkIfRl6pTeDWlYcVmzls5UWyrGZHnP2KHsp1YCr4X8ALre5KyvZjNmD79hEr2rsGK51wn3kxbFeaSymtKJm+/c0CmSABWAa7ep3eH/9SyBtS+SEHOjeDRdaTk4GG/YBOxGf/W6V939xrv498yxi5cBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=cDI2ka7l; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="cDI2ka7l" Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 469MQ88G022710; Wed, 10 Jul 2024 00:52:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=p S4YU6KdoF8N9+LP2mHo9d//wu3XtoCeyxcLahOE++s=; b=cDI2ka7lflnbfDtit 9hVD/8+o6SHcNHKXK68Yi800ZGupVwgNoi8Fc+S9pFaqa/oqiJmLU6YoDhM0UhRp WGKwZZBI6OCVSXNo5aOPeC2BlJKFt0v2sIZIrkLkaC9ki1jfGMT7U5xPWrVEJnXD S1xPAPqdBfffvvc4bGt7BA/BMaoosarxNpnN8lBUUMqkN3BysMn4MpzlMwI3NEBx KDyJKj56kZcma8Tt/dPjZcRN8BWt9Po6ucd7bHZGRTAxIcrDUgAFyrbOUeyJn/cn r0RaQSw7CBfaV4G3lMfbRwDgp2WzAxkRNwlM39PhZzU2u0MGwGZ8D1WNhM8oYi6s yM8kQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 409e061p0j-15 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 00:52:41 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 10 Jul 2024 00:51:41 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 10 Jul 2024 00:51:41 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 020573F7053; Wed, 10 Jul 2024 00:51:36 -0700 (PDT) From: Srujana Challa To: , CC: , , , , , , , , , , , Subject: [PATCH net,v2,2/5] octeontx2-af: fix a issue with cpt_lf_alloc mailbox Date: Wed, 10 Jul 2024 13:21:24 +0530 Message-ID: <20240710075127.2274582-3-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240710075127.2274582-1-schalla@marvell.com> References: <20240710075127.2274582-1-schalla@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 09NRuJwtDUXMw5gTKtX-LlYFXp5KOpXo X-Proofpoint-GUID: 09NRuJwtDUXMw5gTKtX-LlYFXp5KOpXo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_04,2024-07-09_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org This patch fixes CPT_LF_ALLOC mailbox error due to incompatible mailbox message format. Specifically, it corrects the `blkaddr` field type from `int` to `u8`. Fixes: de2854c87c64 ("octeontx2-af: Mailbox changes for 98xx CPT block") Signed-off-by: Srujana Challa --- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h index 4a77f6fe2622..05b84581d5c5 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h @@ -1745,7 +1745,7 @@ struct cpt_lf_alloc_req_msg { u16 nix_pf_func; u16 sso_pf_func; u16 eng_grpmsk; - int blkaddr; + u8 blkaddr; u8 ctx_ilen_valid : 1; u8 ctx_ilen : 7; }; From patchwork Wed Jul 10 07:51:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srujana Challa X-Patchwork-Id: 13728979 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CC2B84A32; Wed, 10 Jul 2024 07:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720597974; cv=none; b=nrQh+gNkMcZVsEvK6fyGgDXyJ+ajAtcRikabNT56x/miVGUKEbmar8ibqi2IQFqLyf+QW/1X1Wn0dbw3k3iKpkRQUy0r9KIfCITFIrx4tjUtEdhTjcAp3kX5Mv/yBDf9Joh5Lu9HEernoEFiV/n9z+zir5djDixVRYrNSHFkwmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720597974; c=relaxed/simple; bh=23OqGtViRO+FNeourWoZ9oF1aPoZU5Rk4prGQEEejxQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hUr1zUN7ILfVYvPqKbqQ6CXaItpH+Ur/f+znPs7TPnOeUAmQUwNpY27alxUKblPYKTPHTYKzedDcoZOXTlizjMpjyCziQidDtDn07WnnJ0O/MxKzUa4r4WQaBxmH0Y2h6jKiOZfvn+bMR95Rz1E1v9uEM5YqF3Bh08kjPrhWNb4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=DjUCqcId; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="DjUCqcId" Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 469MQ88H022710; Wed, 10 Jul 2024 00:52:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=L fV0iUwMPlR6+YJA4wPhDpZHuZdSVdwXPJvsXWH8CPA=; b=DjUCqcIdGhXSSh0J0 gSgX/+Cr7dJVfl2XstrcsHrMm2vQUVLdVZElcNiVI1gw1dz91J6vf1w+0QQv6u9g fxTHIq99iOu10kpuu3Th8EYR0nfIYZRMb/BqCvl4LkHYJYS9NfRvcasvKD9zc5sA A513a96sro6Iwx8rk+1DZ+VEEL8Peo2eSp/o5N9uqDOyh6eQbUr6N3snyCEBzBqf 8B1qHqWbAryXDT60rGbw5E/MGhDUdjUiJPUsTW/Y+Rqdk2NaM9BLVtj0JU3irSdA /21j25Xx1CiAPAIxf5Pwi3mWqerHYZdaWcwVB66Pqx/zhCZLyo3Pduu/s0RpEwkr ioe6w== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 409e061p0j-16 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 00:52:41 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 10 Jul 2024 00:51:47 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 10 Jul 2024 00:51:47 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 7D4C23F7053; Wed, 10 Jul 2024 00:51:41 -0700 (PDT) From: Srujana Challa To: , CC: , , , , , , , , , , , , Michal Mazur Subject: [PATCH net,v2,3/5] octeontx2-af: fix detection of IP layer Date: Wed, 10 Jul 2024 13:21:25 +0530 Message-ID: <20240710075127.2274582-4-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240710075127.2274582-1-schalla@marvell.com> References: <20240710075127.2274582-1-schalla@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 8U4rMYCh-zJe3Ex_xQZBHT1lWmjzP3A0 X-Proofpoint-GUID: 8U4rMYCh-zJe3Ex_xQZBHT1lWmjzP3A0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_04,2024-07-09_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org From: Michal Mazur Checksum and length checks are not enabled for IPv4 header with options and IPv6 with extension headers. To fix this a change in enum npc_kpu_lc_ltype is required which will allow adjustment of LTYPE_MASK to detect all types of IP headers. Fixes: 21e6699e5cd6 ("octeontx2-af: Add NPC KPU profile") Signed-off-by: Michal Mazur --- drivers/net/ethernet/marvell/octeontx2/af/npc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/npc.h b/drivers/net/ethernet/marvell/octeontx2/af/npc.h index d883157393ea..6c3aca6f278d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/npc.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/npc.h @@ -63,8 +63,13 @@ enum npc_kpu_lb_ltype { NPC_LT_LB_CUSTOM1 = 0xF, }; +/* Don't modify ltypes up to IP6_EXT, otherwise length and checksum of IP + * headers may not be checked correctly. IPv4 ltypes and IPv6 ltypes must + * differ only at bit 0 so mask 0xE can be used to detect extended headers. + */ enum npc_kpu_lc_ltype { - NPC_LT_LC_IP = 1, + NPC_LT_LC_PTP = 1, + NPC_LT_LC_IP, NPC_LT_LC_IP_OPT, NPC_LT_LC_IP6, NPC_LT_LC_IP6_EXT, @@ -72,7 +77,6 @@ enum npc_kpu_lc_ltype { NPC_LT_LC_RARP, NPC_LT_LC_MPLS, NPC_LT_LC_NSH, - NPC_LT_LC_PTP, NPC_LT_LC_FCOE, NPC_LT_LC_NGIO, NPC_LT_LC_CUSTOM0 = 0xE, From patchwork Wed Jul 10 07:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srujana Challa X-Patchwork-Id: 13728981 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC5E084FDF; Wed, 10 Jul 2024 07:53:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720598026; cv=none; b=qEF9c6YW8/xUam9Byc5J2qzdt8QNApGgK1ed0xb4aUo3BbP/QtSeRXPdP7ocV5tbsAOGFCop7VT1yfAo4qBK/3SZPoDxO02i70G7Mm4HkdLuu8Lh7HMg6PIKAqFMwjGotqwvajc4pqYE4rKeUfuIMu2ukqa7x6iKT2SlV5Cg8/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720598026; c=relaxed/simple; bh=tHLm/CprBaxtO6ChlniHmP+14Mp3ng7MvaO5a0kIMyk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z0uv5GR5w+T+dkv9p22BdHatazAJrmTsRvgzgTYn/c+WYnZZecELKS4n9m7bGGYznZ1TaGf2df/zz65f+ZRrq/kroo/XWNH13LzmISPf15TNvLjzUDrBWEdsd5TUV70O3+lRumsquDCzQ7sB69UDEopoJAvMjK0pM8liXZUAe4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=KSXItV93; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="KSXItV93" Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 469MPZGX021946; Wed, 10 Jul 2024 00:53:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=A g+jAFLncsOkoJiPCqGY59zRTAbGvg4vbCN6QizNtpo=; b=KSXItV93lZOIhdfom rZ0XnJAwIE6b7s7duBALkoQpqiv3ETjJPT0FuoXmljRXjKeQ0DnG+PSSB1ruVfB+ YZ5R9kGNObgrN+KEJKIIX8QmPjW9HOUlOWgevO41zOC3tJ0LNFOvtfSDNtxLnIEZ imt9iLsYS9zDWKhfs3EwDdRiO2mWLjwHvYhatAG0bi8w2TevUCahJTa/4IxL/UPp mKG9+Kp3+H5Hmmss0HK+5oH7gpGBWSHRl+Wlbfy7p5DPbdIiUmONibSUO4aupK0d p4Q7dUReqbdpP2DqDzPLtWFFPIrX3pfj1R4uLHr9xdAMurhcsr9Elers+mQcGwO3 1l+Aw== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 409e061p7r-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 00:53:39 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 10 Jul 2024 00:51:51 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 10 Jul 2024 00:51:51 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id B39083F7089; Wed, 10 Jul 2024 00:51:46 -0700 (PDT) From: Srujana Challa To: , CC: , , , , , , , , , , , , Kiran Kumar K Subject: [PATCH net,v2,4/5] octeontx2-af: fix issue with IPv6 ext match for RSS Date: Wed, 10 Jul 2024 13:21:26 +0530 Message-ID: <20240710075127.2274582-5-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240710075127.2274582-1-schalla@marvell.com> References: <20240710075127.2274582-1-schalla@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: IG5EmdVX6nxQAwVYpDK3nnWFNFriNZzW X-Proofpoint-GUID: IG5EmdVX6nxQAwVYpDK3nnWFNFriNZzW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_04,2024-07-09_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org From: Kiran Kumar K While performing RSS based on IPv6, extension ltype is not being considered. This will be problem for fragmented packets or packets with extension header. Adding changes to match IPv6 ext header along with IPv6 ltype. Fixes: 41a7aa7b800d ("octeontx2-af: NIX Rx flowkey configuration for RSS") Signed-off-by: Kiran Kumar K Reviewed-by: Kalesh AP --- drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index 00af8888e329..19fe3ed5c0ee 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -3864,6 +3864,9 @@ static int get_flowkey_alg_idx(struct nix_hw *nix_hw, u32 flow_cfg) return -ERANGE; } +/* Mask to match ipv6(NPC_LT_LC_IP6) and ipv6 ext(NPC_LT_LC_IP6_EXT) */ +#define NPC_LT_LC_IP6_MATCH_MSK ((~(NPC_LT_LC_IP6 ^ NPC_LT_LC_IP6_EXT)) & 0xf) + static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg) { int idx, nr_field, key_off, field_marker, keyoff_marker; @@ -3990,7 +3993,7 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg) field->bytesm1 = 15; /* DIP,16 bytes */ } } - field->ltype_mask = 0xF; /* Match only IPv6 */ + field->ltype_mask = NPC_LT_LC_IP6_MATCH_MSK; break; case NIX_FLOW_KEY_TYPE_TCP: case NIX_FLOW_KEY_TYPE_UDP: From patchwork Wed Jul 10 07:51:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srujana Challa X-Patchwork-Id: 13728982 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DA928563E; Wed, 10 Jul 2024 07:53:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720598026; cv=none; b=JofqR9QJeSUFd/lfVuz9oFmRGQStXMPWmDfConPy+mB7SDfMOLkcgvVVht3Yb3R6GnqsNhoAUt5GbWv8j8QWXa68HZqzxIofz4jUSsP0HiiMsd23dq7eWUMzB4yAlNNjfrhJY+9ajfL3TyWzUts8bTawlWdKN977p4WIaCGvWxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720598026; c=relaxed/simple; bh=2tNka/XCqF1S0Kd3D2qMLaGepB8cZWlWto0t3iWI0fc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SmTWEF6DfB2BP8RcyvNP0THtCZasSyndsU2lP+UkHBtjH5Oimp0e79v+U22/VYSaH3VVM2i1/kflwPNEqXrivmLljonq7Yu2QyPO6hlXUrcq3cItPeLBj+IYiPAwpFIVhP5fx3y6TKE2Us0eZliWGryZQ/KQfFVDhLFBUkd8kYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=iavt2zUh; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="iavt2zUh" Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 469MPZGY021946; Wed, 10 Jul 2024 00:53:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=E OQPGU4QRB4TebF7CqTQwipvo1iFyJ4qNEXfA5XULdQ=; b=iavt2zUhuECBNMoBv EjOZiOoc5FwIC8MiShqhxZCjIy7pebms++6YPgP+lvAHyQfkZdyeV1xZK9DOYqYG /oHtiDu2W53SffdET3gnPWO170u36JoeYts7ICl4dH1I8ydhXuDnm59Ul6ur8tUD 9Dp8Mug9wo18qbYX6sKUcVtuDs/jWM+QIFsissv7++hN9dCZtUEBPw2GOzkrvUV3 FKTUVXYkB1frxr3vfFVGsHCxWQ1SqenEdqpe8kz/dIhGT3p2OJVJAFU4DeCVPvY+ PTjziNYr8RPI3HH9UY99pPz6Suop33TJACvnReWVkki3bvG4ApC4HqRXoTVH8RtC GbtVg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 409e061p7r-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 00:53:39 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 10 Jul 2024 00:51:57 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 10 Jul 2024 00:51:57 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 6B6A23F7053; Wed, 10 Jul 2024 00:51:51 -0700 (PDT) From: Srujana Challa To: , CC: , , , , , , , , , , , , Satheesh Paul Subject: [PATCH net,v2,5/5] octeontx2-af: fix issue with IPv4 match for RSS Date: Wed, 10 Jul 2024 13:21:27 +0530 Message-ID: <20240710075127.2274582-6-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240710075127.2274582-1-schalla@marvell.com> References: <20240710075127.2274582-1-schalla@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: PP3nT04FHlwXzp4lWtaSAOmLMA3tpGX8 X-Proofpoint-GUID: PP3nT04FHlwXzp4lWtaSAOmLMA3tpGX8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_04,2024-07-09_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org From: Satheesh Paul While performing RSS based on IPv4, packets with IPv4 options are not being considered. Adding changes to match both plain IPv4 and IPv4 with option header. Fixes: 41a7aa7b800d ("octeontx2-af: NIX Rx flowkey configuration for RSS") Signed-off-by: Satheesh Paul Reviewed-by: Kalesh AP --- drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index 19fe3ed5c0ee..3dc828cf6c5a 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -3866,6 +3866,8 @@ static int get_flowkey_alg_idx(struct nix_hw *nix_hw, u32 flow_cfg) /* Mask to match ipv6(NPC_LT_LC_IP6) and ipv6 ext(NPC_LT_LC_IP6_EXT) */ #define NPC_LT_LC_IP6_MATCH_MSK ((~(NPC_LT_LC_IP6 ^ NPC_LT_LC_IP6_EXT)) & 0xf) +/* Mask to match both ipv4(NPC_LT_LC_IP) and ipv4 ext(NPC_LT_LC_IP_OPT) */ +#define NPC_LT_LC_IP_MATCH_MSK ((~(NPC_LT_LC_IP ^ NPC_LT_LC_IP_OPT)) & 0xf) static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg) { @@ -3936,7 +3938,7 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg) field->hdr_offset = 9; /* offset */ field->bytesm1 = 0; /* 1 byte */ field->ltype_match = NPC_LT_LC_IP; - field->ltype_mask = 0xF; + field->ltype_mask = NPC_LT_LC_IP_MATCH_MSK; break; case NIX_FLOW_KEY_TYPE_IPV4: case NIX_FLOW_KEY_TYPE_INNR_IPV4: @@ -3963,8 +3965,7 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg) field->bytesm1 = 3; /* DIP, 4 bytes */ } } - - field->ltype_mask = 0xF; /* Match only IPv4 */ + field->ltype_mask = NPC_LT_LC_IP_MATCH_MSK; keyoff_marker = false; break; case NIX_FLOW_KEY_TYPE_IPV6: