From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2430FA0032; Mon, 12 Sep 2022 15:16:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADEA54284D; Mon, 12 Sep 2022 15:16:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 1AD2242825 for ; Mon, 12 Sep 2022 15:16:28 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28BMZ8ln001435 for ; Mon, 12 Sep 2022 06:16:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=phd/9kVFjCDQWqYH60p1MBPrZdNdc2dsI8dxzKcYfJo=; b=ij0k1+HPZAdy/jMCIlLe52eFPw58xEYHWHSjOpBJOKbUwRU7vRGLTnqyweVQb0lGbHGy WrsMGY34GWd44lvQ2plwgoSGlbbo1x9DxKdpyVhZvxJyDLeUYxD/n4RuePwEbpWq+c1N HkFmyvDO/qpVCS382LGJFmXiDpTLcQ7q50SApp59l2p3NeNNVUaxnds5HkBZhItdWCiI HQWm9i7UqaBDHNeNiwWcjQ/HBitZmKTW5ldOmTwh+BBWXIlemNx8o0lns+rCfLjCopsm G+8lA0i5XxxJt/rvhoGKbMGijufJotdWdpCetMj/SAVaK3nD6b7Kp4jy04Ski0AiJMD0 KA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jgt3mxt56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 12 Sep 2022 06:16:27 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Sep 2022 06:16:25 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 12 Sep 2022 06:16:25 -0700 Received: from localhost.localdomain (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 649573F709F; Mon, 12 Sep 2022 06:16:23 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Subject: [PATCH v3 18/32] common/cnxk: updated shaper profile with red algorithm Date: Mon, 12 Sep 2022 18:44:11 +0530 Message-ID: <20220912131425.1973415-18-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912131425.1973415-1-ndabilpuram@marvell.com> References: <20220809184908.24030-1-ndabilpuram@marvell.com> <20220912131425.1973415-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: zNnIPBMXgYS_qZOvKfoJCszLUvejS7g_ X-Proofpoint-GUID: zNnIPBMXgYS_qZOvKfoJCszLUvejS7g_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-12_08,2022-09-12_01,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Satha Rao Updated shaper profile with user configurable RED algorithm. This helps in configuring a TM node in red drop mode vs stall mode. Signed-off-by: Satha Rao --- drivers/common/cnxk/roc_nix.h | 1 + drivers/common/cnxk/roc_nix_tm_utils.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h index 77e4d2919b..b17623076c 100644 --- a/drivers/common/cnxk/roc_nix.h +++ b/drivers/common/cnxk/roc_nix.h @@ -572,6 +572,7 @@ struct roc_nix_tm_shaper_profile { int32_t pkt_len_adj; bool pkt_mode; int8_t accuracy; + uint8_t red_algo; /* Function to free this memory */ void (*free_fn)(void *profile); }; diff --git a/drivers/common/cnxk/roc_nix_tm_utils.c b/drivers/common/cnxk/roc_nix_tm_utils.c index b9b605f8b1..193f9df5ff 100644 --- a/drivers/common/cnxk/roc_nix_tm_utils.c +++ b/drivers/common/cnxk/roc_nix_tm_utils.c @@ -1236,11 +1236,14 @@ roc_nix_tm_shaper_default_red_algo(struct roc_nix_tm_node *node, struct nix_tm_shaper_profile *profile; struct nix_tm_shaper_data cir, pir; + if (!roc_prof) + return; + profile = (struct nix_tm_shaper_profile *)roc_prof->reserved; - tm_node->red_algo = NIX_REDALG_STD; + tm_node->red_algo = roc_prof->red_algo; /* C0 doesn't support STALL when both PIR & CIR are enabled */ - if (profile && roc_model_is_cn96_cx()) { + if (roc_model_is_cn96_cx()) { nix_tm_shaper_conf_get(profile, &cir, &pir); if (pir.rate && cir.rate) -- 2.25.1