common/sfc_efx/base: add ingress m-port RxQ flag
authorIgor Romanov <igor.romanov@oktetlabs.ru>
Fri, 2 Jul 2021 08:39:35 +0000 (11:39 +0300)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 20 Jul 2021 10:20:31 +0000 (12:20 +0200)
Add a flag to request support for ingress m-port on an RxQ.
Implement it only for Riverhead, other families will return an error
if the flag is set.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
drivers/common/sfc_efx/base/ef10_rx.c
drivers/common/sfc_efx/base/efx.h
drivers/common/sfc_efx/base/efx_rx.c
drivers/common/sfc_efx/base/rhead_rx.c

index cfa60bd..0e14064 100644 (file)
@@ -1031,6 +1031,11 @@ ef10_rx_qcreate(
        EFSYS_ASSERT(params.es_bufs_per_desc == 0);
 #endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */
 
+       if (flags & EFX_RXQ_FLAG_INGRESS_MPORT) {
+               rc = ENOTSUP;
+               goto fail12;
+       }
+
        /* Scatter can only be disabled if the firmware supports doing so */
        if (flags & EFX_RXQ_FLAG_SCATTER)
                params.disable_scatter = B_FALSE;
@@ -1044,7 +1049,7 @@ ef10_rx_qcreate(
 
        if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep, label, index,
                    esmp, &params)) != 0)
-               goto fail12;
+               goto fail13;
 
        erp->er_eep = eep;
        erp->er_label = label;
@@ -1057,6 +1062,8 @@ ef10_rx_qcreate(
 
        return (0);
 
+fail13:
+       EFSYS_PROBE(fail13);
 fail12:
        EFSYS_PROBE(fail12);
 #if EFSYS_OPT_RX_ES_SUPER_BUFFER
index 6a99099..72ab4af 100644 (file)
@@ -2925,6 +2925,7 @@ typedef enum efx_rx_prefix_field_e {
        EFX_RX_PREFIX_FIELD_USER_MARK_VALID,
        EFX_RX_PREFIX_FIELD_CSUM_FRAME,
        EFX_RX_PREFIX_FIELD_INGRESS_VPORT,
+       EFX_RX_PREFIX_FIELD_INGRESS_MPORT = EFX_RX_PREFIX_FIELD_INGRESS_VPORT,
        EFX_RX_PREFIX_NFIELDS
 } efx_rx_prefix_field_t;
 
@@ -2998,6 +2999,10 @@ typedef enum efx_rxq_type_e {
  * the driver.
  */
 #define        EFX_RXQ_FLAG_RSS_HASH           0x4
+/*
+ * Request ingress mport field in the Rx prefix of a queue.
+ */
+#define        EFX_RXQ_FLAG_INGRESS_MPORT      0x8
 
 LIBEFX_API
 extern __checkReturn   efx_rc_t
index 7c6fecf..7e63363 100644 (file)
@@ -1743,14 +1743,20 @@ siena_rx_qcreate(
                goto fail2;
        }
 
-       if (flags & EFX_RXQ_FLAG_SCATTER) {
 #if EFSYS_OPT_RX_SCATTER
-               jumbo = B_TRUE;
+#define SUPPORTED_RXQ_FLAGS EFX_RXQ_FLAG_SCATTER
 #else
+#define SUPPORTED_RXQ_FLAGS EFX_RXQ_FLAG_NONE
+#endif
+       /* Reject flags for unsupported queue features */
+       if ((flags & ~SUPPORTED_RXQ_FLAGS) != 0) {
                rc = EINVAL;
                goto fail3;
-#endif /* EFSYS_OPT_RX_SCATTER */
        }
+#undef SUPPORTED_RXQ_FLAGS
+
+       if (flags & EFX_RXQ_FLAG_SCATTER)
+               jumbo = B_TRUE;
 
        /* Set up the new descriptor queue */
        EFX_POPULATE_OWORD_7(oword,
@@ -1769,10 +1775,8 @@ siena_rx_qcreate(
 
        return (0);
 
-#if !EFSYS_OPT_RX_SCATTER
 fail3:
        EFSYS_PROBE(fail3);
-#endif
 fail2:
        EFSYS_PROBE(fail2);
 fail1:
index b2dacba..f1d46f7 100644 (file)
@@ -629,6 +629,9 @@ rhead_rx_qcreate(
                fields_mask |= 1U << EFX_RX_PREFIX_FIELD_RSS_HASH_VALID;
        }
 
+       if (flags & EFX_RXQ_FLAG_INGRESS_MPORT)
+               fields_mask |= 1U << EFX_RX_PREFIX_FIELD_INGRESS_MPORT;
+
        /*
         * LENGTH is required in EF100 host interface, as receive events
         * do not include the packet length.