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 87DA5A04AF; Mon, 4 May 2020 10:27:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 200FE1D407; Mon, 4 May 2020 10:27:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 020721D404 for ; Mon, 4 May 2020 10:27:30 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0448Qk36029287; Mon, 4 May 2020 01:27:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pfpt0818; bh=fpFt++BZFf/1DEPPPLHLR3H8Fe17QfDYgu2ghtlpvkI=; b=NFnObUhrbbFZ1ATuSvT5XGBW9kY3lunZEyhxUH84UhEaoKV2RJOaE4MOfdfr+ZxnDm8j lQEy3LgrIMO5q0K0uID5fFvxXAFBKcU9OZeva/fYmN53b+oer6MIHAx9/Hm57LXBIplM xZnAuo18aN43vid1g3N76EOnGkTwTYtm6+DQtdue7gSfKpLBe+et5IrhbodPjusgv8oX Q8oBWvoHLvZdeQzjEXKpubStaBOJRGPxtLI0+0A4s900J0ZPu6yaiUs+UjGVHAmXLEm2 NhS9UhdgxBpbbsL8KefJMBTON7bvFEkNVmlfKGvjTBav2NTyUYj+2M2bJXNN8xbslLHr UQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 30srykk00b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 04 May 2020 01:27: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, 4 May 2020 01:27:27 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 4 May 2020 01:27:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HiWZioDxuHlMCl4sdqqF+TcvUwEP/t7nzZ9VgqfRXIQ7WQWkwmUfWQ5GdLDoZdnFm9mtYFeo4Ad+9kYssyaAQ/SGlPNVTTL1R91lOXQB6AcxQsLCvxvqPd1S0pPKlOKVYK8fF0HQiZcE6GqFXBC/IeBnI+3tDYYBGpQQrxHEWS9ltO0hVXdpcq47cirCBhLserHGZp8GLCx5kFwUgFQRwXl+2ZS3WWf73W0fHGCdEpkvFUlWa/xWwvGHGhcBd6ecJ4zGmC5Cly1MUA5T8l8j6SERhrNqdzpBJaG3iPylVkUraAEZo2lia3fmPob8o4mBunv8mL+QqOSWJjp0udo+Vw== 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=fpFt++BZFf/1DEPPPLHLR3H8Fe17QfDYgu2ghtlpvkI=; b=NKvMBN7X+3pa/RiJCaurDOGKZAkaB3DDySusAIJibkxqu2GGLBWtDUH2o7eapIJFvdK+zeCm6kVoramzMcLN+KOg9EzDEBmpDJVH5FPw3n1W994KVw2exDgvCqyQXrfkA4ozV2frjd3x9CJ2GjKp7TfPZ7zROY8iyAmEuvsjxKouz+ia1QydBWid5KLKqU/MeUYW5cRQ3LZE/Wkj6DILD5+qjV54VcOowVVwhRIJdFSYscJ7TixKVRrWm2vW0jV4+a1DrpDVM/LaFpaUqTRgzuY3ZI5KqGDAACSpK9zdN1elUIfK3qwL544qyUFVCAqn+1sURXcfhXKeQsUQo+htGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fpFt++BZFf/1DEPPPLHLR3H8Fe17QfDYgu2ghtlpvkI=; b=du621/HfnavwOqwDm0TEINw9Hl4RfmT+387e7mp294zOnUw1+VRbeEgJARmNrTdcuSQJa1VMHRo8eOFEUtN+XV8DjBZIpROQ+W05eucKE/t+tWy/5RgXijWZnZJP5o1rSoTuat9NWV7Sm1w9AHQIj7vfAUCt2IK4fh4BCVtfnIc= Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=marvell.com; Received: from BYAPR18MB2917.namprd18.prod.outlook.com (2603:10b6:a03:105::19) by BYAPR18MB2485.namprd18.prod.outlook.com (2603:10b6:a03:132::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Mon, 4 May 2020 08:27:25 +0000 Received: from BYAPR18MB2917.namprd18.prod.outlook.com ([fe80::a1ec:e959:77df:cd58]) by BYAPR18MB2917.namprd18.prod.outlook.com ([fe80::a1ec:e959:77df:cd58%5]) with mapi id 15.20.2958.030; Mon, 4 May 2020 08:27:24 +0000 Date: Mon, 4 May 2020 13:57:06 +0530 From: Nithin Dabilpuram To: Olivier Matz CC: Jerin Jacob , Nithin Dabilpuram , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Ori Kam , Cristian Dumitrescu , Anatoly Burakov , John McNamara , Marko Kovacevic , dpdk-dev , Jerin Jacob , Krzysztof Kanas Message-ID: <20200504082706.GA6153@outlook.office365.com> References: <20200417072254.11455-1-nithind1988@gmail.com> <20200504080634.GB6327@platinum> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200504080634.GB6327@platinum> User-Agent: Mutt/1.12.2 (34cd43c) (2019-09-21) X-ClientProxiedBy: BMXPR01CA0062.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::26) To BYAPR18MB2917.namprd18.prod.outlook.com (2603:10b6:a03:105::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from outlook.office365.com (115.113.156.2) by BMXPR01CA0062.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Mon, 4 May 2020 08:27:20 +0000 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79e9a84d-c778-4205-eea2-08d7f004f90b X-MS-TrafficTypeDiagnostic: BYAPR18MB2485: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v2sjvJqSuR1lz71jHt9PZ2+JxMQBniKJ5Cc70Ppp0bGbDMLj9s2XfgUmzV709cLnjLBhno6zvEEQDNex8/7FCMblnKMNmLlifK9BTb7trVd0tA1gFy8opWS1/zvJKL6HTjs3ttk+FZ4JVb98L1fys7z7utEahIdAPt303ABb9+AOYRuzf62sGRng2HBkufnemGdGyOuYNvz3jQTpJjQVaaJ4WRlZRM+ezmQ9mZdRpYkmcOkXuYaQSvrYJ8k355YsTXjS7Zy0GLLeATXBc4FISynLrW5/HZNntLC/7KLmPEdsNVe1A0RNKF0dC8aaZC3g+26s8DxbVpcVrzOspAQovvRbiFgdJEUiYbU5Ycl53969w+cKJHCWBn8Cg2OBwAvtivTm5WM7nL7hudVAmlu3e+AdNvrhlszzLbleM8KFkE8jaFM/j7zAVxWAb9XOtTOk X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2917.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39850400004)(366004)(136003)(396003)(346002)(376002)(7696005)(478600001)(52116002)(2906002)(6916009)(66556008)(66476007)(7416002)(66946007)(33656002)(6666004)(1076003)(316002)(5660300002)(54906003)(107886003)(8936002)(9686003)(55016002)(8676002)(4326008)(86362001)(956004)(26005)(53546011)(55236004)(16526019)(186003)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: QI+fQhOA4vg/zmzQosvKSCqcsWKW5Uq+gGdRksxKHekg7cM3ct/dDilY4YTnTo/g+Pj3nd/IikzspNTXsZw4o1r01asaUdCqXA7DuEhf5ZrqKgtulXvQt04NRAaW/o5PW1oWKsHW8uG8UMolRm8n7agBquYCSgy/BLDLvLUFqu9Y0hy6gbnkbGRTCvFUfhsCFdk26sjLqSusXpifmhuDI7Zd56PBKIKpkcmWaDGytCTM5udKDXP2YWD5PCRVG0mmZdVLJn7aJThMnqxuP1kjr6F5VigOZkfNmCgNhujwjiwDyyioxjVwaaPEx2+RE2wZwamI8RU1BNQ1Nkru/KUzddmvAYEpaiI5ZbR/zsr/2fNCpG1hftiBK+V88M4UB9qwTl4PQT9tvPuxxTwnEVBlDsksoq/Gcgg4pRy1f5SJEewevUKjevP3qmp6raV43iT5FHA3kdltJ6C2hiRSCbg/IhMwIg+1pfg2hi+K2QnKMO+n4qqyFRd01hCiStlVcq+tKFldyHxaRDmuslqWnLRcyUZVT6v1dEYuA/nwDhfvQcynaZnJeU1XZu5Migx6nQaOqw8XhyAk9D8t+qcbsBJ/uOsjKWAd/KPycpzW1PgiNq6qCpt9c2LzdJIZycX+KB3o/Lc32oq+wHG1fTz/IGJdrz4D+XULky66M21YBuGdZICqPkWYuJ5k28YlDIF7aAPdx2vJtX06zne57YgtphWRpF9U/kdXL2je4/SYZiLrjyCk/pD6ovhUp3ly0ZMrJLEfvNQWkGyXqaOSgQ4tDZtYVm9Cm9BMO0xnJY1hZkq1sxA= X-MS-Exchange-CrossTenant-Network-Message-Id: 79e9a84d-c778-4205-eea2-08d7f004f90b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 08:27:24.6887 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mWhi96NL3PQXmtcD84aKA4ZFnJF9+PJ6GMpSqbgA6vpQv4Jl6zMGaDBKRiOdCypteDXwz9AsrVV52XJaH0azBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2485 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-04_04:2020-05-01, 2020-05-04 signatures=0 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" 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 enabled, > > > application has to the use the three new flags to indicate > > > 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 the > > > 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 supported 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 bits are > remaining), so I think we should use them with care, i.e. for 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 packet marking. > > From what I understand, this feature is bound to octeontx2, so using a > mbuf dynamic flag would make more sense here. There are some examples in > dpdk repository, just grep for "dynflag". This is not octeontx2 specific flag but any "packet marking feature" enabled PMD would need these flags to identify on which packets marking needs to be done. This is the first PMD that supports packet marking feature and hence it was not exposed earlier. For example to mark VLAN DEI, PMD cannot always assume that there is preexisting VLAN header from Byte 12 as there is no gaurantee that ethernet header always starts at Byte 0 (Custom headers before ethernet hdr). > > Also, I think that the feature availability should be advertised through > an ethdev offload, so an application can know at initialization 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 Thanks Nithin > > Regards, > Olivier > > > > > > > > > > --- > > > 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_offload: > > > + > > > +Traffic Manager Packet marking offload > > > +-------------------------------------- > > > + > > > +Supports enabling a packet marking offload specific mbuf. > > > + > > > +* **[uses] mbuf**: ``mbuf.ol_flags:PKT_TX_MARK_IP_DSCP``, > > > + ``mbuf.ol_flags:PKT_TX_MARK_IP_ECN``, ``mbuf.ol_flags:PKT_TX_MARK_VLAN_DEI``, > > > + ``mbuf.ol_flags:PKT_TX_IPV4``, ``mbuf.ol_flags:PKT_TX_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_mbuf/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_OFFLOAD"; > > > case PKT_TX_UDP_SEG: return "PKT_TX_UDP_SEG"; > > > case PKT_TX_OUTER_UDP_CKSUM: return "PKT_TX_OUTER_UDP_CKSUM"; > > > + case PKT_TX_MARK_VLAN_DEI: return "PKT_TX_MARK_VLAN_DEI"; > > > + case PKT_TX_MARK_IP_DSCP: return "PKT_TX_MARK_IP_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 mask, char *buf, size_t buflen) > > > { PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, 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_VLAN_DEI, NULL }, > > > + { PKT_TX_MARK_IP_DSCP, PKT_TX_MARK_IP_DSCP, NULL }, > > > + { PKT_TX_MARK_IP_ECN, PKT_TX_MARK_IP_ECN, NULL }, > > > }; > > > const char *name; > > > unsigned int i; > > > diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_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_FIRST_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_LAST_FREE */ > > > > > > /** > > > + * Packet marking offload flags. These flags indicated what kind > > > + * of packet marking needs to be applied on a given mbuf when > > > + * appropriate Traffic Manager configuration is in place. > > > + * When user set's these flags on a mbuf, below assumptions are made > > > + * 1) When PKT_TX_MARK_VLAN_DEI is set, > > > + * a) PMD assumes pkt to be a 802.1q packet. > > > + * b) Application should also set mbuf.l2_len where 802.1Q header is > > > + * at (mbuf.l2_len - 6) offset. > > > + * 2) When PKT_TX_MARK_IP_DSCP is set, > > > + * a) Application should also set either PKT_TX_IPV4 or PKT_TX_IPV6 > > > + * to indicate whether if it is IPv4 packet or IPv6 packet > > > + * for DSCP marking. It should also set PKT_TX_IP_CKSUM if it is > > > + * IPv4 pkt. > > > + * b) Application should also set mbuf.l2_len that indicates > > > + * start offset of L3 header. > > > + * 3) When PKT_TX_MARK_IP_ECN is set, > > > + * a) Application should also set either PKT_TX_IPV4 or 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 indicates > > > + * 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) > > > + > > > +/** > > > * Outer UDP checksum offload flag. This flag is used for enabling > > > * outer UDP checksum in PMD. To use outer UDP checksum, 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 > > >