From: Zhirun Yan <zhirun.yan@intel.com>
To: qi.z.zhang@intel.com, dev@dpdk.org
Cc: yahui.cao@intel.com, xiao.w.wang@intel.com, simei.su@intel.com,
junfeng.guo@intel.com, Zhirun Yan <zhirun.yan@intel.com>
Subject: [dpdk-dev] [PATCH v1 1/2] net/ice/base: add tunnel support for FDIR
Date: Mon, 28 Sep 2020 14:31:45 +0800 [thread overview]
Message-ID: <20200928063146.668003-2-zhirun.yan@intel.com> (raw)
In-Reply-To: <20200928063146.668003-1-zhirun.yan@intel.com>
Add struct to store outer part for tunnel rule.
Add vxlan ptype in ipv4 mac bitmap. So when create a vxlan rule, the
ptype group will be valid.
Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
drivers/net/ice/base/ice_fdir.c | 7 +++++++
drivers/net/ice/base/ice_fdir.h | 9 +++++++++
drivers/net/ice/base/ice_flow.c | 6 +++---
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c
index aea388f2a..c15b232db 100644
--- a/drivers/net/ice/base/ice_fdir.c
+++ b/drivers/net/ice/base/ice_fdir.c
@@ -1057,6 +1057,13 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
loc[20] = ICE_FDIR_IPV4_PKT_FLAG_DF;
break;
case ICE_FLTR_PTYPE_NONF_IPV4_UDP:
+ ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac);
+ ice_pkt_insert_mac_addr(pkt + ETH_ALEN, input->ext_data_outer.src_mac);
+ ice_pkt_insert_u32(pkt, ICE_IPV4_SRC_ADDR_OFFSET,
+ input->ip_outer.v4.dst_ip);
+ ice_pkt_insert_u32(pkt, ICE_IPV4_DST_ADDR_OFFSET,
+ input->ip_outer.v4.src_ip);
+ ice_pkt_insert_u8(pkt, ICE_IPV4_TOS_OFFSET, input->ip_outer.v4.tos);
ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
input->ip.v4.src_ip);
ice_pkt_insert_u16(loc, ICE_IPV4_UDP_DST_PORT_OFFSET,
diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h
index 7e00bb273..d363de385 100644
--- a/drivers/net/ice/base/ice_fdir.h
+++ b/drivers/net/ice/base/ice_fdir.h
@@ -181,6 +181,15 @@ struct ice_fdir_fltr {
struct ice_fdir_v6 v6;
} ip, mask;
+ /* for tunnel outer part */
+ union {
+ struct ice_fdir_v4 v4;
+ struct ice_fdir_v6 v6;
+ } ip_outer, mask_outer;
+
+ struct ice_fdir_extra ext_data_outer;
+ struct ice_fdir_extra ext_mask_outer;
+
struct ice_fdir_udp_gtp gtpu_data;
struct ice_fdir_udp_gtp gtpu_mask;
diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index de5dfb228..35e8c59f6 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -222,7 +222,7 @@ static const u32 ice_ptypes_macvlan_il[] = {
* include IPV4 other PTYPEs
*/
static const u32 ice_ptypes_ipv4_ofos[] = {
- 0x1DC00000, 0x04000800, 0x00000000, 0x00000000,
+ 0x1DC00000, 0x24000800, 0x00000000, 0x00000000,
0x00000000, 0x00000155, 0x00000000, 0x00000000,
0x00000000, 0x000FC000, 0x000002A0, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -236,7 +236,7 @@ static const u32 ice_ptypes_ipv4_ofos[] = {
* IPV4 other PTYPEs
*/
static const u32 ice_ptypes_ipv4_ofos_all[] = {
- 0x1DC00000, 0x04000800, 0x00000000, 0x00000000,
+ 0x1DC00000, 0x24000800, 0x00000000, 0x00000000,
0x00000000, 0x00000155, 0x00000000, 0x00000000,
0x00000000, 0x000FC000, 0x83E0FAA0, 0x00000101,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -434,7 +434,7 @@ static const u32 ice_ptypes_gre_of[] = {
/* Packet types for packets with an Innermost/Last MAC header */
static const u32 ice_ptypes_mac_il[] = {
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x20000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
--
2.25.1
next prev parent reply other threads:[~2020-09-28 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 6:31 [dpdk-dev] [PATCH v1 0/2] support FDIR inner/outer field for tunnel packet Zhirun Yan
2020-09-28 6:31 ` Zhirun Yan [this message]
2020-09-28 6:31 ` [dpdk-dev] [PATCH v1 2/2] net/ice: support inner/outer L2/L3 field for FDIR Zhirun Yan
2020-10-15 9:28 ` Cao, Yahui
2020-11-02 8:23 ` Yan, Zhirun
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=20200928063146.668003-2-zhirun.yan@intel.com \
--to=zhirun.yan@intel.com \
--cc=dev@dpdk.org \
--cc=junfeng.guo@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=simei.su@intel.com \
--cc=xiao.w.wang@intel.com \
--cc=yahui.cao@intel.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;
as well as URLs for NNTP newsgroup(s).