From patchwork Mon May 16 07:51:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 67824 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1404650qge; Mon, 16 May 2016 00:52:04 -0700 (PDT) X-Received: by 10.55.76.15 with SMTP id z15mr27879984qka.32.1463385124659; Mon, 16 May 2016 00:52:04 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d88si21854659qgf.38.2016.05.16.00.52.04; Mon, 16 May 2016 00:52:04 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 120586172A; Mon, 16 May 2016 07:52:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D671A61709; Mon, 16 May 2016 07:51:57 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 882246170A; Mon, 16 May 2016 07:51:55 +0000 (UTC) Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by lists.linaro.org (Postfix) with ESMTPS id 66B73616F4 for ; Mon, 16 May 2016 07:51:54 +0000 (UTC) Received: by mail-pf0-f175.google.com with SMTP id y69so64486696pfb.1 for ; Mon, 16 May 2016 00:51:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IcIwBEMYUQocoFCJxohW+hx9Iq4ZGvozoLGs+3X+FHY=; b=DWqGOp7bqiwA/DyRMvS/0KXPj2QOBjSLNeJpi8/pBtdj7tP2B5bpU5vgwIwlrgUoZa eLJXB0svFoRVKxmDqCRxSGDqJaHmEbO6kG+Vu+k4BXpgJ5xYbHKGtbKFSca3GwLAAuau 9CEdJ5NcdeCMq/kf9ZIvVvPtMf+mBsfvsLC8bb+sMQiTR7KQogk10iqCedjV09TBqeiX ABVZUWpBIcnpg1n5YnaUfJAIWjxvxAc4oF1ZhLJUWVidsAihEY3l5/ieb6tFAqNFgji3 91fDq36BwVpeuf7u3eNGRD21gLkl+1SWvkdMVkJBocEaWsIi/xIHP0teQznAoHhTsY0G edjg== X-Gm-Message-State: AOPr4FVwAZwDeREJB2PfkJvPOIUH45UVcPvVjBaJm0jc8uuiER+tof5uLogjXb0aw14FmBmaup0= X-Received: by 10.98.53.65 with SMTP id c62mr43307047pfa.47.1463385113682; Mon, 16 May 2016 00:51:53 -0700 (PDT) Received: from bala-Vostro-2520.domain.name ([61.3.212.133]) by smtp.gmail.com with ESMTPSA id f67sm45123378pff.62.2016.05.16.00.51.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 May 2016 00:51:52 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 16 May 2016 13:21:40 +0530 Message-Id: <1463385100-11369-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCHv2] doc: users-guide: add packet marking documentation X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Updates packet marking api documentation to traffic manager user guide Signed-off-by: Balasubramanian Manoharan --- v2: document format update doc/users-guide/users-guide-tm.adoc | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/doc/users-guide/users-guide-tm.adoc b/doc/users-guide/users-guide-tm.adoc index 12685b2..e02697b 100644 --- a/doc/users-guide/users-guide-tm.adoc +++ b/doc/users-guide/users-guide-tm.adoc @@ -263,6 +263,79 @@ settings for any TM system, though in most cases a TM system can (and should) be created/instantiated with smaller values, since lower values will often result in faster operation and/or less memory used. +==== Packet Marking + +The Packet Marking API is used to mark the packet based upon the final packet +color assigned to it when it reaches the egress node. +This is an optional feature and if available on the platform is used to reflect +the packet color on IPv4/IPv6 DiffServ filed in accordance with https://www.ietf.org/rfc/rfc2474.txt[RFC 2474]. +There are three different packet marking fields supported they are, +1). Assured forwarding in accordance with https://www.ietf.org/rfc/rfc2597.txt[RFC 2597], the DSCP is marked to +set the packet Drop precedence in accordance with the color, i.e High Drop +precedence for RED, Medium Drop precedence for YELLOW and leave the DSCP +unchanged if the color is GREEN. +2). Explicit Congestion Notification protocol per https://www.ietf.org/rfc/rfc3168.txt[RFC 3168], where a router +encountering congestion can notify it by setting the lower 2 bits in +DiffServ field to "11" Congestion Encountered code, which will ultimately +reduce the transmission rate of the packet sender. +3). In IEEE 802.1q VLAN tag header contains a DE - Drop Eligibility bit for +marking a packet for Downstream switches, and is valid for Ethernet packet +containing a VLAN tag. + +RFC 3168 is only valid for TCP packets whereas RFC 2597 is valid for IPv4/IPv6 +traffic. + +The values are set per color and hence the implementation may support these +parameters only for a specific colors. marking_colors_supported field in +capabilities structure can be used to check which colors are supported for +marking. + +==== Vlan Marking. + +This vlan marking is used to enable the drop eligibility on the packet +based on the packet color. If drop eligibility is enabled then the +implementation will set the one bit VLAN Drop Eligibility Indicator (DEI) +field (but only for packets that already carry a VLAN tag) of a packet based +upon the final packet color assigned to the packet when it reaches the egress +node. When drop_eligible_enabled is false, then the given color has +no effect on the VLAN fields. See IEEE 802.1q for more details. +`vlan_marking_supported` boolean in capability structure indicates whether this +feature is supported by the implementation. + +==== Explicit Congestion Notification Marking. + +The `odp_tm_ecn_marking()` function allows one to configure the TM +egress so that the two bit ECN subfield of the eight bit TOS field of an +IPv4 packet OR the eight bit Traffic Class (TC) field of an IPv6 packet can be +selectively modified based upon the final color assigned to the packet when it +reaches the egress. Note that the IPv4 header checksum will be updated - +but only if the IPv4 TOS field actually changes as a result of this +setting or the `odp_tm_drop_prec_marking()` setting. For IPv6, since there is +no header checksum, nothing needs to be done. If ECN is enabled for a +particular color then ECN subfield will be set to _ECN_CE_ _i.e.,_ congestion +experienced. +`ecn_marking_supported` boolean in capability structure indicates whether this +feature is supported by the implementation. + +==== Drop Precedence Marking. + +The Drop precedence marking allows one to configure the TM +egress to support Assured forwarding in accordance with https://www.ietf.org/rfc/rfc2597.txt[RFC 2597]. +The Drop Precedence bits are contained within the six bit Differentiated +Services Code Point subfield of the IPv4 TOS field or the IPv6 Traffic +Class (TC) field. Specifically the Drop Precedence sub-subfield can be +accessed with a DSCP bit mask of 0x06. When enabled for a given color, +these two bits will be set to Medium Drop Precedence (value 0x4) if the +color is ODP_PACKET_YELLOW, set to High Drop Precedence (value 0x6) if +the color is ODP_PACKET_RED. + +Note that the IPv4 header checksum will be updated - but only if the +IPv4 TOS field actually changes as a result of this setting or the +`odp_tm_ecn_marking()` setting. For IPv6, since there is no header checksum, +nothing else needs to be done. +`drop_prec_marking_supported` boolean in capability structure indicates whether +this feature is supported by the implementation. + === Examples .Create a tm_node chain for two nodes and associate the scheduler