From: Mingjin Ye <mingjinx.ye@intel.com>
To: dev@dpdk.org
Cc: Mingjin Ye <mingjinx.ye@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>,
Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [PATCH v2 1/3] net/ice/base: add ipv4 fragment related field
Date: Fri, 24 Jan 2025 09:13:21 +0000 [thread overview]
Message-ID: <20250124091324.403435-2-mingjinx.ye@intel.com> (raw)
In-Reply-To: <20250124091324.403435-1-mingjinx.ye@intel.com>
Added support for the Flags and Fragment Offset fields of ipv4 fragments.
Field definitions are the same as in rte_ipv4_hdr.
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
V2: All names standardised to *_IPV4_FRAG_OFS.
---
drivers/net/ice/base/ice_fdir.h | 2 ++
drivers/net/ice/base/ice_flow.c | 5 +++++
drivers/net/ice/base/ice_flow.h | 1 +
3 files changed, 8 insertions(+)
diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h
index 1bb8a14a5d..3dd03f93f7 100644
--- a/drivers/net/ice/base/ice_fdir.h
+++ b/drivers/net/ice/base/ice_fdir.h
@@ -56,6 +56,7 @@
#define ICE_IPV4_TOS_OFFSET 15
#define ICE_IPV4_ID_OFFSET 18
#define ICE_IPV4_TTL_OFFSET 22
+#define ICE_IPV4_FRAG_OFS 20
#define ICE_IPV6_TC_OFFSET 14
#define ICE_IPV6_HLIM_OFFSET 21
#define ICE_IPV6_PROTO_OFFSET 20
@@ -181,6 +182,7 @@ struct ice_fdir_v4 {
u8 proto;
u8 ttl;
__be16 packet_id;
+ __be16 fragment_offset;
};
#define ICE_IPV6_ADDR_LEN_AS_U32 4
diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 0d64a5bb1e..cdc9ee26c5 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -19,6 +19,7 @@
#define ICE_FLOW_FLD_SZ_TCP_CHKSUM 2
#define ICE_FLOW_FLD_SZ_UDP_CHKSUM 2
#define ICE_FLOW_FLD_SZ_SCTP_CHKSUM 4
+#define ICE_FLOW_FLD_SZ_IPV4_FRAG_OFS 2
#define ICE_FLOW_FLD_SZ_IP_DSCP 1
#define ICE_FLOW_FLD_SZ_IP_TTL 1
#define ICE_FLOW_FLD_SZ_IP_PROT 1
@@ -87,6 +88,9 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = {
/* ICE_FLOW_FIELD_IDX_IPV4_TTL */
ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_NONE, 8,
ICE_FLOW_FLD_SZ_IP_TTL, 0xff00),
+ /* ICE_FLOW_FIELD_IDX_IPV4_FRAG_OFS */
+ ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_IPV_FRAG, 6,
+ ICE_FLOW_FLD_SZ_IPV4_FRAG_OFS, 0x3fff),
/* ICE_FLOW_FIELD_IDX_IPV4_PROT */
ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_NONE, 8,
ICE_FLOW_FLD_SZ_IP_PROT, 0x00ff),
@@ -1459,6 +1463,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
prot_id = ICE_PROT_IPV4_IL_IL;
break;
case ICE_FLOW_FIELD_IDX_IPV4_ID:
+ case ICE_FLOW_FIELD_IDX_IPV4_FRAG_OFS:
prot_id = ICE_PROT_IPV4_OF_OR_S;
break;
case ICE_FLOW_FIELD_IDX_IPV6_SA:
diff --git a/drivers/net/ice/base/ice_flow.h b/drivers/net/ice/base/ice_flow.h
index 65b261beca..6cbddef8c8 100644
--- a/drivers/net/ice/base/ice_flow.h
+++ b/drivers/net/ice/base/ice_flow.h
@@ -239,6 +239,7 @@ enum ice_flow_field {
ICE_FLOW_FIELD_IDX_IPV4_DSCP,
ICE_FLOW_FIELD_IDX_IPV6_DSCP,
ICE_FLOW_FIELD_IDX_IPV4_TTL,
+ ICE_FLOW_FIELD_IDX_IPV4_FRAG_OFS,
ICE_FLOW_FIELD_IDX_IPV4_PROT,
ICE_FLOW_FIELD_IDX_IPV6_TTL,
ICE_FLOW_FIELD_IDX_IPV6_PROT,
--
2.25.1
next prev parent reply other threads:[~2025-01-24 9:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250122082310.380054-0-mingjinx.ye@intel.com>
2025-01-24 9:13 ` [PATCH v2 0/3] flexible IPv4 fragment action Mingjin Ye
2025-01-24 9:13 ` Mingjin Ye [this message]
2025-01-24 9:13 ` [PATCH v2 2/3] net/ice: FDIR support IPv4 fragment masks Mingjin Ye
2025-01-24 9:13 ` [PATCH v2 3/3] net/ice: ACL filter support for IPv4 fragment Mingjin Ye
2025-01-24 9:49 ` Jiale, SongX
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=20250124091324.403435-2-mingjinx.ye@intel.com \
--to=mingjinx.ye@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/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;
as well as URLs for NNTP newsgroup(s).