[dpdk-dev,32/32] net/dpaa2: enable stashing for LS2088A devices

Message ID 1480875447-23680-33-git-send-email-hemant.agrawal@nxp.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
checkpatch/checkpatch warning coding style issues

Commit Message

Hemant Agrawal Dec. 4, 2016, 6:17 p.m. UTC
  Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
  

Comments

Ferruh Yigit Dec. 6, 2016, 7:50 p.m. UTC | #1
On 12/4/2016 6:17 PM, Hemant Agrawal wrote:
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Not just specific to this patch, but overall, can you please try to
provide more information in the comment logs.

> ---
>  drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index 1a25f07..dd8e8fb 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -229,6 +229,17 @@
>  	options = options | DPNI_QUEUE_OPT_USER_CTX;
>  	cfg.user_context = (uint64_t)(dpaa2_q);
>  
> +	/*if ls2088 or rev2 device, enable the stashing */
> +	if ((qbman_get_version() & 0xFFFF0000) > QMAN_REV_4000) {
> +		options |= DPNI_QUEUE_OPT_FLC;
> +		cfg.flc.stash_control = true;
> +		cfg.flc.value &= 0xFFFFFFFFFFFFFFC0;
> +		/* 00 00 00 - last 6 bit represent annotation, context stashing,
> +		*  data stashing setting 01 01 00 (0x14) to enable
> +		*  1 line annotation, 1 line context
> +		*/
> +		cfg.flc.value |= 0x14;
> +	}
>  	ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_RX,
>  			     dpaa2_q->tc_index, flow_id, options, &cfg);
>  	if (ret) {
>
  

Patch

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 1a25f07..dd8e8fb 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -229,6 +229,17 @@ 
 	options = options | DPNI_QUEUE_OPT_USER_CTX;
 	cfg.user_context = (uint64_t)(dpaa2_q);
 
+	/*if ls2088 or rev2 device, enable the stashing */
+	if ((qbman_get_version() & 0xFFFF0000) > QMAN_REV_4000) {
+		options |= DPNI_QUEUE_OPT_FLC;
+		cfg.flc.stash_control = true;
+		cfg.flc.value &= 0xFFFFFFFFFFFFFFC0;
+		/* 00 00 00 - last 6 bit represent annotation, context stashing,
+		*  data stashing setting 01 01 00 (0x14) to enable
+		*  1 line annotation, 1 line context
+		*/
+		cfg.flc.value |= 0x14;
+	}
 	ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_RX,
 			     dpaa2_q->tc_index, flow_id, options, &cfg);
 	if (ret) {