mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srujana Challa <schalla@marvell.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <kuba@kernel.org>, <davem@davemloft.net>, <pabeni@redhat.com>,
	<sgoutham@marvell.com>, <lcherian@marvell.com>,
	<gakula@marvell.com>, <jerinj@marvell.com>, <hkelam@marvell.com>,
	<sbhatta@marvell.com>, <schalla@marvell.com>,
	Michal Mazur <mmazur2@marvell.com>
Subject: [PATCH net,6/6] octeontx2-af: fix detection of IP layer
Date: Mon, 1 Jul 2024 14:37:46 +0530	[thread overview]
Message-ID: <20240701090746.2171565-7-schalla@marvell.com> (raw)
In-Reply-To: <20240701090746.2171565-1-schalla@marvell.com>

From: Michal Mazur <mmazur2@marvell.com>

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 <mmazur2@marvell.com>
---
 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,
-- 
2.25.1


      parent reply	other threads:[~2024-07-01  9:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  9:07 [PATCH net,0/6] Fixes for CPT and RSS configuration Srujana Challa
2024-07-01  9:07 ` [PATCH net,1/6] octeontx2-af: replace cpt slot with lf id on reg write Srujana Challa
2024-07-02 12:54   ` Michal Kubiak
2024-07-09 10:56     ` [EXTERNAL] " Srujana Challa
2024-07-01  9:07 ` [PATCH net,2/6] octeontx2-af: reduce cpt flt interrupt vectors for cn10kb Srujana Challa
2024-07-02 10:28   ` Simon Horman
2024-07-09 11:20     ` [EXTERNAL] " Srujana Challa
2024-07-01  9:07 ` [PATCH net,3/6] Fix CPT_LF_ALLOC mailbox error due to incompatible mailbox message format Srujana Challa
2024-07-02  3:58   ` Kalesh Anakkur Purayil
2024-07-01  9:07 ` [PATCH net,4/6] octeontx2-af: Fix issue with IPv6 ext match for RSS Srujana Challa
2024-07-02  3:57   ` Kalesh Anakkur Purayil
2024-07-01  9:07 ` [PATCH net,5/6] octeontx2-af: fix issue with IPv4 " Srujana Challa
2024-07-01  9:07 ` Srujana Challa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701090746.2171565-7-schalla@marvell.com \
    --to=schalla@marvell.com \
    --cc=davem@davemloft.net \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmazur2@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®