From: Igor Romanov Date: Fri, 2 Jul 2021 08:39:35 +0000 (+0300) Subject: common/sfc_efx/base: add ingress m-port RxQ flag X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=aa3e21f00646006cd308f27f00b23fd927a57fb3;p=dpdk.git common/sfc_efx/base: add ingress m-port RxQ flag 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 Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: Ivan Malov --- diff --git a/drivers/common/sfc_efx/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c index cfa60bd324..0e140645a5 100644 --- a/drivers/common/sfc_efx/base/ef10_rx.c +++ b/drivers/common/sfc_efx/base/ef10_rx.c @@ -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, ¶ms)) != 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 diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index 6a99099ad2..72ab4af01c 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -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 diff --git a/drivers/common/sfc_efx/base/efx_rx.c b/drivers/common/sfc_efx/base/efx_rx.c index 7c6fecf925..7e63363be7 100644 --- a/drivers/common/sfc_efx/base/efx_rx.c +++ b/drivers/common/sfc_efx/base/efx_rx.c @@ -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: diff --git a/drivers/common/sfc_efx/base/rhead_rx.c b/drivers/common/sfc_efx/base/rhead_rx.c index b2dacbab32..f1d46f7c70 100644 --- a/drivers/common/sfc_efx/base/rhead_rx.c +++ b/drivers/common/sfc_efx/base/rhead_rx.c @@ -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.