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 482A4A0C47; Tue, 5 Oct 2021 15:02:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C7B8941357; Tue, 5 Oct 2021 15:02:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 4F7234134B for ; Tue, 5 Oct 2021 15:02:48 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 195CEeMh028581; Tue, 5 Oct 2021 06:02:14 -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-transfer-encoding : content-type; s=pfpt0220; bh=pYyFGlj545cm8hl1o8iMkddH+rY6Q1nVWdmFADL/iHI=; b=DglCZTKXoq6dFX/YTw3jss6NMZXHP1h/TeoZ+spxFrNaDDLsfkho8D/w9iHNWXcjXWWf CpBus6wWZYQPDjCc3ZF33PtgIxKRpcpKUu2/pWli28AJAfV6rOc1BW1ClRiSCuBTLgOn xyKqtIQSFeXbF7plwYRImNyZf/8omBFlDip/d94Wxz1ylb1wrq9srDfrKkkqNDkauBwj Wn5FkEbH6UIUUK0VegfD3S3O5f2VQ1qRHOqSfrBuTF2vmaViN7EZfA2NhaKOQNe5FGK2 ga4fdCdKjS3dA1da2BCt0Ea3p34q4Olwhni8cjXcqhREaUJmowe1mx1PSa/R7l+kAetw Gg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3bgmv5rg61-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 05 Oct 2021 06:02:14 -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.18; Tue, 5 Oct 2021 06:02:12 -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.18 via Frontend Transport; Tue, 5 Oct 2021 06:02:12 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 84E993F7077; Tue, 5 Oct 2021 06:01:55 -0700 (PDT) From: To: , Ori Kam , Thomas Monjalon , Ferruh Yigit , "Andrew Rybchenko" CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Jerin Jacob Date: Tue, 5 Oct 2021 18:29:22 +0530 Message-ID: <20211005125923.2651449-1-jerinj@marvell.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: UkdN-oOd-cRbdtKhy-pkGlUd85_qL8Ft X-Proofpoint-ORIG-GUID: UkdN-oOd-cRbdtKhy-pkGlUd85_qL8Ft X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-05_01,2021-10-04_01,2020-04-07_01 Subject: [dpdk-dev] [RFC PATCH] ethdev: support priority based flow control 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 Sender: "dev" From: Jerin Jacob rte_eth_dev_priority_flow_ctrl_set() based API is not generic as it can not support other than VLAN priority mapping to PFC traffic class. Introducing RTE_FLOW_ACTION_TYPE_PFC_SET_TC rte_flow action to set the traffic class as per 802.1Qbb specification. This will enable, Traffic class(8bit) to be selected based on any packet field like DSCP. Also, making it as rte_flow action will enable fine control on traffic class selection to a specific queue or VF etc. Signed-off-by: Jerin Jacob --- Planning to submit the testpmd and cnxk ethdev driver changes after receiving the feedback on this. doc/guides/prog_guide/rte_flow.rst | 24 ++++++++++++++++++++++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 27 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 2b42d5ec8c..e59f8a2902 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2999,6 +2999,30 @@ which is set in the packet meta-data (i.e. struct ``rte_mbuf::sched::color``) | ``meter_color`` | Packet color | +-----------------+--------------+ +Action: ``PFC_SET_TC`` +^^^^^^^^^^^^^^^^^^^^^^ + +Set traffic class as per PFC (802.1Qbb) specification. + +This action must be used with any of the following action. + +- ``RTE_FLOW_ACTION_TYPE_QUEUE`` +- ``RTE_FLOW_ACTION_TYPE_RSS`` +- ``RTE_FLOW_ACTION_TYPE_PF`` +- ``RTE_FLOW_ACTION_TYPE_VF`` +- ``RTE_FLOW_ACTION_TYPE_PHY_PORT`` +- ``RTE_FLOW_ACTION_TYPE_PORT_ID`` + +.. _table_rte_flow_action_pfc_set_tc: + +.. table:: PFC_SET_PRIORITY + + +-----------------+-------------------------------------+ + | Field | Value | + +=================+=====================================+ + | ``tc`` | Traffic class as per PFC (802.1Qbb) | + +-----------------+-------------------------------------+ + Negative types ~~~~~~~~~~~~~~ diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 8cb7a069c8..75c661159e 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -189,6 +189,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = { */ MK_FLOW_ACTION(INDIRECT, 0), MK_FLOW_ACTION(CONNTRACK, sizeof(struct rte_flow_action_conntrack)), + MK_FLOW_ACTION(PFC_SET_TC, sizeof(struct rte_flow_action_pfc_set_tc)), }; int diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 7b1ed7f110..5298418e9e 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -2409,6 +2409,13 @@ enum rte_flow_action_type { * See struct rte_flow_action_meter_color. */ RTE_FLOW_ACTION_TYPE_METER_COLOR, + + /** + * Set traffic class as per PFC (802.1Qbb) specification. + * + * See struct rte_flow_action_pfc_set_tc. + */ + RTE_FLOW_ACTION_TYPE_PFC_SET_TC, }; /** @@ -3168,6 +3175,26 @@ struct rte_flow_action_meter_color { enum rte_color color; /**< Packet color. */ }; +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ACTION_TYPE_PFC_SET_TC + * + * Set traffic class as per PFC (802.1Qbb) specification. + * + * This action must be used any of the following action. + * - RTE_FLOW_ACTION_TYPE_QUEUE, + * - RTE_FLOW_ACTION_TYPE_RSS, + * - RTE_FLOW_ACTION_TYPE_PF, + * - RTE_FLOW_ACTION_TYPE_VF, + * - RTE_FLOW_ACTION_TYPE_PHY_PORT, + * - RTE_FLOW_ACTION_TYPE_PORT_ID + */ +struct rte_flow_action_pfc_set_tc { + uint8_t tc; /**< Traffic class as per PFC (802.1Qbb) specification */ +}; + /** * Field IDs for MODIFY_FIELD action. */ -- 2.33.0