All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/6] net/ice/base: fix inner TCP and UDP support for GRE
@ 2019-07-23  3:48 Qi Zhang
  2019-07-23  3:48 ` [dpdk-dev] [PATCH 2/6] net/ice/base: fix resource leak Qi Zhang
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Qi Zhang @ 2019-07-23  3:48 UTC (permalink / raw)
  To: qiming.yang, wenzhuo.luo; +Cc: paul.m.stillwell.jr, dev, Qi Zhang

The dummy packets for GRE were set up for IP, but not inner
TCP or UDP. There are some applications that want to be
able to parse on those inner L4 headers so add them to
the dummy packets.

Also, the GRE dummy packet was formatted differently from
the other dummy packets so change the formatting to match
all the other dummy packets.

Fixes: 839c0a4b77e6 ("net/ice/base: enable additional switch rules")

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 123 ++++++++++++++++++++++++++++++--------
 1 file changed, 97 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index be43c8ba2..0b5b1f41d 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -59,38 +59,95 @@ struct ice_dummy_pkt_offsets {
 };
 
 static const
-struct ice_dummy_pkt_offsets dummy_gre_packet_offsets[] = {
+struct ice_dummy_pkt_offsets dummy_gre_tcp_packet_offsets[] = {
 	{ ICE_MAC_OFOS,		0 },
 	{ ICE_ETYPE_OL,		12 },
 	{ ICE_IPV4_OFOS,	14 },
 	{ ICE_NVGRE,		34 },
 	{ ICE_MAC_IL,		42 },
 	{ ICE_IPV4_IL,		56 },
+	{ ICE_TCP_IL,		76 },
 	{ ICE_PROTOCOL_LAST,	0 },
 };
 
 static const
-u8 dummy_gre_packet[] = { 0, 0, 0, 0,		/* ICE_MAC_OFOS 0 */
-			  0, 0, 0, 0,
-			  0, 0, 0, 0,
-			  0x08, 0,		/* ICE_ETYPE_OL 12 */
-			  0x45, 0, 0, 0x3E,	/* ICE_IPV4_OFOS 14 */
-			  0, 0, 0, 0,
-			  0, 0x2F, 0, 0,
-			  0, 0, 0, 0,
-			  0, 0, 0, 0,
-			  0x80, 0, 0x65, 0x58,	/* ICE_NVGRE 34 */
-			  0, 0, 0, 0,
-			  0, 0, 0, 0,		/* ICE_MAC_IL 42 */
-			  0, 0, 0, 0,
-			  0, 0, 0, 0,
-			  0x08, 0,
-			  0x45, 0, 0, 0x14,	/* ICE_IPV4_IL 54 */
-			  0, 0, 0, 0,
-			  0, 0, 0, 0,
-			  0, 0, 0, 0,
-			  0, 0, 0, 0
-			};
+u8 dummy_gre_tcp_packet[] = {
+	0x00, 0x00, 0x00, 0x00,	/* ICE_MAC_OFOS 0 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+
+	0x08, 0x00,		/* ICE_ETYPE_OL 12 */
+
+	0x45, 0x00, 0x00, 0x3E,	/* ICE_IPV4_OFOS 14 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x2F, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+
+	0x80, 0x00, 0x65, 0x58,	/* ICE_NVGRE 34 */
+	0x00, 0x00, 0x00, 0x00,
+
+	0x00, 0x00, 0x00, 0x00,	/* ICE_MAC_IL 42 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x08, 0x00,
+
+	0x45, 0x00, 0x00, 0x14,	/* ICE_IPV4_IL 56 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+
+	0x00, 0x00, 0x00, 0x00,	/* ICE_TCP_IL 76 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x50, 0x02, 0x20, 0x00,
+	0x00, 0x00, 0x00, 0x00
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_gre_udp_packet_offsets[] = {
+	{ ICE_MAC_OFOS,		0 },
+	{ ICE_ETYPE_OL,		12 },
+	{ ICE_IPV4_OFOS,	14 },
+	{ ICE_NVGRE,		34 },
+	{ ICE_MAC_IL,		42 },
+	{ ICE_IPV4_IL,		56 },
+	{ ICE_UDP_ILOS,		76 },
+	{ ICE_PROTOCOL_LAST,	0 },
+};
+
+static const
+u8 dummy_gre_udp_packet[] = {
+	0x00, 0x00, 0x00, 0x00,	/* ICE_MAC_OFOS 0 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+
+	0x08, 0x00,		/* ICE_ETYPE_OL 12 */
+
+	0x45, 0x00, 0x00, 0x3E,	/* ICE_IPV4_OFOS 14 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x2F, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+
+	0x80, 0x00, 0x65, 0x58,	/* ICE_NVGRE 34 */
+	0x00, 0x00, 0x00, 0x00,
+
+	0x00, 0x00, 0x00, 0x00,	/* ICE_MAC_IL 42 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x08, 0x00,
+
+	0x45, 0x00, 0x00, 0x14,	/* ICE_IPV4_IL 56 */
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00,
+
+	0x00, 0x00, 0x00, 0x00,	/* ICE_UDP_ILOS 76 */
+	0x00, 0x08, 0x00, 0x00,
+};
 
 static const
 struct ice_dummy_pkt_offsets dummy_udp_tun_tcp_packet_offsets[] = {
@@ -5369,10 +5426,24 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 			ipv6 = true;
 	}
 
-	if (tun_type == ICE_SW_TUN_NVGRE || tun_type == ICE_ALL_TUNNELS) {
-		*pkt = dummy_gre_packet;
-		*pkt_len = sizeof(dummy_gre_packet);
-		*offsets = dummy_gre_packet_offsets;
+	if (tun_type == ICE_ALL_TUNNELS) {
+		*pkt = dummy_gre_udp_packet;
+		*pkt_len = sizeof(dummy_gre_udp_packet);
+		*offsets = dummy_gre_udp_packet_offsets;
+		return;
+	}
+
+	if (tun_type == ICE_SW_TUN_NVGRE) {
+		if (tcp) {
+			*pkt = dummy_gre_tcp_packet;
+			*pkt_len = sizeof(dummy_gre_tcp_packet);
+			*offsets = dummy_gre_tcp_packet_offsets;
+			return;
+		}
+
+		*pkt = dummy_gre_udp_packet;
+		*pkt_len = sizeof(dummy_gre_udp_packet);
+		*offsets = dummy_gre_udp_packet_offsets;
 		return;
 	}
 
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH 0/6] net/ice/base: couple share code fix
@ 2019-07-23  3:51 Qi Zhang
  2019-07-23  3:51 ` [dpdk-dev] [PATCH 1/6] net/ice/base: fix inner TCP and UDP support for GRE Qi Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Qi Zhang @ 2019-07-23  3:51 UTC (permalink / raw)
  To: qiming.yang, wenzhuo.lu; +Cc: paul.m.stillwell.jr, dev, Qi Zhang

Qi Zhang (6):
  net/ice/base: fix inner TCP and UDP support for GRE
  net/ice/base: fix resource leak
  net/ice/base: fix ptype variable size
  net/ice/base: use macro instead of function name
  net/ice/base: cleanup hardware register macros
  net/ice/base: fix for and/or bitmap routines

 drivers/net/ice/base/ice_bitops.h     |   6 +-
 drivers/net/ice/base/ice_common.c     |   5 +-
 drivers/net/ice/base/ice_controlq.c   |   2 +-
 drivers/net/ice/base/ice_flex_pipe.c  |  15 +-
 drivers/net/ice/base/ice_flex_type.h  |   2 +-
 drivers/net/ice/base/ice_hw_autogen.h | 943 ++++++++++------------------------
 drivers/net/ice/base/ice_nvm.c        |   4 +-
 drivers/net/ice/base/ice_switch.c     | 128 ++++-
 8 files changed, 389 insertions(+), 716 deletions(-)

-- 
2.13.6


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-23  3:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23  3:48 [dpdk-dev] [PATCH 1/6] net/ice/base: fix inner TCP and UDP support for GRE Qi Zhang
2019-07-23  3:48 ` [dpdk-dev] [PATCH 2/6] net/ice/base: fix resource leak Qi Zhang
2019-07-23  3:48 ` [dpdk-dev] [PATCH 3/6] net/ice/base: fix ptype variable size Qi Zhang
2019-07-23  3:48 ` [dpdk-dev] [PATCH 4/6] net/ice/base: use macro instead of function name Qi Zhang
2019-07-23  3:48 ` [dpdk-dev] [PATCH 5/6] net/ice/base: cleanup hardware register macros Qi Zhang
2019-07-23  3:48 ` [dpdk-dev] [PATCH 6/6] net/ice/base: fix for and/or bitmap routines Qi Zhang
2019-07-23  3:51 [dpdk-dev] [PATCH 0/6] net/ice/base: couple share code fix Qi Zhang
2019-07-23  3:51 ` [dpdk-dev] [PATCH 1/6] net/ice/base: fix inner TCP and UDP support for GRE Qi Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.