net/sfc: report user flag on EF100 native datapath
authorIvan Malov <ivan.malov@oktetlabs.ru>
Tue, 12 Oct 2021 19:46:20 +0000 (22:46 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 12 Oct 2021 22:47:49 +0000 (00:47 +0200)
Detect the flag in Rx prefix and pass it to users.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/net/sfc/sfc_ef100_rx.c
drivers/net/sfc/sfc_rx.c

index 37957ea..d6308dc 100644 (file)
@@ -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,
index 5b92401..5e120f5 100644 (file)
@@ -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;