From patchwork Thu Oct 18 10:44:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pattan, Reshma" X-Patchwork-Id: 47042 X-Patchwork-Delegate: cristian.dumitrescu@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 590E25F33; Thu, 18 Oct 2018 12:44:16 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id ED6FD5F2E for ; Thu, 18 Oct 2018 12:44:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2018 03:44:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,396,1534834800"; d="scan'208";a="266729052" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by orsmga005.jf.intel.com with ESMTP; 18 Oct 2018 03:44:11 -0700 From: Reshma Pattan To: dev@dpdk.org, marko.kovacevic@intel.com, john.mcnamara@intel.com Cc: Jasvinder Singh , Reshma Pattan Date: Thu, 18 Oct 2018 11:44:09 +0100 Message-Id: <1539859449-8248-1-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] doc: update softnic doc for flow and qos API support 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" Update document with flow and qos api support in softnic PMD. Signed-off-by: Jasvinder Singh Signed-off-by: Reshma Pattan Reviewed-by: Marko Kovacevic --- doc/guides/nics/softnic.rst | 119 ++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/doc/guides/nics/softnic.rst b/doc/guides/nics/softnic.rst index 6c2287a19..86db172b0 100644 --- a/doc/guides/nics/softnic.rst +++ b/doc/guides/nics/softnic.rst @@ -248,3 +248,122 @@ command description provided in `softnic/rte_eth_softnic_cli.c`. thread 1 pipeline RX enable (Soft NIC rx pipeline enable on cpu thread id 1) thread 1 pipeline TX enable (Soft NIC tx pipeline enable on cpu thread id 1) + +QoS API Support: +---------------- + +SoftNIC PMD implements ethdev traffic management APIs ``rte_tm.h`` that +allow building and committing traffic manager hierarchy, configuring hierarchy +nodes of the Quality of Service (QoS) scheduler supported by DPDK librte_sched +library. Furthermore, APIs for run-time update to the traffic manager hierarchy +are supported by PMD. + +SoftNIC PMD also implements ethdev traffic metering and policing APIs +``rte_mtr.h`` that enables metering and marking of the packets with the +appropriate color (green, yellow or red), according to the traffic metering +algorithm. For the meter output color, policer actions can be configured +which include keep the same packet color (essentially a no-op action), +override the color the packet or drop the packet. + +.. Note: + +The SoftNIC does not support the meter object shared by several flows, thus only +supports creating meter object private to the flow. Once meter object is +successfully created, it can be linked to the specific flow by specifying the +``meter`` flow action in the flow rule. + +Flow API support: +----------------- + +The SoftNIC PMD implements ethdev flow APIs ``rte_flow.h`` that allow validating +flow rules, adding flow rules to the SoftNIC pipeline as table rules, deleting +and querying the flow rules. The PMD provides new cli command for creating the +flow group and their mapping to the SoftNIC pipeline and table. This cli should +be configured as part of firmware file. + + .. code-block:: console + + flowapi map group ingress | egress pipeline \ + table + +From the flow attributes of the flow, PMD uses the group id to get the mapped +pipeline and table. PMD supports number of flow actions such as +``JMP, QUEUE, RSS, DROP, COUNT, METER, VXLAN`` etc. + +.. Note: + +The flow must have one terminating actions i.e. ``JMP or RSS or QUEUE or DROP``. +For the count and drop actions the underlying PMD doesn't support the +functionality yet. So it is not recommended for use. + +The flow API can be tested with the help of testpmd application. The SoftNIC +firmware specifies CLI commands for port configuration, pipeline creation, +action profile creation and table creation. Once application gets initialized, +the flow rules can be added through the testpmd CLI. +The PMD will translate the flow rules to the SoftNIC pipeline tables rules. + +Example: +~~~~~~~~ +Example demonstrates the flow queue action using the SoftNIC firmware and testpmd +commands. + +* Prepare SoftNIC firmware + + .. code-block:: console + + link LINK0 dev 0000:83:00.0 + link LINK1 dev 0000:81:00.0 + pipeline RX period 10 offset_port_id 0 + pipeline RX port in bsz 32 link LINK0 rxq 0 + pipeline RX port in bsz 32 link LINK1 rxq 0 + pipeline RX port out bsz 32 swq RXQ0 + pipeline RX port out bsz 32 swq RXQ1 + table action profile AP0 ipv4 offset 278 fwd + pipeline RX table match hash ext key 16 mask + 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF \ + offset 278 buckets 16K size 65K action AP0 + pipeline RX port in 0 table 0 + pipeline RX port in 1 table 0 + flowapi map group 0 ingress pipeline RX table 0 + pipeline TX period 10 offset_port_id 0 + pipeline TX port in bsz 32 swq TXQ0 + pipeline TX port in bsz 32 swq TXQ1 + pipeline TX port out bsz 32 link LINK0 txq 0 + pipeline TX port out bsz 32 link LINK1 txq 0 + pipeline TX table match hash ext key 16 mask + 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF \ + offset 278 buckets 16K size 65K action AP0 + pipeline TX port in 0 table 0 + pipeline TX port in 1 table 0 + pipeline TX table 0 rule add match hash ipv4_5tuple + 1.10.11.12 2.20.21.22 100 200 6 action fwd port 0 + pipeline TX table 0 rule add match hash ipv4_5tuple + 1.10.11.13 2.20.21.23 100 200 6 action fwd port 1 + thread 25 pipeline RX enable + thread 25 pipeline TX enable + +* Run testpmd: + + .. code-block:: console + + ./x86_64-native-linuxapp-gcc/app/testpmd -l 23-25 -n 4 \ + --vdev 'net_softnic0, \ + firmware=./drivers/net/softnic/ \ + firmware.cli, \ + cpu_id=1,conn_port=8086' -- \ + -i --forward-mode=softnic --rxq=2, \ + --txq=2, --disable-rss --portmask=0x4 + +* Configure flow rules on softnic: + + .. code-block:: console + + flow create 2 group 0 ingress pattern eth / ipv4 proto mask 255 src \ + mask 255.255.255.255 dst mask 255.255.255.255 src spec + 1.10.11.12 dst spec 2.20.21.22 proto spec 6 / tcp src mask 65535 \ + dst mask 65535 src spec 100 dst spec 200 / end actions queue \ + index 0 / end + flow create 2 group 0 ingress pattern eth / ipv4 proto mask 255 src \ + mask 255.255.255.255 dst mask 255.255.255.255 src spec 1.10.11.13 \ + dst spec 2.20.21.23 proto spec 6 / tcp src mask 65535 dst mask \ + 65535 src spec 100 dst spec 200 / end actions queue index 1 / end