From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com
Cc: dev@dpdk.org, haiyue.wang@intel.com, junfeng.guo@intel.com,
Qi Zhang <qi.z.zhang@intel.com>,
Kiran Patil <kiran.patil@intel.com>
Subject: [dpdk-dev] [PATCH 07/14] net/ice/base: support for switch filter (GTP tunnel+IP flow)
Date: Tue, 2 Mar 2021 15:23:50 +0800 [thread overview]
Message-ID: <20210302072357.1657556-8-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20210302072357.1657556-1-qi.z.zhang@intel.com>
Enabled support for advanced switch filter to satisfy match criteria
such as: GTP tunnel + Inner IPv4[6]
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/ice/base/ice_protocol_type.h | 8 +-
drivers/net/ice/base/ice_switch.c | 114 ++++++++++++-----------
2 files changed, 63 insertions(+), 59 deletions(-)
diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h
index d769ad0580..ee1f29d41f 100644
--- a/drivers/net/ice/base/ice_protocol_type.h
+++ b/drivers/net/ice/base/ice_protocol_type.h
@@ -75,10 +75,6 @@ enum ice_sw_tunnel_type {
ICE_SW_TUN_GTP,
ICE_SW_TUN_IPV4_GTPU_NO_PAY,
ICE_SW_TUN_IPV6_GTPU_NO_PAY,
- ICE_SW_TUN_IPV4_GTPU_IPV4,
- ICE_SW_TUN_IPV4_GTPU_IPV6,
- ICE_SW_TUN_IPV6_GTPU_IPV4,
- ICE_SW_TUN_IPV6_GTPU_IPV6,
ICE_SW_TUN_PPPOE,
ICE_SW_TUN_PPPOE_PAY,
ICE_SW_TUN_PPPOE_IPV4,
@@ -109,6 +105,10 @@ enum ice_sw_tunnel_type {
ICE_SW_TUN_PPPOE_PAY_QINQ,
ICE_SW_TUN_PPPOE_IPV4_QINQ,
ICE_SW_TUN_PPPOE_IPV6_QINQ,
+ ICE_SW_TUN_IPV4_GTPU_IPV4,
+ ICE_SW_TUN_IPV4_GTPU_IPV6,
+ ICE_SW_TUN_IPV6_GTPU_IPV4,
+ ICE_SW_TUN_IPV6_GTPU_IPV6,
ICE_ALL_TUNNELS /* All tunnel types including NVGRE */
};
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 4568242c10..2d0dd4b28c 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -912,39 +912,7 @@ static const u8 dummy_ipv6_gtpu_ipv6_udp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */
};
-static const struct ice_dummy_pkt_offsets dummy_udp_gtp_packet_offsets[] = {
- { ICE_MAC_OFOS, 0 },
- { ICE_IPV4_OFOS, 14 },
- { ICE_UDP_OF, 34 },
- { ICE_GTP, 42 },
- { ICE_PROTOCOL_LAST, 0 },
-};
-
-static const u8 dummy_udp_gtp_packet[] = {
- 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00,
-
- 0x45, 0x00, 0x00, 0x30, /* ICE_IPV4_OFOS 14 */
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x11, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x08, 0x68, /* ICE_UDP_OF 34 */
- 0x00, 0x1c, 0x00, 0x00,
-
- 0x34, 0xff, 0x00, 0x0c, /* ICE_GTP 42 */
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x85,
-
- 0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const
-struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_packet_offsets[] = {
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 },
{ ICE_IPV4_OFOS, 14 },
{ ICE_UDP_OF, 34 },
@@ -1126,8 +1094,38 @@ static const u8 dummy_ipv6_gtpu_ipv6_packet[] = {
0x00, 0x00,
};
-static const
-struct ice_dummy_pkt_offsets dummy_ipv4_gtp_no_pay_packet_offsets[] = {
+static const struct ice_dummy_pkt_offsets dummy_udp_gtp_packet_offsets[] = {
+ { ICE_MAC_OFOS, 0 },
+ { ICE_IPV4_OFOS, 14 },
+ { ICE_UDP_OF, 34 },
+ { ICE_GTP, 42 },
+ { ICE_PROTOCOL_LAST, 0 },
+};
+
+static const u8 dummy_udp_gtp_packet[] = {
+ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00,
+
+ 0x45, 0x00, 0x00, 0x30, /* ICE_IPV4_OFOS 14 */
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x11, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x08, 0x68, /* ICE_UDP_OF 34 */
+ 0x00, 0x1c, 0x00, 0x00,
+
+ 0x34, 0xff, 0x00, 0x0c, /* ICE_GTP 42 */
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x85,
+
+ 0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
+ 0x00, 0x00, 0x00, 0x00,
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtp_no_pay_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 },
{ ICE_IPV4_OFOS, 14 },
{ ICE_UDP_OF, 34 },
@@ -7808,26 +7806,6 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
*pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_packet);
*offsets = dummy_ipv6_gtp_no_pay_packet_offsets;
return;
- } else if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4) {
- *pkt = dummy_ipv4_gtpu_ipv4_packet;
- *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_packet);
- *offsets = dummy_ipv4_gtpu_ipv4_packet_offsets;
- return;
- } else if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6) {
- *pkt = dummy_ipv4_gtpu_ipv6_packet;
- *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_packet);
- *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;
- return;
- } else if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4) {
- *pkt = dummy_ipv6_gtpu_ipv4_packet;
- *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_packet);
- *offsets = dummy_ipv6_gtpu_ipv4_packet_offsets;
- return;
- } else if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6) {
- *pkt = dummy_ipv6_gtpu_ipv6_packet;
- *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_packet);
- *offsets = dummy_ipv6_gtpu_ipv6_packet_offsets;
- return;
}
if (tun_type == ICE_SW_TUN_IPV4_ESP) {
@@ -7976,6 +7954,32 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
return;
}
+ /* Support GTP tunnel + L3 */
+ if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4) {
+ *pkt = dummy_ipv4_gtpu_ipv4_packet;
+ *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_packet);
+ *offsets = dummy_ipv4_gtpu_ipv4_packet_offsets;
+ return;
+ }
+ if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6) {
+ *pkt = dummy_ipv4_gtpu_ipv6_packet;
+ *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_packet);
+ *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;
+ return;
+ }
+ if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4) {
+ *pkt = dummy_ipv6_gtpu_ipv4_packet;
+ *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_packet);
+ *offsets = dummy_ipv6_gtpu_ipv4_packet_offsets;
+ return;
+ }
+ if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6) {
+ *pkt = dummy_ipv6_gtpu_ipv6_packet;
+ *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_packet);
+ *offsets = dummy_ipv6_gtpu_ipv6_packet_offsets;
+ return;
+ }
+
if (tun_type == ICE_ALL_TUNNELS) {
*pkt = dummy_gre_udp_packet;
*pkt_len = sizeof(dummy_gre_udp_packet);
--
2.26.2
next prev parent reply other threads:[~2021-03-02 7:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 7:23 [dpdk-dev] [PATCH 00/14] ice: base code update Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 01/14] net/ice/base: add firmware log support Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 02/14] net/ice/base: signed external device package programming Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 03/14] net/ice/base: post update double reset solution restriction Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 04/14] net/ice/base: enable GTPU inner L3/L4 for FDIR Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 05/14] net/ice/base: expose link configuration error Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 06/14] net/ice/base: enable more GTPU inner L3 fields for FDIR Qi Zhang
2021-03-02 7:23 ` Qi Zhang [this message]
2021-03-02 7:23 ` [dpdk-dev] [PATCH 08/14] net/ice/base: support GTPU IP inner IPv6 " Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 09/14] net/ice/base: fix incorrect payload indicator on PTYPE Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 10/14] net/ice/base: mark PTYPE 2 as reserved Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 11/14] net/ice/base: add code to update boost TCAM for DVM Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 12/14] net/ice/base: update GTPU EH dummy pkts for FDIR Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 13/14] net/ice/base: fix uninitialized struct Qi Zhang
2021-03-02 7:23 ` [dpdk-dev] [PATCH 14/14] net/ice/base: cleanup fltr list in case of allocation issues Qi Zhang
2021-03-04 5:31 ` [dpdk-dev] [PATCH 00/14] ice: base code update Yang, Qiming
2021-03-05 8:39 ` Zhang, Qi Z
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=20210302072357.1657556-8-qi.z.zhang@intel.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=haiyue.wang@intel.com \
--cc=junfeng.guo@intel.com \
--cc=kiran.patil@intel.com \
--cc=qiming.yang@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).