From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E9D5A0562; Wed, 14 Apr 2021 16:00:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DD344068B; Wed, 14 Apr 2021 16:00:57 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 1A31B4013F for ; Wed, 14 Apr 2021 16:00:55 +0200 (CEST) IronPort-SDR: sKK9zqUTT+6CCD3RNENJi2ENxJoU32QhGR8m/YHgulMG2g4v9rUok6PVOPFTmbBUBzcY3Nf4uj F2RzP+u/gSaw== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="255963263" X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="255963263" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 07:00:53 -0700 IronPort-SDR: SW3SSaW80zg+4QERf6M4Vg7JNrN+Q+FTQ1pBeCCpRgjg892gg99a8Tz1uVYTj/xs2R2OQoFz/5 DetTlIyyI8jQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="443828259" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 14 Apr 2021 07:00:52 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 14 Apr 2021 07:00:52 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 14 Apr 2021 07:00:51 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.2106.2 via Frontend Transport; Wed, 14 Apr 2021 07:00:51 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 14 Apr 2021 07:00:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kxU98K4oJRPEF+LyJIsYBpiZJ8nS+aLRrNtdupNhWye8gGJuHBDNd4+yFf2+LBZyBwMwjKeIhzSUtV4caFbU1ds2MJ77/VwJTzRpBfj5C3Sv7wIv8Sjfja5BN22kaoU5/8KxgC8MvrJhqRk68QkflXhpZT3C8KqmMWK7ZyyhU3heooSyR8Rh8nAnus9MS3fOWvarWeZ5bDbpA5DEDFF7g0fY0JZv9XNI3QBJetLBS+Fe0t1f66GmCigPkTPCXblTJ/ZAfc2cXAK/C7Av1XVaJkw3ExlygH1o1p3/nZ5rqobYokuFmdQTb3acIg2M0rY/xTmW8ZTY1BA2JG2oCaZmuw== 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=J29XSu54rLOxRXVTMc+LURXKKB7JEwxcaRw7biR0gaI=; b=iI6R2IDsxQAFofipWnpyxDqDumWUhw4sZlv4HYClFZYC1d3r1Cb9dqWkzRIwqiAcLsqQpwaULX5O42ZtHLp01dbWeE0L6UiGrz8V6X8nFgutLFZNTGfW/1pYGtATdURYrtAtwstMxn7uE59Ka+OCFtNLFyZ1jSoeSf3OCgE2iwMGrL1h0O9kw+PJr/S8Pk0bQHpr1nKZhKjza2ofPZLA274q/QT3OoB7v/Vu8aF29L9jXl43rC+KQYLlmyT1TMdaxvqHA0ZcepdEbdSqVcDnk/+Si5Dw1BVhTHK3FEhGmMBnwsJYMkMwdSQb4G4swogkvkB/UC3JHOTQYnogbZae+w== 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=J29XSu54rLOxRXVTMc+LURXKKB7JEwxcaRw7biR0gaI=; b=LCGayJ24rJsI1LLdYnrptPI0KLYkJRs4/WU/eTLbzOiVyovjw0owj2OBtnlEeie5dBGkxNiO+J8HkARU6FZyy9D3rtLw1FGwvA8WhcCzCpZx+RWJvD3VjL+JE0XFnhLZTOoSPRJHlau3+lEP6GRG+q09Pr7EnOtFKVzRirVmz9g= Received: from DM6PR11MB2796.namprd11.prod.outlook.com (2603:10b6:5:c8::23) by DM6PR11MB2555.namprd11.prod.outlook.com (2603:10b6:5:c5::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Wed, 14 Apr 2021 14:00:48 +0000 Received: from DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9]) by DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9%3]) with mapi id 15.20.4020.023; Wed, 14 Apr 2021 14:00:48 +0000 From: "Dumitrescu, Cristian" To: Asaf Penso , NBU-Contact-Thomas Monjalon , Li Zhang CC: Ori Kam , Slava Ovsiienko , Matan Azrad , "lironh@marvell.com" , Wisam Monther , "Li, Xiaoyun" , "Singh, Jasvinder" , "Yigit, Ferruh" , Andrew Rybchenko , Ray Kinsella , Jerin Jacob , "Hemant Agrawal" , "dev@dpdk.org" , "Raslan Darawsheh" , Roni Bar Yanai , "Haifei Luo" , "Jiawei(Jonny) Wang" Thread-Topic: [dpdk-dev] [PATCH v3 1/2] ethdev: add pre-defined meter policy API Thread-Index: AQHXL/oEJ/IoRAOPZEi67RsT/ofW/aqyhLDQgADwB4CAADRJgIAADJYAgABWGUA= Date: Wed, 14 Apr 2021 14:00:48 +0000 Message-ID: References: <20210318085815.804896-1-lizh@nvidia.com> <24522212.gn4sJpSb88@thomas> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [51.37.10.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ae111fd3-a528-4154-77e7-08d8ff4db4e2 x-ms-traffictypediagnostic: DM6PR11MB2555: 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:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yMBFGUZ1OaT5dSZW/ywWsK4kY47OG93iTOaivRgqqrr2Rif2W+fsf+gBxwG5+EFSwgT7MqEyi+pK9/kMLm9FO8yB2vQzoQ4R5Bimsd1//hbPSSHFJAfz/VdiTd1C/Zx+4uEaV4DVyL7YKn6ziUHAaIWktgtoxLIVyFfCDutqKNjwkpfYoqukdh142C/W/BQdX7beWkJ6841miKaCTl22BbYarpBLIRhhZhsmnrV1Xrq+j15BXa8f80CQZdJhJuJN8PmLmODCP+X2NvcgTRHNQw9ZgPRvbKgBvNt38lNjH8Yw5DBW+7kwNMONZYzcvgs+Sj0usRcWo0yFam9e0p1mVM0Elgc3bV74m55+WB5dtcy4J4mK9DJFqFqVVsQqaG486lBT5NJL1lyEXvZ5QKpcNam0F1QRTk+vWvshrdA78puBUPhEhIeE3r/y18JazbCqehWavOnGLk46fE0GD1mAUDtd4h7BQMGrHZLoUqdrGf1xj7hR0LGWsZpqwoY0jmkJUnD4ah7q5soSWvWSQp6ZX9C5tjyEfO1lssnJcWf2T732bMGgeeZX1IUX1w+cnsyAbl5sK6nHaAkDSkw4YeVDZDDA9PxMFXBgQeCW5sVjHZY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2796.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(366004)(396003)(376002)(39860400002)(346002)(122000001)(38100700002)(7696005)(54906003)(110136005)(2906002)(4326008)(5660300002)(52536014)(478600001)(186003)(9686003)(71200400001)(8936002)(7416002)(76116006)(316002)(66476007)(66946007)(66446008)(8676002)(66556008)(86362001)(33656002)(26005)(55016002)(6506007)(64756008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?KablDW6Vb6QyiubUaLmAzg12lOj69fB+A4cHhqb5N6luI4ehWahfhsDhyQqt?= =?us-ascii?Q?RpQtZYbj3e/WvUCdV/TBjjAqNJaEP/KMH77jtB9xVjENvK0cvwiiZ7dsPY0a?= =?us-ascii?Q?PifwvIf8RJt8ARTsdakDWoB6jwqURrKypFvwiSnnJ6SaikxXQKMQgWyGqhjg?= =?us-ascii?Q?w0yWeu3f1WBZqxPMHpyXSApbtBEqQ0vmeOwEiMDFnQXD4D4P8k1Oi5p/vLah?= =?us-ascii?Q?Lctj1URj9MYvq/zvePYD5c8olK6jnPgnT0Z04UXsVqS2TwALOipDUBQKnI9x?= =?us-ascii?Q?DK+NUcu3OZO1I7r9rz0W2wPbe0KC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rNlFDRGLTuS1xQzGmtLc1GXP3zMJcg2whpCO3w5Bsi2zzvs?= =?us-ascii?Q?5gUk6h7ONPcG2yGdOffjdDevua5AV8eONa4XhMmsElzfAGk3yiX6qNeX8eFg?= =?us-ascii?Q?qgc=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2796.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae111fd3-a528-4154-77e7-08d8ff4db4e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2021 14:00:48.4151 (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: WjP+Cb7Mshi/cFfvavb0akcQ+ppwn9jGvhcj/2ftLXRrmczSr1ZBXJdvDJd8fXahtrE6rVcTcLW6B4FxQGhjlmsnfXUtvh3Ppp/chp5S7CE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2555 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 1/2] ethdev: add pre-defined meter policy API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > >14/04/2021 06:55, Li Zhang: > >> > > + * Example #2: GREEN - Do nothing, YELLOW - Do nothing, RED - > DROP > >> > > + * struct rte_mtr_meter_policy_params policy_1 =3D > >> > > + * (struct > >> > > rte_mtr_meter_policy_params) { > >> > > + * .actions[RTE_COLOR_GREEN] =3D NULL, > >> > > + * .actions[RTE_COLOR_YELLOW] =3D NULL, > >> > > + * .actions[RTE_COLOR_RED] =3D (struct rte_flow_action[= ]) { > >> > > + * { > >> > > + * .type =3D RTE_FLOW_ACTION_TYPE_DROP, > >> > > + * }, > >> > > + * { > >> > > + * .type =3D RTE_FLOW_ACTION_TYPE_END, > >> > > + * }, > >> > > + * }, > >> > > + * }; > >> > > + * > >> > > >> > These two example policies should be available to be used straight > >> > away, please make them real data structures, not comments. > > > >Wait, you are giving code examples as part of doxygen? > >It's really too long, we don't do that. > > > >> > I suggest their names as: pass_color_policy_params and > >> > drop_red_policy_params. > >> > > >> Thanks. Will change the names. But it can not be real data structures, > since it > >just one example define and no use code. > >> It will bring build as below: > >> error: 'drop_red_policy_params' defined but not used. > >> User can copy these example to his .c file when it using > >rte_mtr_meter_policy_add(). > > Although these could be looked at as examples, they are really more than ex= amples: they are expected to be frequent policies that users would require,= so it would be good to have them with the API itself. Li, I agree we cannot instantiate structs in the header file, how about we = place them as macros in the header file: #define rte_mtr_policy_pass_color struct { \ ... #define rte_mtr_policy_drop_red struct { \ ... Regards, Cristian