Commit 17c6d835 authored by Michal Swiatkowski's avatar Michal Swiatkowski Committed by Tony Nguyen
Browse files

ice: specify field names in ice_prot_ext init



Anonymous initializers are now discouraged. Define ICE_PROTCOL_ENTRY
macro to rewrite anonymous initializers to named one. No functional
changes here.

Suggested-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Tested-by: default avatarSujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 40fd7492
Loading
Loading
Loading
Loading
+28 −23
Original line number Diff line number Diff line
@@ -4540,6 +4540,11 @@ ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,
	return status;
}

#define ICE_PROTOCOL_ENTRY(id, ...) {		\
	.prot_type	= id,			\
	.offs		= {__VA_ARGS__},	\
}

/* This is mapping table entry that maps every word within a given protocol
 * structure to the real byte offset as per the specification of that
 * protocol header.
@@ -4550,29 +4555,29 @@ ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,
 * structure is added to that union.
 */
static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {
	{ ICE_MAC_OFOS,		{ 0, 2, 4, 6, 8, 10, 12 } },
	{ ICE_MAC_IL,		{ 0, 2, 4, 6, 8, 10, 12 } },
	{ ICE_ETYPE_OL,		{ 0 } },
	{ ICE_ETYPE_IL,		{ 0 } },
	{ ICE_VLAN_OFOS,	{ 2, 0 } },
	{ ICE_IPV4_OFOS,	{ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } },
	{ ICE_IPV4_IL,		{ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } },
	{ ICE_IPV6_OFOS,	{ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24,
				 26, 28, 30, 32, 34, 36, 38 } },
	{ ICE_IPV6_IL,		{ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24,
				 26, 28, 30, 32, 34, 36, 38 } },
	{ ICE_TCP_IL,		{ 0, 2 } },
	{ ICE_UDP_OF,		{ 0, 2 } },
	{ ICE_UDP_ILOS,		{ 0, 2 } },
	{ ICE_VXLAN,		{ 8, 10, 12, 14 } },
	{ ICE_GENEVE,		{ 8, 10, 12, 14 } },
	{ ICE_NVGRE,		{ 0, 2, 4, 6 } },
	{ ICE_GTP,		{ 8, 10, 12, 14, 16, 18, 20, 22 } },
	{ ICE_GTP_NO_PAY,	{ 8, 10, 12, 14 } },
	{ ICE_PPPOE,		{ 0, 2, 4, 6 } },
	{ ICE_L2TPV3,		{ 0, 2, 4, 6, 8, 10 } },
	{ ICE_VLAN_EX,          { 2, 0 } },
	{ ICE_VLAN_IN,          { 2, 0 } },
	ICE_PROTOCOL_ENTRY(ICE_MAC_OFOS, 0, 2, 4, 6, 8, 10, 12),
	ICE_PROTOCOL_ENTRY(ICE_MAC_IL, 0, 2, 4, 6, 8, 10, 12),
	ICE_PROTOCOL_ENTRY(ICE_ETYPE_OL, 0),
	ICE_PROTOCOL_ENTRY(ICE_ETYPE_IL, 0),
	ICE_PROTOCOL_ENTRY(ICE_VLAN_OFOS, 2, 0),
	ICE_PROTOCOL_ENTRY(ICE_IPV4_OFOS, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18),
	ICE_PROTOCOL_ENTRY(ICE_IPV4_IL,	0, 2, 4, 6, 8, 10, 12, 14, 16, 18),
	ICE_PROTOCOL_ENTRY(ICE_IPV6_OFOS, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
			   20, 22, 24, 26, 28, 30, 32, 34, 36, 38),
	ICE_PROTOCOL_ENTRY(ICE_IPV6_IL, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
			   22, 24, 26, 28, 30, 32, 34, 36, 38),
	ICE_PROTOCOL_ENTRY(ICE_TCP_IL, 0, 2),
	ICE_PROTOCOL_ENTRY(ICE_UDP_OF, 0, 2),
	ICE_PROTOCOL_ENTRY(ICE_UDP_ILOS, 0, 2),
	ICE_PROTOCOL_ENTRY(ICE_VXLAN, 8, 10, 12, 14),
	ICE_PROTOCOL_ENTRY(ICE_GENEVE, 8, 10, 12, 14),
	ICE_PROTOCOL_ENTRY(ICE_NVGRE, 0, 2, 4, 6),
	ICE_PROTOCOL_ENTRY(ICE_GTP, 8, 10, 12, 14, 16, 18, 20, 22),
	ICE_PROTOCOL_ENTRY(ICE_GTP_NO_PAY, 8, 10, 12, 14),
	ICE_PROTOCOL_ENTRY(ICE_PPPOE, 0, 2, 4, 6),
	ICE_PROTOCOL_ENTRY(ICE_L2TPV3, 0, 2, 4, 6, 8, 10),
	ICE_PROTOCOL_ENTRY(ICE_VLAN_EX, 2, 0),
	ICE_PROTOCOL_ENTRY(ICE_VLAN_IN, 2, 0),
};

static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {