From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0081.outbound.protection.outlook.com [104.47.36.81]) by dpdk.org (Postfix) with ESMTP id 3EA571B204 for ; Thu, 12 Oct 2017 12:54:16 +0200 (CEST) Received: from BN6PR03CA0056.namprd03.prod.outlook.com (10.173.137.18) by BN3PR03MB2355.namprd03.prod.outlook.com (10.166.74.150) 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:54:15 +0000 Received: from BN1AFFO11FD045.protection.gbl (2a01:111:f400:7c10::164) by BN6PR03CA0056.outlook.office365.com (2603:10b6:404:4c::18) 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:54:15 +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 BN1AFFO11FD045.mail.protection.outlook.com (10.58.53.60) 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:54:14 +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 v9CAsAjC020392; Thu, 12 Oct 2017 03:54:11 -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: <293766e1-462b-70e2-9fba-7f9cab5f24ee@nxp.com> Date: Thu, 12 Oct 2017 16:24:10 +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: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131522792546973330; (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)(346002)(39380400002)(376002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(377454003)(199003)(24454002)(189002)(575784001)(58126008)(93886005)(36756003)(86362001)(76176999)(54356999)(316002)(5660300001)(77096006)(230700001)(50986999)(4326008)(110136005)(68736007)(31686004)(6246003)(2906002)(64126003)(229853002)(498600001)(97736004)(31696002)(53936002)(83506001)(2950100002)(8676002)(81156014)(85426001)(356003)(105606002)(106466001)(8936002)(47776003)(81166006)(54906003)(189998001)(65826007)(53546010)(33646002)(104016004)(305945005)(65956001)(65806001)(50466002)(23676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2355; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD045; 1:j945pDKkgLYItMhhEiIr2Qd8vj3GiScaxWB6rZjWBQrCZqq5/RIncYgGTiGAroqjBhyLI+W+uw7ISB9qgj1X9tyY+WjBr4Zoo6flmdFoa5OLp542QqLXpkSj3iiFaAO0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42d387fa-9cbe-472c-d534-08d5115f9415 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN3PR03MB2355; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 3:/K/SZI6JINdvFX6wuriePU1zoyp4TAQ2dqb6qK78Vw1vF1AfHTwF0mOeRk7A5ObU1fn077/iIQc0jrJffoaQ2CPp+cPVAiB2C6PuyTcJGco4+ZwYTv4qj9Zv4QGBdoHFbVJ3XNzicCwcoLLOamlRyZzar87n0HZidoMFAaCclJjsow2o//QMLL08WMpLPRSAw05PAeoCL7WYfj3zt4KjUU+AorcLz3CKUHYkALI1cf3G2ftawgDApYVbBjastt5bfz4DZUgFFlbuIPbKC7wOxtn+Ui3hXi0oROzEdsA6oAvTgHcUEHJ3S4kytA5qXbJ/3g++zAgRzA4tnNBN0dL+pm5Sh/2E68tSWHYgEzPmfHc=; 25:72bbNnANKeR0G/BBOU/rzB0uQn2ARyNYo0udLYmEEyJ+/JxVIt1GklJ91c3Pt43O60xHeYzUjyAc9Sh5FAoqZxHk1ax4CA8jgHwkbBOThwr9ESxt0mxY/m6bUWU3G6yK90jYH+tE627xQdstoNMvv+FSKef+LtjKPmq2c9pcTYtJVgEoQ+fv/nIeoeBUwFhMrDApz7PockVQRLRVxdmOOVNDG8fX2VIi3g1kKr2YVApIfVA7dbJox3BpatKx14gt6uVEwE0DpFAfjexzuM0Ru8Yku/sFVT5GdTkQaDRrvl7F5VjIR9uJkI1AQNJt6Anmtp1lVxSEutjyV2DyYpfQnw== X-MS-TrafficTypeDiagnostic: BN3PR03MB2355: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 31:cXX1UTCwKKtU0TI8NsuzuJ3fKOmPPqo+Vqbmcwsft4GsJgs2Quv6LCzqbl/d6Ua5o8pBUgoOe46lIj0tIHoLPgdoxBmNp0K95Q9GdrGjCFJzYyUxgqh7JKzELoBwOfC5ilv9EQizgE5lxcBphP78YJWloAeuPacOjUzWqb/7OHt0kZ95Y9Qc0WdMXXkN9MJcE2J0insTglCFGK1jrdF0IMYe2KHGZ6wFRqQl1ftnnE4=; 4:LewE5yI4lc/zT/OgtHSXzq1v1+NP+6gDg+fqJARbEU0Zlbwwiay7hkte/880B9QXatZ0PzjXugOep/qaHTO/cvGVu6M5SznAsZk4gJtUFkitBsKzh6WQ0mw6x+kAzIbc8/YVmAoSpgQK2SWdRH5x0N6FXEEaTh/yPGQ/LxaCoHqJwgbFzr6XS0R4x4w/8cUhFLfc1QuYQNBoV0pm5yenW4XxOuf+8xxNH4VYB+VxNNUkzR0Xf21qvxgq/FVlZOzPvUjnUxZHZTg03kb/lWXu3Y7JHGDK9+vXqmf0+H/zpoE= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(20161123556025)(20161123561025)(20161123565025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR03MB2355; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR03MB2355; X-Forefront-PRVS: 04583CED1A X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjAzTUIyMzU1OzIzOjV6Tll2a1BUbWxLQ3hsZC9UTEFzMjdkWElZ?= =?utf-8?B?YlhMU2l2eFlkMnNZOVZNcG1PVEhWaWw2V2ZNRm94MUNKbWwwby9FRXcwTnRa?= =?utf-8?B?czdXZ0pTSXJZYVpzTVNPaFc2aTh4cFc4ODNRekxzS1hXWkc4YUViRE5Pd1BD?= =?utf-8?B?QTQ0Ti9iZzV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N3PR03MB2355; 6:q0YeZe8XqGu4az7hixkM7tXDsYDBKjVejK4K0tHXxoarW3CJBsIdkXcc91o3prukXHhYelH+gXrCXXgwuRDnuOsAlq3ei9Szc0uG+SKOkE/CMxzXQuughUDeL8U4qMLbgrU8qOdTAcm7/4bZXC8HLfARNuG9XXyRRRupQaw9ZoQAtz2xKxka1i7ka5esrLj8StHmFzmVagi52P8n6PIFUT+oWTJqxJ1jH77pzdc0lkY+m8psdPKEDYhPFzwHCD3PXGPnLguYVU0+4AG1EbzkjQTdkwLAHbKGhnOxLbvWQko6G/UV50Qdm9vLASWJVCaklMOTlKjUON5p49i/sBpqyw==; 5:rivyCV3tbgE0h2Axee6tflrXn0NxqXpBt7Ecx3DI3PUZJnbq3P8DcaEHeChSbuvstpWd36OA7ueqsJqkuj/nTtTNEyH8k9OVyC0v1MbGhQFJgjE4OmI+blcAz+AgSmEAQyvygo2Zk0yhxbynLMDZNQ==; 24:OMsRT1SoSBZbcht7WNxOJFiC8hnv0+uV6AYnNzQdvO/wKR6Rz3evrMhV9GTZ3lZKE31LTnXRVMQ9OvtBHITzfix7lq4VuDMQanyh7jEha6Q=; 7:kZRpIk9+9MGWOClgTfaCxI1xPXoQr6v/RS+38DouRjbGESZHGXR8O4/8tCQCm/vMFNT+G+Gok7lcu9bYbqJo81K4PUMs6PJ05/nt98hD37OMqM7vAUi6MPLgLNI8PH+Dp/+cg0Sfhy6MlGTsu177VGj9V7zbCHj42SK3fVeFW+I10ho9jtrwiE5Yq4DUA/77Dgto+Lngk3Eq8GmkRHk0bqhUVkjR7vICtTJeFeX793s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 10:54:14.5101 (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: BN3PR03MB2355 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:54:16 -0000 On 10/12/2017 4:18 PM, Hemant Agrawal wrote: > 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 >> + */ > > > Reviewed-by: Hemant Agrawal