From: Ivan Malov Date: Tue, 12 Oct 2021 19:46:20 +0000 (+0300) Subject: net/sfc: report user flag on EF100 native datapath X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bf38764acc5888502e8df863bc4638b4a047b0d4;p=dpdk.git net/sfc: report user flag on EF100 native datapath Detect the flag in Rx prefix and pass it to users. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- diff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c index 37957eae11..d6308dc70d 100644 --- a/drivers/net/sfc/sfc_ef100_rx.c +++ b/drivers/net/sfc/sfc_ef100_rx.c @@ -63,6 +63,7 @@ struct sfc_ef100_rxq { #define SFC_EF100_RXQ_USER_MARK 0x20 #define SFC_EF100_RXQ_FLAG_INTR_EN 0x40 #define SFC_EF100_RXQ_INGRESS_MPORT 0x80 +#define SFC_EF100_RXQ_USER_FLAG 0x100 unsigned int ptr_mask; unsigned int evq_phase_bit_shift; unsigned int ready_pkts; @@ -374,6 +375,7 @@ static const efx_rx_prefix_layout_t sfc_ef100_rx_prefix_layout = { EFX_RX_PREFIX_FIELD(INGRESS_MPORT, ESF_GZ_RX_PREFIX_INGRESS_MPORT, B_FALSE), SFC_EF100_RX_PREFIX_FIELD(RSS_HASH, B_FALSE), + SFC_EF100_RX_PREFIX_FIELD(USER_FLAG, B_FALSE), SFC_EF100_RX_PREFIX_FIELD(USER_MARK, B_FALSE), #undef SFC_EF100_RX_PREFIX_FIELD @@ -410,6 +412,15 @@ sfc_ef100_rx_prefix_to_offloads(const struct sfc_ef100_rxq *rxq, ESF_GZ_RX_PREFIX_RSS_HASH); } + if (rxq->flags & SFC_EF100_RXQ_USER_FLAG) { + uint32_t user_flag; + + user_flag = EFX_XWORD_FIELD(rx_prefix[0], + ESF_GZ_RX_PREFIX_USER_FLAG); + if (user_flag != 0) + ol_flags |= PKT_RX_FDIR; + } + if (rxq->flags & SFC_EF100_RXQ_USER_MARK) { uint32_t user_mark; @@ -815,6 +826,12 @@ sfc_ef100_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr, else rxq->flags &= ~SFC_EF100_RXQ_RSS_HASH; + if ((unsup_rx_prefix_fields & + (1U << EFX_RX_PREFIX_FIELD_USER_FLAG)) == 0) + rxq->flags |= SFC_EF100_RXQ_USER_FLAG; + else + rxq->flags &= ~SFC_EF100_RXQ_USER_FLAG; + if ((unsup_rx_prefix_fields & (1U << EFX_RX_PREFIX_FIELD_USER_MARK)) == 0) rxq->flags |= SFC_EF100_RXQ_USER_MARK; @@ -935,6 +952,7 @@ struct sfc_dp_rx sfc_ef100_rx = { .hw_fw_caps = SFC_DP_HW_FW_CAP_EF100, }, .features = SFC_DP_RX_FEAT_MULTI_PROCESS | + SFC_DP_RX_FEAT_FLOW_FLAG | SFC_DP_RX_FEAT_FLOW_MARK | SFC_DP_RX_FEAT_INTR | SFC_DP_RX_FEAT_STATS, diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 5b924010bd..5e120f5851 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -1178,6 +1178,9 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, if (offloads & DEV_RX_OFFLOAD_RSS_HASH) rxq_info->type_flags |= EFX_RXQ_FLAG_RSS_HASH; + if ((sa->negotiated_rx_metadata & RTE_ETH_RX_METADATA_USER_FLAG) != 0) + rxq_info->type_flags |= EFX_RXQ_FLAG_USER_FLAG; + if ((sa->negotiated_rx_metadata & RTE_ETH_RX_METADATA_USER_MARK) != 0) rxq_info->type_flags |= EFX_RXQ_FLAG_USER_MARK;