Commit 07a28842 authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Tony Nguyen

ice: switch: use convenience macros to declare dummy pkt templates

Declarations of dummy/template packet headers and offsets can be
minified to improve readability and simplify adding new templates.
Move all the repetitive constructions into two macros and let them
do the name and type expansions.
Linewrap removal is yet another positive side effect.
Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
Reviewed-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 1b699f81
...@@ -41,15 +41,22 @@ struct ice_dummy_pkt_profile { ...@@ -41,15 +41,22 @@ struct ice_dummy_pkt_profile {
u16 pkt_len; u16 pkt_len;
}; };
#define ICE_DECLARE_PKT_OFFSETS(type) \
static const struct ice_dummy_pkt_offsets \
ice_dummy_##type##_packet_offsets[]
#define ICE_DECLARE_PKT_TEMPLATE(type) \
static const u8 ice_dummy_##type##_packet[]
#define ICE_PKT_PROFILE(type) ({ \ #define ICE_PKT_PROFILE(type) ({ \
(struct ice_dummy_pkt_profile){ \ (struct ice_dummy_pkt_profile){ \
.pkt = dummy_##type##_packet, \ .pkt = ice_dummy_##type##_packet, \
.pkt_len = sizeof(dummy_##type##_packet), \ .pkt_len = sizeof(ice_dummy_##type##_packet), \
.offsets = dummy_##type##_packet_offsets, \ .offsets = ice_dummy_##type##_packet_offsets, \
}; \ }; \
}) })
static const struct ice_dummy_pkt_offsets dummy_gre_tcp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(gre_tcp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -61,7 +68,7 @@ static const struct ice_dummy_pkt_offsets dummy_gre_tcp_packet_offsets[] = { ...@@ -61,7 +68,7 @@ static const struct ice_dummy_pkt_offsets dummy_gre_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_gre_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(gre_tcp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -96,7 +103,7 @@ static const u8 dummy_gre_tcp_packet[] = { ...@@ -96,7 +103,7 @@ static const u8 dummy_gre_tcp_packet[] = {
0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00
}; };
static const struct ice_dummy_pkt_offsets dummy_gre_udp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(gre_udp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -108,7 +115,7 @@ static const struct ice_dummy_pkt_offsets dummy_gre_udp_packet_offsets[] = { ...@@ -108,7 +115,7 @@ static const struct ice_dummy_pkt_offsets dummy_gre_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_gre_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(gre_udp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -140,7 +147,7 @@ static const u8 dummy_gre_udp_packet[] = { ...@@ -140,7 +147,7 @@ static const u8 dummy_gre_udp_packet[] = {
0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
}; };
static const struct ice_dummy_pkt_offsets dummy_udp_tun_tcp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(udp_tun_tcp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -155,7 +162,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_tun_tcp_packet_offsets[] = { ...@@ -155,7 +162,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_tun_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_udp_tun_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(udp_tun_tcp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -193,7 +200,7 @@ static const u8 dummy_udp_tun_tcp_packet[] = { ...@@ -193,7 +200,7 @@ static const u8 dummy_udp_tun_tcp_packet[] = {
0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00
}; };
static const struct ice_dummy_pkt_offsets dummy_udp_tun_udp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(udp_tun_udp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -208,7 +215,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_tun_udp_packet_offsets[] = { ...@@ -208,7 +215,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_tun_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_udp_tun_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(udp_tun_udp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -243,8 +250,7 @@ static const u8 dummy_udp_tun_udp_packet[] = { ...@@ -243,8 +250,7 @@ static const u8 dummy_udp_tun_udp_packet[] = {
0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
}; };
static const struct ice_dummy_pkt_offsets ICE_DECLARE_PKT_OFFSETS(gre_ipv6_tcp) = {
dummy_gre_ipv6_tcp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -256,7 +262,7 @@ dummy_gre_ipv6_tcp_packet_offsets[] = { ...@@ -256,7 +262,7 @@ dummy_gre_ipv6_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_gre_ipv6_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(gre_ipv6_tcp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -296,8 +302,7 @@ static const u8 dummy_gre_ipv6_tcp_packet[] = { ...@@ -296,8 +302,7 @@ static const u8 dummy_gre_ipv6_tcp_packet[] = {
0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00
}; };
static const struct ice_dummy_pkt_offsets ICE_DECLARE_PKT_OFFSETS(gre_ipv6_udp) = {
dummy_gre_ipv6_udp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -309,7 +314,7 @@ dummy_gre_ipv6_udp_packet_offsets[] = { ...@@ -309,7 +314,7 @@ dummy_gre_ipv6_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_gre_ipv6_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(gre_ipv6_udp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -346,8 +351,7 @@ static const u8 dummy_gre_ipv6_udp_packet[] = { ...@@ -346,8 +351,7 @@ static const u8 dummy_gre_ipv6_udp_packet[] = {
0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
}; };
static const struct ice_dummy_pkt_offsets ICE_DECLARE_PKT_OFFSETS(udp_tun_ipv6_tcp) = {
dummy_udp_tun_ipv6_tcp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -362,7 +366,7 @@ dummy_udp_tun_ipv6_tcp_packet_offsets[] = { ...@@ -362,7 +366,7 @@ dummy_udp_tun_ipv6_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_udp_tun_ipv6_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(udp_tun_ipv6_tcp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -405,8 +409,7 @@ static const u8 dummy_udp_tun_ipv6_tcp_packet[] = { ...@@ -405,8 +409,7 @@ static const u8 dummy_udp_tun_ipv6_tcp_packet[] = {
0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00
}; };
static const struct ice_dummy_pkt_offsets ICE_DECLARE_PKT_OFFSETS(udp_tun_ipv6_udp) = {
dummy_udp_tun_ipv6_udp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -421,7 +424,7 @@ dummy_udp_tun_ipv6_udp_packet_offsets[] = { ...@@ -421,7 +424,7 @@ dummy_udp_tun_ipv6_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_udp_tun_ipv6_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(udp_tun_ipv6_udp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -462,7 +465,7 @@ static const u8 dummy_udp_tun_ipv6_udp_packet[] = { ...@@ -462,7 +465,7 @@ static const u8 dummy_udp_tun_ipv6_udp_packet[] = {
}; };
/* offset info for MAC + IPv4 + UDP dummy packet */ /* offset info for MAC + IPv4 + UDP dummy packet */
static const struct ice_dummy_pkt_offsets dummy_udp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(udp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -471,7 +474,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_packet_offsets[] = { ...@@ -471,7 +474,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_packet_offsets[] = {
}; };
/* Dummy packet for MAC + IPv4 + UDP */ /* Dummy packet for MAC + IPv4 + UDP */
static const u8 dummy_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(udp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -491,7 +494,7 @@ static const u8 dummy_udp_packet[] = { ...@@ -491,7 +494,7 @@ static const u8 dummy_udp_packet[] = {
}; };
/* offset info for MAC + VLAN + IPv4 + UDP dummy packet */ /* offset info for MAC + VLAN + IPv4 + UDP dummy packet */
static const struct ice_dummy_pkt_offsets dummy_vlan_udp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(vlan_udp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_VLAN_OFOS, 12 }, { ICE_VLAN_OFOS, 12 },
{ ICE_ETYPE_OL, 16 }, { ICE_ETYPE_OL, 16 },
...@@ -501,7 +504,7 @@ static const struct ice_dummy_pkt_offsets dummy_vlan_udp_packet_offsets[] = { ...@@ -501,7 +504,7 @@ static const struct ice_dummy_pkt_offsets dummy_vlan_udp_packet_offsets[] = {
}; };
/* C-tag (801.1Q), IPv4:UDP dummy packet */ /* C-tag (801.1Q), IPv4:UDP dummy packet */
static const u8 dummy_vlan_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(vlan_udp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -523,7 +526,7 @@ static const u8 dummy_vlan_udp_packet[] = { ...@@ -523,7 +526,7 @@ static const u8 dummy_vlan_udp_packet[] = {
}; };
/* offset info for MAC + IPv4 + TCP dummy packet */ /* offset info for MAC + IPv4 + TCP dummy packet */
static const struct ice_dummy_pkt_offsets dummy_tcp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(tcp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
...@@ -532,7 +535,7 @@ static const struct ice_dummy_pkt_offsets dummy_tcp_packet_offsets[] = { ...@@ -532,7 +535,7 @@ static const struct ice_dummy_pkt_offsets dummy_tcp_packet_offsets[] = {
}; };
/* Dummy packet for MAC + IPv4 + TCP */ /* Dummy packet for MAC + IPv4 + TCP */
static const u8 dummy_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(tcp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -555,7 +558,7 @@ static const u8 dummy_tcp_packet[] = { ...@@ -555,7 +558,7 @@ static const u8 dummy_tcp_packet[] = {
}; };
/* offset info for MAC + VLAN (C-tag, 802.1Q) + IPv4 + TCP dummy packet */ /* offset info for MAC + VLAN (C-tag, 802.1Q) + IPv4 + TCP dummy packet */
static const struct ice_dummy_pkt_offsets dummy_vlan_tcp_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(vlan_tcp) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_VLAN_OFOS, 12 }, { ICE_VLAN_OFOS, 12 },
{ ICE_ETYPE_OL, 16 }, { ICE_ETYPE_OL, 16 },
...@@ -565,7 +568,7 @@ static const struct ice_dummy_pkt_offsets dummy_vlan_tcp_packet_offsets[] = { ...@@ -565,7 +568,7 @@ static const struct ice_dummy_pkt_offsets dummy_vlan_tcp_packet_offsets[] = {
}; };
/* C-tag (801.1Q), IPv4:TCP dummy packet */ /* C-tag (801.1Q), IPv4:TCP dummy packet */
static const u8 dummy_vlan_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(vlan_tcp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -589,7 +592,7 @@ static const u8 dummy_vlan_tcp_packet[] = { ...@@ -589,7 +592,7 @@ static const u8 dummy_vlan_tcp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */ 0x00, 0x00, /* 2 bytes for 4 byte alignment */
}; };
static const struct ice_dummy_pkt_offsets dummy_tcp_ipv6_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(tcp_ipv6) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV6_OFOS, 14 }, { ICE_IPV6_OFOS, 14 },
...@@ -597,7 +600,7 @@ static const struct ice_dummy_pkt_offsets dummy_tcp_ipv6_packet_offsets[] = { ...@@ -597,7 +600,7 @@ static const struct ice_dummy_pkt_offsets dummy_tcp_ipv6_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_tcp_ipv6_packet[] = { ICE_DECLARE_PKT_TEMPLATE(tcp_ipv6) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -625,8 +628,7 @@ static const u8 dummy_tcp_ipv6_packet[] = { ...@@ -625,8 +628,7 @@ static const u8 dummy_tcp_ipv6_packet[] = {
}; };
/* C-tag (802.1Q): IPv6 + TCP */ /* C-tag (802.1Q): IPv6 + TCP */
static const struct ice_dummy_pkt_offsets ICE_DECLARE_PKT_OFFSETS(vlan_tcp_ipv6) = {
dummy_vlan_tcp_ipv6_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_VLAN_OFOS, 12 }, { ICE_VLAN_OFOS, 12 },
{ ICE_ETYPE_OL, 16 }, { ICE_ETYPE_OL, 16 },
...@@ -636,7 +638,7 @@ dummy_vlan_tcp_ipv6_packet_offsets[] = { ...@@ -636,7 +638,7 @@ dummy_vlan_tcp_ipv6_packet_offsets[] = {
}; };
/* C-tag (802.1Q), IPv6 + TCP dummy packet */ /* C-tag (802.1Q), IPv6 + TCP dummy packet */
static const u8 dummy_vlan_tcp_ipv6_packet[] = { ICE_DECLARE_PKT_TEMPLATE(vlan_tcp_ipv6) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -666,7 +668,7 @@ static const u8 dummy_vlan_tcp_ipv6_packet[] = { ...@@ -666,7 +668,7 @@ static const u8 dummy_vlan_tcp_ipv6_packet[] = {
}; };
/* IPv6 + UDP */ /* IPv6 + UDP */
static const struct ice_dummy_pkt_offsets dummy_udp_ipv6_packet_offsets[] = { ICE_DECLARE_PKT_OFFSETS(udp_ipv6) = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_ETYPE_OL, 12 }, { ICE_ETYPE_OL, 12 },
{ ICE_IPV6_OFOS, 14 }, { ICE_IPV6_OFOS, 14 },
...@@ -675,7 +677,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_ipv6_packet_offsets[] = { ...@@ -675,7 +677,7 @@ static const struct ice_dummy_pkt_offsets dummy_udp_ipv6_packet_offsets[] = {
}; };
/* IPv6 + UDP dummy packet */ /* IPv6 + UDP dummy packet */
static const u8 dummy_udp_ipv6_packet[] = { ICE_DECLARE_PKT_TEMPLATE(udp_ipv6) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -703,8 +705,7 @@ static const u8 dummy_udp_ipv6_packet[] = { ...@@ -703,8 +705,7 @@ static const u8 dummy_udp_ipv6_packet[] = {
}; };
/* C-tag (802.1Q): IPv6 + UDP */ /* C-tag (802.1Q): IPv6 + UDP */
static const struct ice_dummy_pkt_offsets ICE_DECLARE_PKT_OFFSETS(vlan_udp_ipv6) = {
dummy_vlan_udp_ipv6_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_VLAN_OFOS, 12 }, { ICE_VLAN_OFOS, 12 },
{ ICE_ETYPE_OL, 16 }, { ICE_ETYPE_OL, 16 },
...@@ -714,7 +715,7 @@ dummy_vlan_udp_ipv6_packet_offsets[] = { ...@@ -714,7 +715,7 @@ dummy_vlan_udp_ipv6_packet_offsets[] = {
}; };
/* C-tag (802.1Q), IPv6 + UDP dummy packet */ /* C-tag (802.1Q), IPv6 + UDP dummy packet */
static const u8 dummy_vlan_udp_ipv6_packet[] = { ICE_DECLARE_PKT_TEMPLATE(vlan_udp_ipv6) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -741,8 +742,7 @@ static const u8 dummy_vlan_udp_ipv6_packet[] = { ...@@ -741,8 +742,7 @@ static const u8 dummy_vlan_udp_ipv6_packet[] = {
}; };
/* Outer IPv4 + Outer UDP + GTP + Inner IPv4 + Inner TCP */ /* Outer IPv4 + Outer UDP + GTP + Inner IPv4 + Inner TCP */
static const ICE_DECLARE_PKT_OFFSETS(ipv4_gtpu_ipv4_tcp) = {
struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_tcp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
{ ICE_UDP_OF, 34 }, { ICE_UDP_OF, 34 },
...@@ -752,7 +752,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_tcp_packet_offsets[] = { ...@@ -752,7 +752,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv4_gtpu_ipv4_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv4_gtpu_ipv4_tcp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -790,8 +790,7 @@ static const u8 dummy_ipv4_gtpu_ipv4_tcp_packet[] = { ...@@ -790,8 +790,7 @@ static const u8 dummy_ipv4_gtpu_ipv4_tcp_packet[] = {
}; };
/* Outer IPv4 + Outer UDP + GTP + Inner IPv4 + Inner UDP */ /* Outer IPv4 + Outer UDP + GTP + Inner IPv4 + Inner UDP */
static const ICE_DECLARE_PKT_OFFSETS(ipv4_gtpu_ipv4_udp) = {
struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_udp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
{ ICE_UDP_OF, 34 }, { ICE_UDP_OF, 34 },
...@@ -801,7 +800,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_udp_packet_offsets[] = { ...@@ -801,7 +800,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv4_gtpu_ipv4_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv4_gtpu_ipv4_udp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -836,8 +835,7 @@ static const u8 dummy_ipv4_gtpu_ipv4_udp_packet[] = { ...@@ -836,8 +835,7 @@ static const u8 dummy_ipv4_gtpu_ipv4_udp_packet[] = {
}; };
/* Outer IPv6 + Outer UDP + GTP + Inner IPv4 + Inner TCP */ /* Outer IPv6 + Outer UDP + GTP + Inner IPv4 + Inner TCP */
static const ICE_DECLARE_PKT_OFFSETS(ipv4_gtpu_ipv6_tcp) = {
struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_tcp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
{ ICE_UDP_OF, 34 }, { ICE_UDP_OF, 34 },
...@@ -847,7 +845,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_tcp_packet_offsets[] = { ...@@ -847,7 +845,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv4_gtpu_ipv6_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv4_gtpu_ipv6_tcp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -889,8 +887,7 @@ static const u8 dummy_ipv4_gtpu_ipv6_tcp_packet[] = { ...@@ -889,8 +887,7 @@ static const u8 dummy_ipv4_gtpu_ipv6_tcp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */ 0x00, 0x00, /* 2 bytes for 4 byte alignment */
}; };
static const ICE_DECLARE_PKT_OFFSETS(ipv4_gtpu_ipv6_udp) = {
struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_udp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
{ ICE_UDP_OF, 34 }, { ICE_UDP_OF, 34 },
...@@ -900,7 +897,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_udp_packet_offsets[] = { ...@@ -900,7 +897,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv4_gtpu_ipv6_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv4_gtpu_ipv6_udp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -939,8 +936,7 @@ static const u8 dummy_ipv4_gtpu_ipv6_udp_packet[] = { ...@@ -939,8 +936,7 @@ static const u8 dummy_ipv4_gtpu_ipv6_udp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */ 0x00, 0x00, /* 2 bytes for 4 byte alignment */
}; };
static const ICE_DECLARE_PKT_OFFSETS(ipv6_gtpu_ipv4_tcp) = {
struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_tcp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV6_OFOS, 14 }, { ICE_IPV6_OFOS, 14 },
{ ICE_UDP_OF, 54 }, { ICE_UDP_OF, 54 },
...@@ -950,7 +946,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_tcp_packet_offsets[] = { ...@@ -950,7 +946,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv6_gtpu_ipv4_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv6_gtpu_ipv4_tcp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -992,8 +988,7 @@ static const u8 dummy_ipv6_gtpu_ipv4_tcp_packet[] = { ...@@ -992,8 +988,7 @@ static const u8 dummy_ipv6_gtpu_ipv4_tcp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */ 0x00, 0x00, /* 2 bytes for 4 byte alignment */
}; };
static const ICE_DECLARE_PKT_OFFSETS(ipv6_gtpu_ipv4_udp) = {
struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_udp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV6_OFOS, 14 }, { ICE_IPV6_OFOS, 14 },
{ ICE_UDP_OF, 54 }, { ICE_UDP_OF, 54 },
...@@ -1003,7 +998,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_udp_packet_offsets[] = { ...@@ -1003,7 +998,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv6_gtpu_ipv4_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv6_gtpu_ipv4_udp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -1042,8 +1037,7 @@ static const u8 dummy_ipv6_gtpu_ipv4_udp_packet[] = { ...@@ -1042,8 +1037,7 @@ static const u8 dummy_ipv6_gtpu_ipv4_udp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */ 0x00, 0x00, /* 2 bytes for 4 byte alignment */
}; };
static const ICE_DECLARE_PKT_OFFSETS(ipv6_gtpu_ipv6_tcp) = {
struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_tcp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV6_OFOS, 14 }, { ICE_IPV6_OFOS, 14 },
{ ICE_UDP_OF, 54 }, { ICE_UDP_OF, 54 },
...@@ -1053,7 +1047,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_tcp_packet_offsets[] = { ...@@ -1053,7 +1047,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_tcp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv6_gtpu_ipv6_tcp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv6_gtpu_ipv6_tcp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -1100,8 +1094,7 @@ static const u8 dummy_ipv6_gtpu_ipv6_tcp_packet[] = { ...@@ -1100,8 +1094,7 @@ static const u8 dummy_ipv6_gtpu_ipv6_tcp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */ 0x00, 0x00, /* 2 bytes for 4 byte alignment */
}; };
static const ICE_DECLARE_PKT_OFFSETS(ipv6_gtpu_ipv6_udp) = {
struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_udp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV6_OFOS, 14 }, { ICE_IPV6_OFOS, 14 },
{ ICE_UDP_OF, 54 }, { ICE_UDP_OF, 54 },
...@@ -1111,7 +1104,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_udp_packet_offsets[] = { ...@@ -1111,7 +1104,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_udp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv6_gtpu_ipv6_udp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv6_gtpu_ipv6_udp) = {
0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */ 0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -1155,8 +1148,7 @@ static const u8 dummy_ipv6_gtpu_ipv6_udp_packet[] = { ...@@ -1155,8 +1148,7 @@ static const u8 dummy_ipv6_gtpu_ipv6_udp_packet[] = {
0x00, 0x00, /* 2 bytes for 4 byte alignment */ 0x00, 0x00, /* 2 bytes for 4 byte alignment */
}; };
static const ICE_DECLARE_PKT_OFFSETS(ipv4_gtpu_ipv4) = {
struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV4_OFOS, 14 }, { ICE_IPV4_OFOS, 14 },
{ ICE_UDP_OF, 34 }, { ICE_UDP_OF, 34 },
...@@ -1164,7 +1156,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_packet_offsets[] = { ...@@ -1164,7 +1156,7 @@ struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv4_gtpu_ipv4_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv4_gtpu_ipv4) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -1194,8 +1186,7 @@ static const u8 dummy_ipv4_gtpu_ipv4_packet[] = { ...@@ -1194,8 +1186,7 @@ static const u8 dummy_ipv4_gtpu_ipv4_packet[] = {
0x00, 0x00, 0x00, 0x00,
}; };
static const ICE_DECLARE_PKT_OFFSETS(ipv6_gtp) = {
struct ice_dummy_pkt_offsets dummy_ipv6_gtp_packet_offsets[] = {
{ ICE_MAC_OFOS, 0 }, { ICE_MAC_OFOS, 0 },
{ ICE_IPV6_OFOS, 14 }, { ICE_IPV6_OFOS, 14 },
{ ICE_UDP_OF, 54 }, { ICE_UDP_OF, 54 },
...@@ -1203,7 +1194,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtp_packet_offsets[] = { ...@@ -1203,7 +1194,7 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtp_packet_offsets[] = {
{ ICE_PROTOCOL_LAST, 0 }, { ICE_PROTOCOL_LAST, 0 },
}; };
static const u8 dummy_ipv6_gtp_packet[] = { ICE_DECLARE_PKT_TEMPLATE(ipv6_gtp) = {
0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment