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 EF1F9A00C3; Fri, 15 May 2020 12:30:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 90F481DAEF; Fri, 15 May 2020 12:30:43 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D42BF1DADD for ; Fri, 15 May 2020 12:30:39 +0200 (CEST) IronPort-SDR: cP+pIH684wr7pgN89harJ0qayR0ryVOf1YTPWl9I4X5G6D4i9Qh7SKnirSebiYsT5UZbm5cSnU JPZUZ+ZeSbQw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2020 03:30:35 -0700 IronPort-SDR: ygWpZ9eo0mwbOUhWgTjWeosRN99SEz2Nd2SMHMbVwvvVvVA4DwMOTPnCGPd2TGBD1QqL1cI0UX 3kscDeW5BJCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,394,1583222400"; d="scan'208";a="341941532" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga001.jf.intel.com with ESMTP; 15 May 2020 03:30:34 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 15 May 2020 03:30:34 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 15 May 2020 03:30:34 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 15 May 2020 03:30:34 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.54) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 15 May 2020 03:30:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+ZwRp2Q09Zb6Aa7moDftlMVdMz0kshJkvm6FOhEh+DSZjGgKgyP6EPE9RvRygHeiOTjNUC+3CEQoXlzUFm24wcqM2z915DFVSRM1CUcayVcBZDyI5MxLQqKdyiF8f3c6E8prSPOCRw0lGYhEEhS0NROizACTcGUey0D82/GwY8ZT5nfj9ATUAvkozZLQTwiOAAco+NtLHHv3Zp3lzVCFZO7ibymo8crQ11c0zeUFx0adNZJyczc0tKYLhgONnVwHnnA0ZlCOHkwo3G/0ogNJ2jrEUmIxLEx6lGs9tsPROOBmHsO4vsdRelm1bM7eFmz5I4+WijhLMLMMC987fShuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SAmkMtDtE9MJKP1T858Xp+paWg1Ryt7rBbxRdvR3N0k=; b=ZXvrb2xEWkVNHDxsDKSTzlG0+ss0Ifmazm9X0YfBekJLm+qIZib8n8dgIE0Wqy2ed31HuvIzjo1Kg0CAElWCBuFIlG9RsbHb2vLEXnCQx/Vi+h2hqIar/nUCflF05fkIsWa6W2vhVEovITIlp+3sykyknvc8bLcEEcs98+QqVh4z/mnsDtARfA4rxVWimxCXxBzLHGaImqyHr32ORknqk9iDS3U0jFWoCGHcZXWJsTInyQTqli1amS8JiMoiWjwHw2KaoO43xUmSYwGpX4OvzNprnUrbgABfR2cVx10mcPl3zXvyAe5D8G0LXeUPYBpSbBFEm3rL2qh5+qOdIj9NyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SAmkMtDtE9MJKP1T858Xp+paWg1Ryt7rBbxRdvR3N0k=; b=xuoAVMMaGXrbQkulu2f1IUDfj/tiAWgrtVEO4tNJT7lTJja5wIeP4qnWkDL7Faf4Z7HuMdWHuWgiyKKfLC1idqM65fcMZcGOkHixak3udHIE2O7yDPPI0OhC51sz7Deymcfo1/A85KD9g+wLlltfU6iKCWgcGZ9/QZmyab29uwk= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB2917.namprd11.prod.outlook.com (2603:10b6:a03:89::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Fri, 15 May 2020 10:30:31 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4%6]) with mapi id 15.20.3000.016; Fri, 15 May 2020 10:30:31 +0000 From: "Ananyev, Konstantin" To: Nithin Dabilpuram , Olivier Matz CC: Jerin Jacob , Nithin Dabilpuram , Thomas Monjalon , "Yigit, Ferruh" , Andrew Rybchenko , Ori Kam , "Dumitrescu, Cristian" , "Burakov, Anatoly" , "Mcnamara, John" , "Kovacevic, Marko" , dpdk-dev , Jerin Jacob , Krzysztof Kanas Thread-Topic: [dpdk-dev] [EXT] Re: [PATCH 1/3] mbuf: add Tx offloads for packet marking Thread-Index: AQHWIe33/V2xjjpXt0OMZlTB1q3216iXpZQAgAANfYCAACfagIABK3IAgA8ShYCAAOTkgIAABD/g Date: Fri, 15 May 2020 10:30:30 +0000 Message-ID: References: <20200417072254.11455-1-nithind1988@gmail.com> <20200504080634.GB6327@platinum> <20200504082706.GA6153@outlook.office365.com> <20200504091640.GC6327@platinum> <20200504100457.GB6153@outlook.office365.com> <20200504122735.GD6327@platinum> <20200505061920.GA1705@outlook.office365.com> <20200514202931.GF1739@platinum> <20200515100845.GA19989@outlook.office365.com> In-Reply-To: <20200515100845.GA19989@outlook.office365.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.151.183] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e3529edd-bc5e-4107-25ca-08d7f8bafe60 x-ms-traffictypediagnostic: BYAPR11MB2917: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 04041A2886 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3rvi8w5pbxYKRRVAiHCNPdHJeq5PCnEEee6Jlip+MyjIssR8h0EdLgR58smld+EARgMLqaXsOfHIrHHiCmezGQx0kx8r8v8FAqml9IzVIip/RlT1S6Kzvbt3Sbn+snOgB9SmMWMgF45Jv+1LQxzRXfCrE40ahqXHS3nRKcoA1DP42mw2Pyr59b5ZloGL/2ddUC9R2/RI+R+WUGJN/CLJ9ekuFaEdOn+uqZSF0KqQDjOIe3EZxJactKtu1kmdb6mVrqn2UPRPSFFPJD6XGE35uvCh53w1MybSLyUfVW5Vh3/FU30C3PpECqQDbr8W6gghcehCwHnkOe1RXWPL6TmV3T0p51j/OUfwksAST2MEQAS2a8ZEcTlgI2R0OH53QDNBLwK9AAgtcfxbJuUGW6oYbqAheGxTyPQJukQHm3cd17r9fRHrfzkY2I62OdNSpcdiU0d+6S1USx2KTyqR7sWXL98/BvHyDxBDpMFiNsqkRAj4mos3hvzAH+f/ze/2tsLE3e5B+1azY6gP+C1iVOmOoQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(376002)(366004)(39860400002)(346002)(136003)(2906002)(7416002)(66556008)(33656002)(86362001)(66946007)(30864003)(53546011)(6506007)(5660300002)(52536014)(4326008)(7696005)(66476007)(64756008)(66446008)(76116006)(316002)(71200400001)(26005)(54906003)(478600001)(8936002)(966005)(8676002)(110136005)(186003)(9686003)(55016002)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: C4bt35SvwVkV9SJsjJ8O0rLF/dTl28hGuoOo010muyKfJHee+vmye4+7Ltwq3GmCk1Z7UOtz+I+kuZyeVgKSJCJZpj20iHTqaylDPQwakjWBgFGQUVQyifBGKaqB2GzTl3ocMOlOr84ca9F/pP2EgXvHVfA3S/5V7h1UlXnYjjuLBtyX3QfKUUPJFIPKDsLCBKjjsIHrKm3oI/nWdmp2+cBXD/Yo8t885keMy4i25288696AbMz4XMKKNL3mMPJyJSuY6+w2J/LqvakRC+/nnamiEpZ+7C8tccfBApWL3Gfg1dLj/F+IfVCWwCT5ml8955dFyqDZ149M+QlbzDK0xQ1CJfvLf3v8472GJDYwYH75QLh8ooH69M0q/KWnEGpdLnYi6dgCTYHNDBOLSnAR4n425YEjejCkZlfM0ywoEGcnJrNas3imYJTw/GeuY46+7bOKLe9Yh3HvTwSaMWOSlBPyh31mWHLVN04poE+/Q6fqaJz7NCGCxPKKOa8+aq9T Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e3529edd-bc5e-4107-25ca-08d7f8bafe60 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2020 10:30:30.9635 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RS63fnr8rQ6M7kNgWFkfvxB56PxB3sG1XEUwz4DY9/5jKFqWk0A+eWu7Up2Qx5JmrdYrW8h29egS2FlNfBA2d8tfyA/xGFlTZxVefuWMKyQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2917 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [EXT] Re: [PATCH 1/3] mbuf: add Tx offloads for packet marking 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" > On Thu, May 14, 2020 at 10:29:31PM +0200, Olivier Matz wrote: > > Hi Nithin, > > > > On Tue, May 05, 2020 at 11:49:20AM +0530, Nithin Dabilpuram wrote: > > > On Mon, May 04, 2020 at 02:27:35PM +0200, Olivier Matz wrote: > > > > On Mon, May 04, 2020 at 03:34:57PM +0530, Nithin Dabilpuram wrote: > > > > > On Mon, May 04, 2020 at 11:16:40AM +0200, Olivier Matz wrote: > > > > > > On Mon, May 04, 2020 at 01:57:06PM +0530, Nithin Dabilpuram wro= te: > > > > > > > Hi Olivier, > > > > > > > > > > > > > > On Mon, May 04, 2020 at 10:06:34AM +0200, Olivier Matz wrote: > > > > > > > > External Email > > > > > > > > > > > > > > > > -----------------------------------------------------------= ----------- > > > > > > > > Hi, > > > > > > > > > > > > > > > > On Fri, May 01, 2020 at 04:48:21PM +0530, Jerin Jacob wrote= : > > > > > > > > > On Fri, Apr 17, 2020 at 12:53 PM Nithin Dabilpuram > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > From: Nithin Dabilpuram > > > > > > > > > > > > > > > > > > > > Introduce PKT_TX_MARK_IP_DSCP, PKT_TX_MARK_IP_ECN > > > > > > > > > > and PKT_TX_MARK_VLAN_DEI Tx offload flags to support > > > > > > > > > > packet marking. > > > > > > > > > > > > > > > > > > > > When packet marking feature in Traffic manager is enabl= ed, > > > > > > > > > > application has to the use the three new flags to indic= ate > > > > > > > > > > to PMD on whether packet marking needs to be enabled on= the > > > > > > > > > > specific mbuf or not. By setting the three flags, it is > > > > > > > > > > assumed by PMD that application has already verified th= e > > > > > > > > > > applicability of marking on that specific packet and > > > > > > > > > > PMD need not perform further checks as per RFC. > > > > > > > > > > > > > > > > > > > > Signed-off-by: Krzysztof Kanas > > > > > > > > > > Signed-off-by: Nithin Dabilpuram > > > > > > > > > > > > > > > > > > None of the ethdev TM driver implementations has supporte= d packet > > > > > > > > > marking support. > > > > > > > > > rte_tm and rte_mbuf maintainers(Christian, Oliver), Could= you review this patch? > > > > > > > > > > > > > > > > As you know, the number of mbuf flags is limited (only 18 b= its are > > > > > > > > remaining), so I think we should use them with care, i.e. f= or features > > > > > > > > that are generic enough. > > > > > > > > > > > > > > I agree, but I believe this is one of the basic flags needed = like other > > > > > > > Tx checksum offload flags (like PKT_TX_IP_CKSUM, PKT_TX_IPV4,= etc) which > > > > > > > are needed to identify on which packets HW should/can apply p= acket marking. > > > > > > > > > > > > PKT_TX_IP_CKSUM tells the hardware to offload the checksum > > > > > > calculation. This is pretty straightforward and there is no oth= er > > > > > > dependency than the offload feature advertised by the PMD. > > > > > > > > > > > > I'm sorry, I have not a lot of experience with rte_tm.h, so it'= s > > > > > > difficult for me to have a global view of what is done for inst= ance when > > > > > > PKT_TX_MARK_VLAN_DEI is set, and what happens when it is not se= t. > > > > > > > > > > > > Can you confirm that my understanding below is correct? (or cor= rect me > > > > > > where I'm wrong) > > > > > > > > > > > > Before your patch: > > > > > > - the application enables the port and traffic manager on it > > > > > > - the application calls rte_tm_mark_vlan_dei() to select which = traffic > > > > > > class must be marked > > > > > > - when a packet is transmitted, the traffic class is determined= by the > > > > > > hardware, and if the hardware recognizes a VLAN packet, the V= LAN DEI > > > > > > bit is set depending on traffic class > > > > > > > > > > > > The problem is for packets that cannot be recognized by the har= dware, > > > > > > correct? > > > > > > > > > > Yes. Octeontx2 HW always depends on application knowledge instead= of walking > > > > > through all the layers of packet data in Tx to identify what pack= et it is > > > > > and where the l2, l3, l4 headers start for performance reasons. > > > > > > > > > > I believe there are other hardware too that have the same expecta= tion > > > > > and hence we have a need for PKT_TX_IPv4, PKT_TX_IPv6 kind of fla= gs. > > > > > > > > > > Hence we want to make use of mbuf:tx_offload field and PKT_TX_* f= lags > > > > > for identifying the packet and knowing what are its l2,l3,l4 offs= ets. > > > > > > > > The objective is to give an indication to the hardware that the pac= ket has: > > > > - an 802.1q header at offset X for PKT_TX_MARK_VLAN_DEI > > > > - an IP/IPv6 header at offset X for PKT_TX_MARK_IP_DSCP > > > > - an IP/IPv6 header at offset X and a TCP/SCTP header at offset Y f= or > > > > PKT_TX_MARK_IP_ECN > > > > > > > > Just to be sure I'm getting the point, would it also work if with f= lags > > > > like this: > > > > > > > > - an 802.1q header at offset X for PKT_TX_HAS_VLAN > > > > - an IP/IPv6 header at offset X for PKT_TX_IPv4 or PKT_TX_IPv6 > > > > - a TCP/SCTP header at offset Y for PKT_TX_TCP/PKT_TX_SCTP (implies > > > > PKT_TX_IPv4 or PKT_TX_IPv6) > > > > > > > > The underlying question is: do we need the flags to only describe t= he > > > > content of the packet or do the flag also indicate that an action h= as to > > > > be done? > > > > > > If we don't have a specific action based flag, then in future it migh= t collide > > > with other functionality and we will not be able to choose that speci= fic > > > offload. All the existing features are having specific flags, like TS= O, > > > CSUM. > > > > > > RFC wise, even when marking in enabled and packet is coloured, not al= l packets > > > can be marked. > > > For example when IP DSCP marking(RFC 2597) is enabled, marking is def= ined > > > only with below 12 code points out of 64 code points (6 bits of DSCP)= . > > > > > > Class 1 Class 2 Class 3 Class 4 > > > +----------+----------+----------+----------+ > > > Low Drop Prec | 001010 | 010010 | 011010 | 100010 | > > > Medium Drop Prec | 001100 | 010100 | 011100 | 100100 | > > > High Drop Prec | 001110 | 010110 | 011110 | 100110 | > > > +----------+----------+----------+----------+ > > > > > > All other combinations of DSCP value can be used for some other purpo= ses > > > and hence packets with those values shouldn't be marked. > > > Similar is the case with IP ECN marking for TCP/SCTP(RFC 3168). > > > > > > Having PMD or HW to check if the packet falls in the said class and t= hen do > > > marking will impact performance. Since application actually fills tho= se values > > > in packet, it will be more easy for them to say. > > > > > > > > > > > > > So your patch is a way to force the hardware to recognize mark = set the > > > > > > VLAN DEI on packets that are not recognized as VLAN packets? > > > > > > > > > > > > How the is traffic class of the packet determined? > > > > > > > > > > Packet is coloured based on Single Rate[1] or Dual Rate[2] Shapin= g result > > > > > and packet color determines traffic class. The exact behavior of > > > > > packet color to traffic class mapping is mentioned in TM spec bas= ed on > > > > > few other RFC's. > > > > > > > > > > [1] https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > 3A__tools.ietf.org_html_rfc2697&d=3DDwIBAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r= =3DFZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=3D > pJDciSXpMy6TawycjvpYj_Jq5M5j_ywqhU8-keRI_ac&s=3D05emGNkz3Qat3dtZIbEsmQDC5= y9-tU9yItHX0x1aaJU&e=3D > > > > > [2] https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > 3A__tools.ietf.org_html_rfc2698&d=3DDwIBAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r= =3DFZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=3D > pJDciSXpMy6TawycjvpYj_Jq5M5j_ywqhU8-keRI_ac&s=3D3VN2dIGSDt4vWM-FpPOOf-8Se= VShl_t7QpXRU6Zw460&e=3D > > > > > > > > OK, so the traffic class does not depend on the packet type? > > > Yes it doesn't. But where to update the traffic class is specific to = packet > > > type like DEI bit in VLAN or ECN field in IPv4/IPv6 or DSCP field in = IPv4/IPv6. > > > Also ECN marking is only valid for TCP/SCTP packets. > > > > > > > > > > > > > > > > > > > From what I understand, this feature is bound to octeontx2,= so using a > > > > > > > > mbuf dynamic flag would make more sense here. There are som= e examples in > > > > > > > > dpdk repository, just grep for "dynflag". > > > > > > > > > > > > > > This is not octeontx2 specific flag but any "packet marking f= eature" enabled > > > > > > > PMD would need these flags to identify on which packets marki= ng needs to be > > > > > > > done. This is the first PMD that supports packet marking feat= ure and > > > > > > > hence it was not exposed earlier. > > > > > > > > > > > > > > For example to mark VLAN DEI, PMD cannot always assume that t= here is preexisting > > > > > > > VLAN header from Byte 12 as there is no gaurantee that ethern= et header > > > > > > > always starts at Byte 0 (Custom headers before ethernet hdr). > > > > > > > > > > > > > > > > > > > > > > > Also, I think that the feature availability should be adver= tised through > > > > > > > > an ethdev offload, so an application can know at initializa= tion time > > > > > > > > that these flags can be used. > > > > > > > > > > > > > > Feature availablity is already part of TM spec in rte_tm.h > > > > > > > struct rte_tm_capabilities:mark_vlan_dei_supported > > > > > > > struct rte_tm_capabilities:mark_ip_ecn_[sctp|tcp]_supported > > > > > > > struct rte_tm_capabilities:mark_ip_dscp_supported > > > > > > > > > > > > Does this mean that any driver advertising this existing featur= e flag > > > > > > has to support the new mbuf flags too? Shouldn't we have a spec= ific > > > > > > feature for it? > > > > > > > > > > Yes, I thought PMD's need to support both. > > > > > I'm fine adding specific feature flag for the offload flags alone > > > > > if you insist or if there are other PMD's which don't need the of= fload flags > > > > > for packet marking. I was not able to find out about other PMD's = as > > > > > none of the existing PMD's support packet marking. > > > > > > > > Do you suggest that the behavior of the traffic manager marking sho= uld > > > > be: > > > > > > > > a- the hardware tries to recognize tx packets, and mark them > > > > accordingly. What packets are recognized depend on hardware. > > > > b- if the mbuf has a specific flag, it helps the PMD and hardware t= o > > > > recognize packets, so it can mark packets. > > > > > > > > For an application, a- is difficult to apprehend as it will be depe= ndent > > > > on hardware. > > > > > > > > Or do you suggest that packets should only be marked if there is a = mbuf > > > > flag? (only b-) > > > Yes, I believe b- is the right thing. > > > > > > > > > > > Do you confirm that there is no support at all for this feature tod= ay? > > > > I mean, what was the usage of rte_tm_mark_vlan_dei() these last 3 y= ears? > > > > > > Yes, it was not implemented/used. Because of such reasons, rte_tm.h i= s > > > supposed to be experimental but was mistakenly marked stable. > > > You can see related discussion in below threads about marking rte_tm.= h > > > experimental again in v20.11. > > > https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__mails.dpdk.org= _archives_dev_2020- > 2DApril_164970.html&d=3DDwIBAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DFZ_tPCbgFOh= 18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=3DmyqGwnIHN > jN9IP7urxcVAB384qKoxlmm00p1gS7ttbw&s=3D-o2E-F9aHy3mrQw6xgO__RPXY9t8s3yjJn= 81X6Ius3k&e=3D > > > https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__mails.dpdk.org= _archives_dev_2020- > 2DMay_166221.html&d=3DDwIBAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DFZ_tPCbgFOh18= zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=3DmyqGwnIHNj > N9IP7urxcVAB384qKoxlmm00p1gS7ttbw&s=3DgTKSzMmlhE75x4TP8IJB7NP5MVO-zxjmNRQ= 9bZ6MxwI&e=3D > > > > Thank you for the explanations. I also think b- is a better choice. > > > > I don't see any better approach than having a mbuf flag. However, I'm > > still not fully convinced that a dynamic flag won't do the job. Taking > > 3 additional flags (among 18 remaing) for this feature also means that > > we have 3 flags less for dynamic flags for all applications, even for > > applications that will not use this feature. I also share Olivier's concern about consuming 3 bits in ol_flags for that = feature. Can it probably be squeezed somehow? Let say we reserve one flag that this information is present or not, and re-use one of rx-only fields for store additional information (packet_type,= or so). Or might be some other approach. =20 > > > > Would it be a problem to use a dynamic flag in this case? > Since packet marking feature itself is already part of spec, > if we move the flags to PMD specific dynamic flag, then it creates a conf= usion. >=20 > It is not the case of a custom feature supported by a specific PMD. > I believe when other PMD's implement packet marking, the same flags will > suffice. > > > > Thanks, > > Olivier > > > > > > > > > > Thanks > > > Nithin > > > > > > > > > > > Thanks, > > > > Olivier > > > > > > > > > > > > > > > > > > > > > > > > > Please also see few comments below. > > > > > > > > > > > > > > > > --- > > > > > > > > > > doc/guides/nics/features.rst | 14 ++++++++++++++ > > > > > > > > > > lib/librte_mbuf/rte_mbuf.c | 6 ++++++ > > > > > > > > > > lib/librte_mbuf/rte_mbuf_core.h | 36 +++++++++++++++++= +++++++++++++++++-- > > > > > > > > > > 3 files changed, 54 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > > > > > diff --git a/doc/guides/nics/features.rst b/doc/guides/= nics/features.rst > > > > > > > > > > index edd21c4..bc978fb 100644 > > > > > > > > > > --- a/doc/guides/nics/features.rst > > > > > > > > > > +++ b/doc/guides/nics/features.rst > > > > > > > > > > @@ -913,6 +913,20 @@ Supports to get Rx/Tx packet burst= mode information. > > > > > > > > > > * **[implements] eth_dev_ops**: ``rx_burst_mode_get``,= ``tx_burst_mode_get``. > > > > > > > > > > * **[related] API**: ``rte_eth_rx_burst_mode_get()``, = ``rte_eth_tx_burst_mode_get()``. > > > > > > > > > > > > > > > > > > > > +.. _nic_features_traffic_manager_packet_marking_offloa= d: > > > > > > > > > > + > > > > > > > > > > +Traffic Manager Packet marking offload > > > > > > > > > > +-------------------------------------- > > > > > > > > > > + > > > > > > > > > > +Supports enabling a packet marking offload specific mb= uf. > > > > > > > > > > + > > > > > > > > > > +* **[uses] mbuf**: ``mbuf.ol_flags:PKT_TX_MARK_IP_= DSCP``, > > > > > > > > > > + ``mbuf.ol_flags:PKT_TX_MARK_IP_ECN``, ``mbuf.ol_flag= s:PKT_TX_MARK_VLAN_DEI``, > > > > > > > > > > + ``mbuf.ol_flags:PKT_TX_IPV4``, ``mbuf.ol_flags:PKT_T= X_IPV6``. > > > > > > > > > > +* **[uses] mbuf**: ``mbuf.l2_len``. > > > > > > > > > > +* **[related] API**: ``rte_tm_mark_ip_dscp()``, ``rte_= tm_mark_ip_ecn()``, > > > > > > > > > > + ``rte_tm_mark_vlan_dei()``. > > > > > > > > > > + > > > > > > > > > > .. _nic_features_other: > > > > > > > > > > > > > > > > > > > > Other dev ops not represented by a Feature > > > > > > > > > > diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mb= uf/rte_mbuf.c > > > > > > > > > > index cd5794d..5c6896d 100644 > > > > > > > > > > --- a/lib/librte_mbuf/rte_mbuf.c > > > > > > > > > > +++ b/lib/librte_mbuf/rte_mbuf.c > > > > > > > > > > @@ -880,6 +880,9 @@ const char *rte_get_tx_ol_flag_name= (uint64_t mask) > > > > > > > > > > case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFF= LOAD"; > > > > > > > > > > case PKT_TX_UDP_SEG: return "PKT_TX_UDP_SEG"; > > > > > > > > > > case PKT_TX_OUTER_UDP_CKSUM: return "PKT_TX_OUT= ER_UDP_CKSUM"; > > > > > > > > > > + case PKT_TX_MARK_VLAN_DEI: return "PKT_TX_MARK_= VLAN_DEI"; > > > > > > > > > > + case PKT_TX_MARK_IP_DSCP: return "PKT_TX_MARK_I= P_DSCP"; > > > > > > > > > > + case PKT_TX_MARK_IP_ECN: return "PKT_TX_MARK_IP= _ECN"; > > > > > > > > > > default: return NULL; > > > > > > > > > > } > > > > > > > > > > } > > > > > > > > > > @@ -916,6 +919,9 @@ rte_get_tx_ol_flag_list(uint64_t ma= sk, char *buf, size_t buflen) > > > > > > > > > > { PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOA= D, NULL }, > > > > > > > > > > { PKT_TX_UDP_SEG, PKT_TX_UDP_SEG, NULL = }, > > > > > > > > > > { PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_= UDP_CKSUM, NULL }, > > > > > > > > > > + { PKT_TX_MARK_VLAN_DEI, PKT_TX_MARK_VLA= N_DEI, NULL }, > > > > > > > > > > + { PKT_TX_MARK_IP_DSCP, PKT_TX_MARK_IP_D= SCP, NULL }, > > > > > > > > > > + { PKT_TX_MARK_IP_ECN, PKT_TX_MARK_IP_EC= N, NULL }, > > > > > > > > > > }; > > > > > > > > > > const char *name; > > > > > > > > > > unsigned int i; > > > > > > > > > > diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/libr= te_mbuf/rte_mbuf_core.h > > > > > > > > > > index b9a59c8..d9f1290 100644 > > > > > > > > > > --- a/lib/librte_mbuf/rte_mbuf_core.h > > > > > > > > > > +++ b/lib/librte_mbuf/rte_mbuf_core.h > > > > > > > > > > @@ -187,11 +187,40 @@ extern "C" { > > > > > > > > > > /* add new RX flags here, don't forget to update PKT_F= IRST_FREE */ > > > > > > > > > > > > > > > > > > > > #define PKT_FIRST_FREE (1ULL << 23) > > > > > > > > > > -#define PKT_LAST_FREE (1ULL << 40) > > > > > > > > > > +#define PKT_LAST_FREE (1ULL << 37) > > > > > > > > > > > > > > > > > > > > /* add new TX flags here, don't forget to update PKT_L= AST_FREE */ > > > > > > > > > > > > > > > > > > > > /** > > > > > > > > > > + * Packet marking offload flags. These flags indicated= what kind > > > > > > > > > > + * of packet marking needs to be applied on a given mb= uf when > > > > > > > > > > + * appropriate Traffic Manager configuration is in pla= ce. > > > > > > > > > > + * When user set's these flags on a mbuf, below assump= tions are made > > > > > > > > > > + * 1) When PKT_TX_MARK_VLAN_DEI is set, > > > > > > > > > > + * a) PMD assumes pkt to be a 802.1q packet. > > > > > > > > > > > > What does that imply? > > > > > > > > > > I meant by setting the flag, a packet has VLAN header adhering to= IEEE 802.1Q spec. > > > > > > > > > > > > > > > > > > > > > + * b) Application should also set mbuf.l2_len where 80= 2.1Q header is > > > > > > > > > > + * at (mbuf.l2_len - 6) offset. > > > > > > > > > > > > Why mbuf.l2_len - 6 ? > > > > > L2 header when VLAN header is preset will be > > > > > {custom header 'X' Bytes}:{Ethernet SRC+DST (12B)}:{VLAN Header (= 4B)}:{Ether Type (2B)} > > > > > l2_len =3D X + 12 + 4 + 2 > > > > > So, VLAN header starts at (l2_len - 6) bytes. > > > > > > > > > > > > > > > > > > > > > + * 2) When PKT_TX_MARK_IP_DSCP is set, > > > > > > > > > > + * a) Application should also set either PKT_TX_IPV4 o= r PKT_TX_IPV6 > > > > > > > > > > + * to indicate whether if it is IPv4 packet or IPv6= packet > > > > > > > > > > + * for DSCP marking. It should also set PKT_TX_IP_C= KSUM if it is > > > > > > > > > > + * IPv4 pkt. > > > > > > > > > > + * b) Application should also set mbuf.l2_len that ind= icates > > > > > > > > > > + * start offset of L3 header. > > > > > > > > > > + * 3) When PKT_TX_MARK_IP_ECN is set, > > > > > > > > > > + * a) Application should also set either PKT_TX_IPV4 o= r PKT_TX_IPV6. > > > > > > > > > > + * It should also set PKT_TX_IP_CKSUM if it is IPv4= pkt. > > > > > > > > > > + * b) PMD will assume pkt L4 protocol is either TCP or= SCTP and > > > > > > > > > > + * ECN is set to 2'b01 or 2'b10 as per RFC 3168 and= hence HW > > > > > > > > > > + * can mark the packet for a configured color. > > > > > > > > > > + * c) Application should also set mbuf.l2_len that ind= icates > > > > > > > > > > + * start offset of L3 header. > > > > > > > > > > + */ > > > > > > > > > > +#define PKT_TX_MARK_VLAN_DEI (1ULL << 38) > > > > > > > > > > +#define PKT_TX_MARK_IP_DSCP (1ULL << 39) > > > > > > > > > > +#define PKT_TX_MARK_IP_ECN (1ULL << 40) > > > > > > > > > > > > We should have one comment per define. > > > > > Ack, will fix in V2. > > > > > > > > > > > > > > > > > > > > > > > > > > > + > > > > > > > > > > +/** > > > > > > > > > > * Outer UDP checksum offload flag. This flag is used = for enabling > > > > > > > > > > * outer UDP checksum in PMD. To use outer UDP checksu= m, the user needs to > > > > > > > > > > * 1) Enable the following in mbuf, > > > > > > > > > > @@ -384,7 +413,10 @@ extern "C" { > > > > > > > > > > PKT_TX_MACSEC | \ > > > > > > > > > > PKT_TX_SEC_OFFLOAD | \ > > > > > > > > > > PKT_TX_UDP_SEG | \ > > > > > > > > > > - PKT_TX_OUTER_UDP_CKSUM) > > > > > > > > > > + PKT_TX_OUTER_UDP_CKSUM | \ > > > > > > > > > > + PKT_TX_MARK_VLAN_DEI | \ > > > > > > > > > > + PKT_TX_MARK_IP_DSCP | \ > > > > > > > > > > + PKT_TX_MARK_IP_ECN) > > > > > > > > > > > > > > > > > > > > /** > > > > > > > > > > * Mbuf having an external buffer attached. shinfo in = mbuf must be filled. > > > > > > > > > > -- > > > > > > > > > > 2.8.4 > > > > > > > > > >