net/octeontx2: fix minimum length to SMQ config

Message ID 20200511062156.15534-1-skori@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series net/octeontx2: fix minimum length to SMQ config |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Sunil Kumar Kori May 11, 2020, 6:21 a.m. UTC
  NIX exposes NIX_AF_SMQ(0..511)_CFG to configure minimum length
of the packet which is being used for zero padding if packet is
less than configured value.

Setting it to default minimum length i.e. 60 bytes.

Fixes: ec8ddd4fb1be ("net/octeontx2: restructure TM helper functions")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 drivers/net/octeontx2/otx2_tm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
  

Comments

Jerin Jacob May 11, 2020, 9:40 a.m. UTC | #1
On Mon, May 11, 2020 at 11:52 AM Sunil Kumar Kori <skori@marvell.com> wrote:
>
> NIX exposes NIX_AF_SMQ(0..511)_CFG to configure minimum length
> of the packet which is being used for zero padding if packet is
> less than configured value.
>
> Setting it to default minimum length i.e. 60 bytes.
>
> Fixes: ec8ddd4fb1be ("net/octeontx2: restructure TM helper functions")
>
> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/master. Thanks


> ---
>  drivers/net/octeontx2/otx2_tm.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/octeontx2/otx2_tm.c b/drivers/net/octeontx2/otx2_tm.c
> index b57e10f74..8ed059549 100644
> --- a/drivers/net/octeontx2/otx2_tm.c
> +++ b/drivers/net/octeontx2/otx2_tm.c
> @@ -555,10 +555,13 @@ populate_tm_reg(struct otx2_eth_dev *dev,
>         switch (hw_lvl) {
>         case NIX_TXSCH_LVL_SMQ:
>
> -               /* Set xoff which will be cleared later */
> +               /* Set xoff which will be cleared later and minimum length
> +                * which will be used for zero padding if packet length is
> +                * smaller
> +                */
>                 reg[k] = NIX_AF_SMQX_CFG(schq);
> -               regval[k] = BIT_ULL(50);
> -               regval_mask[k] = ~BIT_ULL(50);
> +               regval[k] = BIT_ULL(50) | NIX_MIN_HW_FRS;
> +               regval_mask[k] = ~(BIT_ULL(50) | 0x7f);
>                 k++;
>
>                 /* Parent and schedule conf */
> --
> 2.17.1
>
  

Patch

diff --git a/drivers/net/octeontx2/otx2_tm.c b/drivers/net/octeontx2/otx2_tm.c
index b57e10f74..8ed059549 100644
--- a/drivers/net/octeontx2/otx2_tm.c
+++ b/drivers/net/octeontx2/otx2_tm.c
@@ -555,10 +555,13 @@  populate_tm_reg(struct otx2_eth_dev *dev,
 	switch (hw_lvl) {
 	case NIX_TXSCH_LVL_SMQ:
 
-		/* Set xoff which will be cleared later */
+		/* Set xoff which will be cleared later and minimum length
+		 * which will be used for zero padding if packet length is
+		 * smaller
+		 */
 		reg[k] = NIX_AF_SMQX_CFG(schq);
-		regval[k] = BIT_ULL(50);
-		regval_mask[k] = ~BIT_ULL(50);
+		regval[k] = BIT_ULL(50) | NIX_MIN_HW_FRS;
+		regval_mask[k] = ~(BIT_ULL(50) | 0x7f);
 		k++;
 
 		/* Parent and schedule conf */