The grouping ``()`` can be omitted for single element group. If no queues are
specified, PMD will use this protocol extraction type for all queues.
- Protocol is : ``vlan, ipv4, ipv6, ipv6_flow, tcp``.
+ Protocol is : ``vlan, ipv4, ipv6, ipv6_flow, tcp, ip_offset``.
.. code-block:: console
TCPHDR2 - Reserved
+ .. table:: Protocol extraction : ``ip_offset``
+
+ +----------------------------+----------------------------+
+ | IPHDR2 | IPHDR1 |
+ +============================+============================+
+ | IPv6 HDR Offset | IPv4 HDR Offset |
+ +----------------------------+----------------------------+
+
+ IPHDR1 - Outer/Single IPv4 Header offset.
+
+ IPHDR2 - Outer/Single IPv6 Header offset.
+
Use ``rte_net_ice_dynf_proto_xtr_metadata_get`` to access the protocol
extraction metadata, and use ``RTE_PKT_RX_DYNF_PROTO_XTR_*`` to get the
metadata type of ``struct rte_mbuf::ol_flags``.
ICE_RXDID_COMMS_AUX_IPV6 = 19,
ICE_RXDID_COMMS_AUX_IPV6_FLOW = 20,
ICE_RXDID_COMMS_AUX_TCP = 21,
+ ICE_RXDID_COMMS_AUX_IP_OFFSET = 25,
ICE_RXDID_LAST = 63,
};
[PROTO_XTR_TCP] = {
.param = { .name = "ice_dynflag_proto_xtr_tcp" },
.ol_flag = &rte_net_ice_dynflag_proto_xtr_tcp_mask },
+ [PROTO_XTR_IP_OFFSET] = {
+ .param = { .name = "ice_dynflag_proto_xtr_ip_offset" },
+ .ol_flag = &rte_net_ice_dynflag_proto_xtr_ip_offset_mask },
};
#define ICE_DFLT_OUTER_TAG_TYPE ICE_AQ_VSI_OUTER_TAG_VLAN_9100
{ "ipv6", PROTO_XTR_IPV6 },
{ "ipv6_flow", PROTO_XTR_IPV6_FLOW },
{ "tcp", PROTO_XTR_TCP },
+ { "ip_offset", PROTO_XTR_IP_OFFSET },
};
uint32_t i;
[PROTO_XTR_TCP] = { ICE_RXDID_COMMS_AUX_TCP,
ICE_RX_OPC_EXTRACT,
ICE_PROT_TCP_IL, ICE_PROT_ID_INVAL },
+ [PROTO_XTR_IP_OFFSET] = { ICE_RXDID_COMMS_AUX_IP_OFFSET,
+ ICE_RX_OPC_PROTID,
+ ICE_PROT_IPV4_OF_OR_S,
+ ICE_PROT_IPV6_OF_OR_S },
};
uint32_t i;
RTE_PMD_REGISTER_PCI_TABLE(net_ice, pci_id_ice_map);
RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic | vfio-pci");
RTE_PMD_REGISTER_PARAM_STRING(net_ice,
- ICE_PROTO_XTR_ARG "=[queue:]<vlan|ipv4|ipv6|ipv6_flow|tcp>"
+ ICE_PROTO_XTR_ARG "=[queue:]<vlan|ipv4|ipv6|ipv6_flow|tcp|ip_offset>"
ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>"
ICE_PIPELINE_MODE_SUPPORT_ARG "=<0|1>"
ICE_FLOW_MARK_SUPPORT_ARG "=<0|1>");
PROTO_XTR_IPV6,
PROTO_XTR_IPV6_FLOW,
PROTO_XTR_TCP,
+ PROTO_XTR_IP_OFFSET,
PROTO_XTR_MAX /* The last one */
};
uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_mask;
uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask;
uint64_t rte_net_ice_dynflag_proto_xtr_tcp_mask;
+uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask;
static inline uint64_t
-ice_rxdid_to_proto_xtr_ol_flag(uint8_t rxdid)
-{
- static uint64_t *ol_flag_map[] = {
- [ICE_RXDID_COMMS_AUX_VLAN] =
- &rte_net_ice_dynflag_proto_xtr_vlan_mask,
- [ICE_RXDID_COMMS_AUX_IPV4] =
- &rte_net_ice_dynflag_proto_xtr_ipv4_mask,
- [ICE_RXDID_COMMS_AUX_IPV6] =
- &rte_net_ice_dynflag_proto_xtr_ipv6_mask,
- [ICE_RXDID_COMMS_AUX_IPV6_FLOW] =
- &rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask,
- [ICE_RXDID_COMMS_AUX_TCP] =
- &rte_net_ice_dynflag_proto_xtr_tcp_mask,
+ice_rxdid_to_proto_xtr_ol_flag(uint8_t rxdid, bool *chk_valid)
+{
+ static struct {
+ uint64_t *ol_flag;
+ bool chk_valid;
+ } ol_flag_map[] = {
+ [ICE_RXDID_COMMS_AUX_VLAN] = {
+ &rte_net_ice_dynflag_proto_xtr_vlan_mask, true },
+ [ICE_RXDID_COMMS_AUX_IPV4] = {
+ &rte_net_ice_dynflag_proto_xtr_ipv4_mask, true },
+ [ICE_RXDID_COMMS_AUX_IPV6] = {
+ &rte_net_ice_dynflag_proto_xtr_ipv6_mask, true },
+ [ICE_RXDID_COMMS_AUX_IPV6_FLOW] = {
+ &rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask, true },
+ [ICE_RXDID_COMMS_AUX_TCP] = {
+ &rte_net_ice_dynflag_proto_xtr_tcp_mask, true },
+ [ICE_RXDID_COMMS_AUX_IP_OFFSET] = {
+ &rte_net_ice_dynflag_proto_xtr_ip_offset_mask, false },
};
uint64_t *ol_flag;
- ol_flag = rxdid < RTE_DIM(ol_flag_map) ? ol_flag_map[rxdid] : NULL;
+ if (rxdid < RTE_DIM(ol_flag_map)) {
+ ol_flag = ol_flag_map[rxdid].ol_flag;
+ if (!ol_flag)
+ return 0ULL;
- return ol_flag != NULL ? *ol_flag : 0ULL;
+ *chk_valid = ol_flag_map[rxdid].chk_valid;
+ return *ol_flag;
+ }
+
+ return 0ULL;
}
static inline uint8_t
[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,
+ [PROTO_XTR_IP_OFFSET] = ICE_RXDID_COMMS_AUX_IP_OFFSET,
};
return xtr_type < RTE_DIM(rxdid_map) ?
volatile struct ice_32b_rx_flex_desc_comms *desc)
{
uint16_t stat_err = rte_le_to_cpu_16(desc->status_error1);
- uint32_t metadata;
+ uint32_t metadata = 0;
uint64_t ol_flag;
+ bool chk_valid;
- if (unlikely(!(stat_err & ICE_RX_PROTO_XTR_VALID)))
- return;
-
- ol_flag = ice_rxdid_to_proto_xtr_ol_flag(desc->rxdid);
+ ol_flag = ice_rxdid_to_proto_xtr_ol_flag(desc->rxdid, &chk_valid);
if (unlikely(!ol_flag))
return;
- mb->ol_flags |= ol_flag;
+ if (chk_valid) {
+ if (stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD4_VALID_S))
+ metadata = rte_le_to_cpu_16(desc->flex_ts.flex.aux0);
- metadata = stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD4_VALID_S) ?
- rte_le_to_cpu_16(desc->flex_ts.flex.aux0) : 0;
+ if (stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD5_VALID_S))
+ metadata |=
+ rte_le_to_cpu_16(desc->flex_ts.flex.aux1) << 16;
+ } else {
+ if (rte_le_to_cpu_16(desc->flex_ts.flex.aux0) != 0xFFFF)
+ metadata = rte_le_to_cpu_16(desc->flex_ts.flex.aux0);
+ else if (rte_le_to_cpu_16(desc->flex_ts.flex.aux1) != 0xFFFF)
+ metadata = rte_le_to_cpu_16(desc->flex_ts.flex.aux1);
+ }
- if (likely(stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD5_VALID_S)))
- metadata |= rte_le_to_cpu_16(desc->flex_ts.flex.aux1) << 16;
+ if (!metadata)
+ return;
+
+ mb->ol_flags |= ol_flag;
*RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata;
}
doff:4;
uint16_t rsvd;
} tcp;
+
+ uint32_t ip_ofs;
};
/* Offset of mbuf dynamic field for protocol extraction data */
extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_mask;
extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask;
extern uint64_t rte_net_ice_dynflag_proto_xtr_tcp_mask;
+extern uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask;
/**
* The mbuf dynamic field pointer for protocol extraction metadata.
#define RTE_PKT_RX_DYNF_PROTO_XTR_TCP \
(rte_net_ice_dynflag_proto_xtr_tcp_mask)
+/**
+ * The mbuf dynamic flag for IP_OFFSET extraction metadata, it is valid
+ * when dev_args 'proto_xtr' has 'ip_offset' specified.
+ */
+#define RTE_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET \
+ (rte_net_ice_dynflag_proto_xtr_ip_offset_mask)
+
/**
* Check if mbuf dynamic field for protocol extraction metadata is registered.
*
data.tcp.rst ? "R" : "",
data.tcp.syn ? "S" : "",
data.tcp.fin ? "F" : "");
+ else if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET)
+ printf(" - Protocol Offset:ip_offset=%u",
+ data.ip_ofs);
}
#ifdef __cplusplus
rte_net_ice_dynflag_proto_xtr_ipv6_mask;
rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask;
rte_net_ice_dynflag_proto_xtr_tcp_mask;
+ rte_net_ice_dynflag_proto_xtr_ip_offset_mask;
};