From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05E3CA057B; Mon, 30 Mar 2020 18:00:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 744FE1BFD4; Mon, 30 Mar 2020 18:00:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id E7A942B8B for ; Mon, 30 Mar 2020 18:00:30 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02UFuqvK016073; Mon, 30 Mar 2020 09:00:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=rIblLsFu3DhvTdo9rYzAXGVkq6K1XhX9ACBMeCR9+zw=; b=Gw6SDkZ+oDP5Z4WC5Gb8wkof060JRsfv8xmYCmvuKlz6PEX4/EBv8gyyzmHjoke1xwlp 4E97sNuDHKJ6Hff0u4v+0OcfH61odLz1+M7u7yGMnaVfSSd77trmMpHotLM5wfe4Pc0v t5jAgvTg6L/GLHrO/kYePCIThtOkJInGAGYX5whIg75CPotxCn2EqXVBJX3alqWwD30G BiWx1s7G+X0Tadk4Zxg22XfrbWwgEaXMjllGEb8U3izqMh2RdfrZzUYHzAwu525jTtjd nzy93GqgsfWJ3yUyR5sOVQXuP8I4IHoQnngIPVpVTsW1OKq4cD8Qu5C2pp4zBd4pg4Iz nw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3023xny1sq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 30 Mar 2020 09:00:29 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 30 Mar 2020 09:00:28 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 30 Mar 2020 09:00:28 -0700 Received: from hyd1588t430.marvell.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 2E2993F7043; Mon, 30 Mar 2020 09:00:25 -0700 (PDT) From: Nithin Dabilpuram To: Cristian Dumitrescu , Thomas Monjalon , Ferruh Yigit , "Andrew Rybchenko" CC: , , , "Nithin Dabilpuram" Date: Mon, 30 Mar 2020 21:30:18 +0530 Message-ID: <20200330160019.29674-1-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-03-30_07:2020-03-30, 2020-03-30 signatures=0 Subject: [dpdk-dev] [PATCH 1/2] ethdev: add tm cap for private shaper packet mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some NIC hardware have private shaper attached to every node and has a limitation where packet mode is applied both to the scheduling of a node's children using WFQ and shaping of traffic out of the private shaper. This cannot be expressed using existing capabilities or configurations. So this patch adds a tm capability that if set by a PMD implies that packet mode when configured is even applied to private shaper connected to that node. This also implies the limitation that all the SP children of that node should have same mode at any point of time i.e either packet mode or byte mode and same applies to private shaper in that NIC PMD. This patch also adds missing capability that tells whether PMD supports wfq weight mode or not. Signed-off-by: Nithin Dabilpuram --- lib/librte_ethdev/rte_tm.h | 62 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/lib/librte_ethdev/rte_tm.h b/lib/librte_ethdev/rte_tm.h index f9c0cf3..50bcea6 100644 --- a/lib/librte_ethdev/rte_tm.h +++ b/lib/librte_ethdev/rte_tm.h @@ -339,6 +339,20 @@ struct rte_tm_capabilities { */ uint32_t sched_wfq_weight_max; + /** WFQ weight mode supported. Non-zero value indicates wfq weight mode + * is supported and a SP child (even a wfq group) can be configured to + * use packet-mode or byte-mode for weight calculations. + */ + int sched_wfq_weight_mode_supported; + + /** Private shaper and scheduler weight mode. + * When non-zero value indicates that all SP children should have + * same weight mode and the same mode applies to private + * shaper as well. This is only valid if + * *sched_wfq_weight_mode_supported* is set. + */ + int sched_shaper_private_weight_mode; + /** WRED packet mode support. When non-zero, this parameter indicates * that there is at least one leaf node that supports the WRED packet * mode, which might not be true for all the leaf nodes. In packet @@ -554,6 +568,21 @@ struct rte_tm_level_capabilities { */ uint32_t sched_wfq_weight_max; + /** WFQ weight mode supported. Non-zero value indicates + * wfq weight mode is supported and a SP child + * (even a wfq group) can be configured to use + * packet-mode or byte-mode for weight calculations. + */ + int sched_wfq_weight_mode_supported; + + /** Private shaper and scheduler weight mode. + * When non-zero value indicates that all SP children + * should have same weight mode and the same mode + * applies to private shaper as well. This is only + * valid if *sched_wfq_weight_mode_supported* is set. + */ + int sched_shaper_private_weight_mode; + /** Mask of statistics counter types supported by the * non-leaf nodes on this level. Every supported * statistics counter type is supported by at least one @@ -735,6 +764,21 @@ struct rte_tm_node_capabilities { * WFQ weight, so WFQ is reduced to FQ. */ uint32_t sched_wfq_weight_max; + + /** WFQ weight mode supported. Non-zero value indicates + * wfq weight mode is supported and a SP child + * (even a wfq group) can be configured to use + * packet-mode or byte-mode for weight calculations. + */ + int sched_wfq_weight_mode_supported; + + /** Private shaper and scheduler weight mode. + * When non-zero value indicates that all SP children + * should have same weight mode and the same mode + * applies to private shaper as well. This is only + * valid if *sched_wfq_weight_mode_supported* is set. + */ + int sched_shaper_private_weight_mode; } nonleaf; /** Items valid only for leaf nodes. */ @@ -836,10 +880,19 @@ struct rte_tm_wred_params { * Token bucket */ struct rte_tm_token_bucket { - /** Token bucket rate (bytes per second) */ + /** Token bucket rate. This is in "bytes per second" by default. + * For private shaper attached to node that is set in packet mode + * and tm capability *sched_shaper_private_weight_mode* is set, + * this is interpreted as "packets per second". + */ uint64_t rate; - /** Token bucket size (bytes), a.k.a. max burst size */ + /** Token bucket size, a.k.a. max burst size. + * This is in "bytes" by default. + * For private shaper attached to node that is set in packet mode + * and tm capability *sched_shaper_private_weight_mode* is set, + * this is interpreted as "packets". + */ uint64_t size; }; @@ -924,7 +977,10 @@ struct rte_tm_node_params { * indicates that WFQ is to be used for all priorities. * When non-NULL, it points to a pre-allocated array of * *n_sp_priorities* values, with non-zero value for - * byte-mode and zero for packet-mode. + * byte-mode and zero for packet-mode. The same mode is + * used for private shaper connected to this node if + * tm capability *sched_shaper_private_weight_mode* is + * true. */ int *wfq_weight_mode; -- 2.8.4