From patchwork Mon Jul 1 09:07:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srujana Challa X-Patchwork-Id: 13717701 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (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 C715985947; Mon, 1 Jul 2024 09:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719824905; cv=none; b=GamWIEEZAlA5y7mp5QgXGhjQi2TpVtkU53hutDy8OodmDc/Oyn7YZVvqbUbeesE8eHhLQ8irVTZQhIcbOreUfduudv93QaJ4eS5jYjT2al8k/xu9U8RCpuI+dEZn5tNPJZfGrgAsJkmbFX4/R0m2TzNIqSEwmywPqGumj3kAGwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719824905; c=relaxed/simple; bh=23OqGtViRO+FNeourWoZ9oF1aPoZU5Rk4prGQEEejxQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hi1vzwYl6L2KcZO9ZwMIo56b313Gulz8vTTD1tKwadzCtAgfGEyrLPpAaAYm2YYgau7GBtsRQiZhUaHWFgK2sikd2rVaY64XjNgyFgzG5pPo8Totf25OgTnxilYz3UW6uM//CtRb7LLtl7mbKEJXAN1hYOkjF9J+NxTR1zKl62k= 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=cdqsiCEQ; arc=none smtp.client-ip=67.231.156.173 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="cdqsiCEQ" Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45UMw892030613; Mon, 1 Jul 2024 02:08:18 -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=cdqsiCEQxVmyH3tSB XOd1sq7pjjwHpHjD6OVyxlzCrpYKVfya5pyWan01VhWwUekOD9LMPnFQxEJRbsIl WEDErNy+++DepsOmRlz53rxUiIO+pnB8lpPNIOvpwcNVznJkJlHiw0hSu5wxGBjf FlV8AvsrYabxh5N9cdUY1s7SqaaIpHB/E7z9hFZ1eIKm4mbmUCu/zn10xSC7sGgk Hoh5j/xmSYzFuc6tUjYPb8btZQv/otlyJA8ePglf0KrUh1qBERdsxg4Skn5COn0a vGiHI3PMCUWjC+Lv8CymzeIVt2qeZGItEhN3Aj+lTAjIQQYCWrDb761+ByL8B05H N4AGg== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 403207k46b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 Jul 2024 02:08:18 -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; Mon, 1 Jul 2024 02:08:17 -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; Mon, 1 Jul 2024 02:08:17 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 81AA73F705A; Mon, 1 Jul 2024 02:08:13 -0700 (PDT) From: Srujana Challa To: , CC: , , , , , , , , , , Michal Mazur Subject: [PATCH net,6/6] octeontx2-af: fix detection of IP layer Date: Mon, 1 Jul 2024 14:37:46 +0530 Message-ID: <20240701090746.2171565-7-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240701090746.2171565-1-schalla@marvell.com> References: <20240701090746.2171565-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: 2eGvdFN0LGZ17lvV4gnLzRQ4e6X2Gm3H X-Proofpoint-GUID: 2eGvdFN0LGZ17lvV4gnLzRQ4e6X2Gm3H 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-01_07,2024-06-28_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,