On 09/19, Leyi Rong wrote: >From: Haiyue Wang <haiyue.w...@intel.com> >
[snip] >+static inline uint8_t >+ice_rxdid_to_proto_xtr_type(uint8_t rxdid) >+{ >+ static uint8_t xtr_map[] = { >+ [ICE_RXDID_COMMS_AUX_VLAN] = PROTO_XTR_VLAN, >+ [ICE_RXDID_COMMS_AUX_IPV4] = PROTO_XTR_IPV4, >+ [ICE_RXDID_COMMS_AUX_IPV6] = PROTO_XTR_IPV6, >+ [ICE_RXDID_COMMS_AUX_IPV6_FLOW] = PROTO_XTR_IPV6_FLOW, >+ [ICE_RXDID_COMMS_AUX_TCP] = PROTO_XTR_TCP, >+ }; >+ >+ return rxdid < RTE_DIM(xtr_map) ? xtr_map[rxdid] : PROTO_XTR_NONE; >+} >+ >+static inline uint8_t >+ice_proto_xtr_type_to_rxdid(uint8_t xtr_tpye) s/xtr_tpye/xtr_type/ >+{ >+ static uint8_t rxdid_map[] = { >+ [PROTO_XTR_VLAN] = ICE_RXDID_COMMS_AUX_VLAN, >+ [PROTO_XTR_IPV4] = ICE_RXDID_COMMS_AUX_IPV4, >+ [PROTO_XTR_IPV6] = ICE_RXDID_COMMS_AUX_IPV6, >+ [PROTO_XTR_IPV6_FLOW] = ICE_RXDID_COMMS_AUX_IPV6_FLOW, >+ [PROTO_XTR_TCP] = ICE_RXDID_COMMS_AUX_TCP, >+ }; >+ uint8_t rxdid; >+ >+ rxdid = xtr_tpye < RTE_DIM(rxdid_map) ? rxdid_map[xtr_tpye] : 0; >+ >+ return rxdid != 0 ? rxdid : ICE_RXDID_COMMS_GENERIC; Maybe just return xtr_type < RTE_DIM(rxdid_map) ? rxdid_map[xtr_type] : ICE_RXDID_COMMS_GENERIC; as previous ice_rxdid_to_proto_xtr_type. Thanks, Xiaolong