From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: [PATCH 23/53] net/sfc/base: enforce packed stream fake buffer size Date: Thu, 16 Nov 2017 08:04:11 +0000 Message-ID: <1510819481-6809-24-git-send-email-arybchenko@solarflare.com> References: <1510819481-6809-1-git-send-email-arybchenko@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Andrew Rybchenko To: Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 773441B22E for ; Thu, 16 Nov 2017 09:05:02 +0100 (CET) In-Reply-To: <1510819481-6809-1-git-send-email-arybchenko@solarflare.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Andrew Rybchenko In the case of packed stream real size of the buffer does not fit in Rx descriptor byte count. Real size is specified on Rx queue setup. Non-zero fake should be used to bypass hardware checks. Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/base/ef10_rx.c | 17 +++++++++++++++++ drivers/net/sfc/base/efx.h | 6 ------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/net/sfc/base/ef10_rx.c index 534a06e..4c74d1f 100644 --- a/drivers/net/sfc/base/ef10_rx.c +++ b/drivers/net/sfc/base/ef10_rx.c @@ -707,6 +707,14 @@ ef10_rx_prefix_hash( } #endif /* EFSYS_OPT_RX_SCALE */ +#if EFSYS_OPT_RX_PACKED_STREAM +/* + * Fake length for RXQ descriptors in packed stream mode + * to make hardware happy + */ +#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 +#endif + void ef10_rx_qpost( __in efx_rxq_t *erp, @@ -721,6 +729,15 @@ ef10_rx_qpost( unsigned int offset; unsigned int id; +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * Real size of the buffer does not fit into ESF_DZ_RX_KER_BYTE_CNT + * and equal to 0 after applying mask. Hardware does not like it. + */ + if (erp->er_ev_qstate->eers_rx_packed_stream) + size = EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE; +#endif + /* The client driver must not overfill the queue */ EFSYS_ASSERT3U(added - completed + n, <=, EFX_RXQ_LIMIT(erp->er_mask + 1)); diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h index bf1ed21..bf17aba 100644 --- a/drivers/net/sfc/base/efx.h +++ b/drivers/net/sfc/base/efx.h @@ -2043,12 +2043,6 @@ efx_rx_qpush( #if EFSYS_OPT_RX_PACKED_STREAM -/* - * Fake length for RXQ descriptors in packed stream mode - * to make hardware happy - */ -#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 - extern void efx_rx_qpush_ps_credits( __in efx_rxq_t *erp); -- 2.7.4