From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0065.outbound.protection.outlook.com [104.47.37.65]) by dpdk.org (Postfix) with ESMTP id B79EE1B224 for ; Thu, 12 Oct 2017 12:48:56 +0200 (CEST) Received: from MWHPR03CA0022.namprd03.prod.outlook.com (10.175.133.160) by BN6PR03MB2691.namprd03.prod.outlook.com (10.173.144.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 10:48:55 +0000 Received: from BY2FFO11FD016.protection.gbl (2a01:111:f400:7c0c::143) by MWHPR03CA0022.outlook.office365.com (2603:10b6:300:117::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 12 Oct 2017 10:48:55 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD016.mail.protection.outlook.com (10.1.14.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 12 Oct 2017 10:48:54 +0000 Received: from [10.232.133.65] (B10814-12.ap.freescale.net [10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v9CAmopA015214; Thu, 12 Oct 2017 03:48:50 -0700 To: Cristian Dumitrescu , References: <1507208974-180500-2-git-send-email-cristian.dumitrescu@intel.com> <1507301136-131382-1-git-send-email-cristian.dumitrescu@intel.com> <1507301136-131382-4-git-send-email-cristian.dumitrescu@intel.com> CC: , , , , From: Hemant Agrawal Message-ID: Date: Thu, 12 Oct 2017 16:18:49 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1507301136-131382-4-git-send-email-cristian.dumitrescu@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131522789345355153; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(376002)(346002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(377454003)(199003)(24454002)(189002)(104016004)(105606002)(53936002)(106466001)(65826007)(5660300001)(31686004)(2950100002)(305945005)(356003)(83506001)(97736004)(33646002)(85426001)(23676002)(54906003)(110136005)(53546010)(6246003)(58126008)(316002)(36756003)(2906002)(498600001)(189998001)(77096006)(50466002)(50986999)(8936002)(229853002)(65806001)(47776003)(76176999)(68736007)(54356999)(81156014)(86362001)(81166006)(65956001)(4326008)(8676002)(575784001)(230700001)(31696002)(64126003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2691; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD016; 1:HpH8ovMPFKE2dsXFlROhRJqk8a/++r+hFjBtJjOOLb1wE3ESfQwnLIyA8Ln29/A0EpvPUFGbnW9B64+dG5+/y14id2Gl/WiHwo8Qqxg7JWnZo6yH6eFBB8Yn9vyO9o6L X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46b73976-fb9e-411d-6591-08d5115ed543 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN6PR03MB2691; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2691; 3:xSVXdQ7XN/HiffiGqYIt86I4I3d7cDJLGFnjwSqd+CvVBfNhaAUTZONwmxl8LWNg0nwVcfXcCzuUxpBIx40Zp1zYQn76CrpRQ+lLYjNIZxwNl1/OKHCwR6swriqqvLPzD4RgI3sxN9sZvcXL9W1T5e8JFomwdl2Dne0PAdkKaTenA6IHFUGZlMvNUDnHQB0O3vd/RjTS0kfXjlbnGpish8sVAGv0zsfwXXJ7rlN0Q1Pu5ZOBs8tmVBvyzRby/IuYmMSKrLE1A1wyqQ22pZZvwDl8JkG8UZs5hGqHtDL0kF+XOmnGGnKZv2Eo1y7xFCFW6bK5YFjSvow3b991k1GsGrX9V4NotfrHCmwwpyQkKMY=; 25:VjjvDyuwIVx5YiiIQfBJ1PSqMFWjzUj0tcJewmoAp6Egg4+UoyPOsuuoyI/s2bmsR/k+Vfy2bRtw4P9rASGOZN5wpXpnzho3pS/fPdRlUezlYsI0vqsr8YPKdSdiB06Wf/Q+tphM+SDUqhCJeX2wqqjCz5Ci61xs6DbMK4jUToLMTQg9UPygShWPU+I23EyuNKIq6YT2l8wq+f/Nh9Rybptw9BjroJ+7sUror6ZHmGMbcV2HHyDPs5XR9LPEKQIzTGavQHBEQb8sCIttSeNCadEw8Lk+BBKZTCqj1qK6UKz4SSeiJIsjSoOzusiHb7dmZh6BwdQHTOTcOsjWVawVnQ== X-MS-TrafficTypeDiagnostic: BN6PR03MB2691: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2691; 31:Jb2Sg5Joussebp3vaZYoM6hU1rkN6YOfX5HG5JNq9kk8TgdzHayJcF9FjP1H6+qI0loTdxHginM/wSJRwU4P17w8hMXkrr/JXlcjb7Sh2Ers+LhQzmBIrKZlYe+ZbgX1McJsDsLQuz5J/1cUxp6g3zsL9GYd2wz2fDIHbc7GSFjorxOt+aNxY608YZbojlKJGYBxuXrAH91XI2cGz/8T5g+sBreNrHGDR0x7ZOnRM00=; 4:43nKex3tfJaEX3s+pWG+y34kg70j45jxUh6H2IAzro1Ph5K3xEIq3yfL4llCBLTDqcr/K579UHwBCDk0CKDzvSgCTeCi6gXsDwpc2abK1P7xHvdmphrNuedbHgUh5aMuPMgS5XcQ6b79BJeoxEcsA+BuvqR/f9A99YEj3wLVAvKRXgr5ubFETsaSgJPq/onFxcKUpQHijiMuxAPfJuGpUIdfnxcCWlD4IW4Wc+K1s3+EeVDfKk0Pk4UQtpwAqIlM X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123563025)(20161123561025)(20161123565025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2691; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2691; X-Forefront-PRVS: 04583CED1A X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjAzTUIyNjkxOzIzOko2S3VnV3ZOaCtQbTdTNVNCZlh0cm43ZEVQ?= =?utf-8?B?V1dIb1JIenBTaFNndytxcmk1T2VLRS84RGgxd1RNWnNFaWV0ZGFMbURKL3Aw?= =?utf-8?B?SE91TnJwckJyMnRWd2tqak1BcVZoUkpPSnI1aHFLS2xrNnV4bkdvU1hWWWh0?= =?utf-8?B?OER1YnVxcEpzL1BXYWFINjUvbFRMMWxkVENiYVVsYk5nSFNIKytRVlZLYnZJ?= =?utf-8?B?a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V3+F0qS81pKkaiGM2Ep0TqAdFw3KNP+cJvJdiYMd2YwIZ5zpkQj1eNi2y1rNe+UIqOmqsFhJlsxdBE7eMkOvpfST8aDCMH8igqAtmPxMTmlF7jR1c1fpX+Cb7ku79KclUgOkk99zpWoCQcrCqiFG10v34/seiPS3kkfvqJy6LOTGtp5JQ5ec8TgZZsGHeweQYu/IfH0l1TISXtEMQehlRFKBjcnkxNlmnlw5gg==; 5:WSEKb+Ho3zyueT24GcXT9konhkEq7XPPyK3VCkFCSRoFXkZYtBnJo9TQJxDyJfMXg1hTEVuC3tD1frzw7heVJhW42AuWY7M3x5Q2Y3KQ7ZtbZCQrcoj9gqo4mUOwcQavA782UDi7H9SF3Qvk7TRH5w==; 24:YWoNapOUNMA6lKL2AliFm1bF0u9n93B9vTQU71w3RpJsRA461x6QfVt1wPHCf9qgEjGAKT7MfTsIPxp7ACswT5OJAXe9rkBS+PHJOY1x0UA=; 7:Wj2w5l4IWjFPTHCakjN8nNnT/FeQ9zKr3xaUvViuhIxEHZJTz46cTkPD/ZKL25DyGJDc7NjqZFYakZV72yCe6HkmwSdJglv3u1RN7xeC1Ub11kiHlpObnRLjHpDgYRpsB7Ui1kbwPgUzbcsi3IDXW9U0Jnyb//bSGFdTmj4zflIeuv2Qs8bamjvYA8MgRFkSTTsNLzcORaoxKs6+SnEAjlBKsPt8WG/EUV1CfZe45ec= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 10:48:54.3015 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2691 Subject: Re: [dpdk-dev] [PATCH V3 3/5] ethdev: add new api for traffic metering and policing 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: , X-List-Received-Date: Thu, 12 Oct 2017 10:48:57 -0000 On 10/6/2017 8:15 PM, Cristian Dumitrescu wrote: Overall the patch looks ok. Few small comments. > diff --git a/lib/librte_ether/rte_mtr.h b/lib/librte_ether/rte_mtr.h > new file mode 100644 > index 0000000..f0f897f > --- /dev/null > +++ b/lib/librte_ether/rte_mtr.h > @@ -0,0 +1,723 @@ > +/*- > + * BSD LICENSE > + * > + * Copyright(c) 2017 Intel Corporation. > + * Copyright(c) 2017 NXP. can you make it "Copyright 2017 NXP" > + * Copyright(c) 2017 Cavium. > + * All rights reserved. > + * ... > +/** > + * Statistics counter type > + */ > +enum rte_mtr_stats_type { > + /** Number of packets passed as green by the policer. */ > + RTE_MTR_STATS_N_PKTS_GREEN = 1 << 0, > + > + /** Number of bytes passed as green by the policer. */ > + RTE_MTR_STATS_N_BYTES_GREEN = 1 << 1, > + > + /** Number of packets passed as yellow by the policer. */ > + RTE_MTR_STATS_N_PKTS_YELLOW = 1 << 2, > + > + /** Number of bytes passed as yellow by the policer. */ > + RTE_MTR_STATS_N_BYTES_YELLOW = 1 << 3, > + > + /** Number of packets passed as red by the policer. */ > + RTE_MTR_STATS_N_PKTS_RED = 1 << 4, > + > + /** Number of bytes passed as red by the policer. */ > + RTE_MTR_STATS_N_BYTES_RED = 1 << 5, > + > + /** Number of packets dropped by the policer. */ > + RTE_MTR_STATS_N_PKTS_DROPPED = 1 << 6, > + > + /** Number of bytes dropped by the policer. */ > + RTE_MTR_STATS_N_BYTES_DROPPED = 1 << 7, Trivial one. do you want to group the pkts and bytes in separate group respectively? > +}; > + > +/** > + * Statistics counters > + */ > +struct rte_mtr_stats { > + /** Number of packets passed by the policer (per color). */ > + uint64_t n_pkts[RTE_MTR_COLORS]; > + > + /** Number of bytes passed by the policer (per color). */ > + uint64_t n_bytes[RTE_MTR_COLORS]; > + > + /** Number of packets dropped by the policer. */ > + uint64_t n_pkts_dropped; > + > + /** Number of bytes passed by the policer. */ > + uint64_t n_bytes_dropped; > +}; > + > +/** > + * Traffic metering algorithms > + */ > +enum rte_mtr_algorithm { > + /** Single Rate Three Color Marker (srTCM) - IETF RFC 2697. */ > + RTE_MTR_SRTCM_RFC2697, > + > + /** Two Rate Three Color Marker (trTCM) - IETF RFC 2698. */ > + RTE_MTR_TRTCM_RFC2698, > + > + /** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */ > + RTE_MTR_TRTCM_RFC4115, I will still prefer if you still add "PASS_THROUGH" as explicit algo. > +}; > + > +/** > + * Meter profile > + */