[v2,5/5] net/cnxk: select optimized LLC transaction type

Message ID 20240222100729.991411-5-rbhansali@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v2,1/5] common/cnxk: reserve CPT LF for Rx inject |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

Rahul Bhansali Feb. 22, 2024, 10:07 a.m. UTC
  LLC transaction optimization by using LDWB LDTYPE option
in SG preparation for Tx. With this, if data is present
and dirty in LLC then the LLC would mark the data clean.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: No change

 drivers/net/cnxk/cn10k_tx.h | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

--
2.25.1
  

Comments

Jerin Jacob Feb. 23, 2024, 9:04 a.m. UTC | #1
On Thu, Feb 22, 2024 at 3:38 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> LLC transaction optimization by using LDWB LDTYPE option
> in SG preparation for Tx. With this, if data is present
> and dirty in LLC then the LLC would mark the data clean.
>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>

Series applied to dpdk-next-net-mrvl/for-main. Thanks



> ---
> Changes in v2: No change
>
>  drivers/net/cnxk/cn10k_tx.h | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
> index 664e47e1fc..fcd19be77e 100644
> --- a/drivers/net/cnxk/cn10k_tx.h
> +++ b/drivers/net/cnxk/cn10k_tx.h
> @@ -331,9 +331,15 @@ cn10k_nix_tx_skeleton(struct cn10k_eth_txq *txq, uint64_t *cmd,
>                 else
>                         cmd[2] = NIX_SUBDC_EXT << 60;
>                 cmd[3] = 0;
> -               cmd[4] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
> +               if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
> +                       cmd[4] = (NIX_SUBDC_SG << 60) | (NIX_SENDLDTYPE_LDWB << 58) | BIT_ULL(48);
> +               else
> +                       cmd[4] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
>         } else {
> -               cmd[2] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
> +               if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
> +                       cmd[2] = (NIX_SUBDC_SG << 60) | (NIX_SENDLDTYPE_LDWB << 58) | BIT_ULL(48);
> +               else
> +                       cmd[2] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
>         }
>  }
>
> @@ -1989,7 +1995,11 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
>
>         senddesc01_w1 = vdupq_n_u64(0);
>         senddesc23_w1 = senddesc01_w1;
> -       sgdesc01_w0 = vdupq_n_u64((NIX_SUBDC_SG << 60) | BIT_ULL(48));
> +       if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
> +               sgdesc01_w0 = vdupq_n_u64((NIX_SUBDC_SG << 60) | (NIX_SENDLDTYPE_LDWB << 58) |
> +                                         BIT_ULL(48));
> +       else
> +               sgdesc01_w0 = vdupq_n_u64((NIX_SUBDC_SG << 60) | BIT_ULL(48));
>         sgdesc23_w0 = sgdesc01_w0;
>
>         if (flags & NIX_TX_NEED_EXT_HDR) {
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 664e47e1fc..fcd19be77e 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -331,9 +331,15 @@  cn10k_nix_tx_skeleton(struct cn10k_eth_txq *txq, uint64_t *cmd,
 		else
 			cmd[2] = NIX_SUBDC_EXT << 60;
 		cmd[3] = 0;
-		cmd[4] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
+		if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
+			cmd[4] = (NIX_SUBDC_SG << 60) | (NIX_SENDLDTYPE_LDWB << 58) | BIT_ULL(48);
+		else
+			cmd[4] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
 	} else {
-		cmd[2] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
+		if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
+			cmd[2] = (NIX_SUBDC_SG << 60) | (NIX_SENDLDTYPE_LDWB << 58) | BIT_ULL(48);
+		else
+			cmd[2] = (NIX_SUBDC_SG << 60) | BIT_ULL(48);
 	}
 }

@@ -1989,7 +1995,11 @@  cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,

 	senddesc01_w1 = vdupq_n_u64(0);
 	senddesc23_w1 = senddesc01_w1;
-	sgdesc01_w0 = vdupq_n_u64((NIX_SUBDC_SG << 60) | BIT_ULL(48));
+	if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
+		sgdesc01_w0 = vdupq_n_u64((NIX_SUBDC_SG << 60) | (NIX_SENDLDTYPE_LDWB << 58) |
+					  BIT_ULL(48));
+	else
+		sgdesc01_w0 = vdupq_n_u64((NIX_SUBDC_SG << 60) | BIT_ULL(48));
 	sgdesc23_w0 = sgdesc01_w0;

 	if (flags & NIX_TX_NEED_EXT_HDR) {