[v1,07/33] baseband/acc100: avoid mux for small inbound frames

Message ID 20220816055258.107564-8-hernan.vargas@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series baseband/acc100: changes for 22.11 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Vargas, Hernan Aug. 16, 2022, 5:52 a.m. UTC
  Update check_mux to avoid multiplexing small inbound frames.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
index 97e4078a24..fbd6605802 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -3551,20 +3551,25 @@  acc100_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data,
 }
 
 /* Check we can mux encode operations with common FCW */
-static inline bool
+static inline int16_t
 check_mux(struct rte_bbdev_enc_op **ops, uint16_t num) {
 	uint16_t i;
 	if (num <= 1)
-		return false;
+		return 1;
 	for (i = 1; i < num; ++i) {
 		/* Only mux compatible code blocks */
 		if (memcmp((uint8_t *)(&ops[i]->ldpc_enc) + ACC100_ENC_OFFSET,
 				(uint8_t *)(&ops[0]->ldpc_enc) +
 				ACC100_ENC_OFFSET,
 				ACC100_CMP_ENC_SIZE) != 0)
-			return false;
+			return i;
 	}
-	return true;
+	/* Avoid multiplexing small inbound size frames */
+	int Kp = (ops[0]->ldpc_enc.basegraph == 1 ? 22 : 10) *
+			ops[0]->ldpc_enc.z_c - ops[0]->ldpc_enc.n_filler;
+	if (Kp  <= ACC100_LIMIT_DL_MUX_BITS)
+		return 1;
+	return num;
 }
 
 /** Enqueue encode operations for ACC100 device in CB mode. */
@@ -3586,7 +3591,8 @@  acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,
 		}
 		avail--;
 		enq = RTE_MIN(left, ACC100_MUX_5GDL_DESC);
-		if (check_mux(&ops[i], enq)) {
+		enq = check_mux(&ops[i], enq);
+		if (enq > 1) {
 			ret = enqueue_ldpc_enc_n_op_cb(q, &ops[i],
 					desc_idx, enq);
 			if (ret < 0) {