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 26B24A0547; Fri, 12 Mar 2021 16:30:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF4561608AD; Fri, 12 Mar 2021 16:30:16 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 815501608A1 for ; Fri, 12 Mar 2021 16:30:14 +0100 (CET) IronPort-SDR: QF8JkmStWti+TgvafXDjbBh2dEeb2eh/UWITkfqMrcRbNRd7VlT2e2uY4zISIPsaDMTiKTIVl3 uHKvsX425ylA== X-IronPort-AV: E=McAfee;i="6000,8403,9921"; a="273888502" X-IronPort-AV: E=Sophos;i="5.81,243,1610438400"; d="scan'208";a="273888502" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 07:30:13 -0800 IronPort-SDR: RGaVd8k0gDCevff9wMASvHB85YyvyYmptogxVMkaZqfTl8z0v9AbwOO4GlB8SufO4Z+HVEnNTA tZwi3Aem4qoQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,243,1610438400"; d="scan'208";a="404447274" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga008.fm.intel.com with ESMTP; 12 Mar 2021 07:30:13 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 12 Mar 2021 07:30:13 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 12 Mar 2021 07:30:13 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Fri, 12 Mar 2021 07:30:13 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Fri, 12 Mar 2021 07:30:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z/LJuQekny2yQ3nBeQPyqc6BH1OahKDDM9XwuB+s/o4Re8RD6PLHLHrFsqVMvP4gGn5I2TrYqbVGfCsWwsfqxhJ8dASg2zk5cWRYp5jR+OtA+tE5huwKuOvWvs4t6WcCDz3IJ5wF8/eFa7Idvwg1Q418eZRkzgn2esvWIbdblKifcMDD1GkgnHIzNxiI9qd7XYp8Ok0kcM+aEi6SxItOf1G34thcDHSl0U5c8w4zmurkXQ5+hlrPUJ+A6LCs2L8TSF6eChNpbL0Lu7d1zd2WYP9D49dH7A5Cr2nJ/HJ5+9mr17xKcorXtA2wh25bIiKp7JhYuFHuwTfQA/WHHRwJCw== 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=4kA6nYd6SGZpzaGYXsuxaNDUx2cat50MBowj31Yjpso=; b=MHBWkWoT7st+a+YFObX57ZYyySLFlmuwbigB+8ohws9ZYDJUk5i/8QEmBeEKvBtqMz1lQNje61WONI5n3wZsUnspMa4rTZsIQdjkp4bVA2CK3RzyWjaA11P7Jwk/fP3A4b1hwwALdJTzdLiGr91SB4ZeD7Eyx2bvBGJ88bxl3JGrpmPWF8xHuvJ1173WjxFuhV6opxs2ehIFO6Y2CbmRgBU2GRpmWqlC05oOwoLTVUutlynfqcNXG5y5PjwFOg2KBj1M8ARczhi5IVSkljgOJgIM0k4nGMRDrFNnNmR4MZxaqxILyAc3g9eRpRoOA69ui2xZFhvtoKCCghl9xnaFAg== 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=4kA6nYd6SGZpzaGYXsuxaNDUx2cat50MBowj31Yjpso=; b=o6QqGuSaGuIT+Hem089IeGGcYhKlua024EAHtYCeZegSw1P/kYTrdhzLX4AXV0T430ONpMwLbpmx7XJOiaSY0iSKWeKSiFnZZG+5mbqt0kq4nQ7QKr5IkiILLNPlu1gZ4DeHRkbtAtgyQ1E3CSHaHH++ESmXWabfl6cCyNG7fUk= Received: from SA2PR11MB5196.namprd11.prod.outlook.com (2603:10b6:806:119::18) by SN6PR11MB3277.namprd11.prod.outlook.com (2603:10b6:805:c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Fri, 12 Mar 2021 15:30:11 +0000 Received: from SA2PR11MB5196.namprd11.prod.outlook.com ([fe80::e5ae:2c7e:c1b4:c0ae]) by SA2PR11MB5196.namprd11.prod.outlook.com ([fe80::e5ae:2c7e:c1b4:c0ae%7]) with mapi id 15.20.3933.031; Fri, 12 Mar 2021 15:30:11 +0000 From: "Carrillo, Erik G" To: Shijith Thotton CC: Pavan Nikhilesh , Jerin Jacob , "dev@dpdk.org" Thread-Topic: [PATCH 1/3] eventdev: introduce adapter flags for periodic mode Thread-Index: AQHXFFwNfpZBEmZFzEyZzTHySVF7cKqAfM6g Date: Fri, 12 Mar 2021 15:30:11 +0000 Message-ID: References: <20210308204543.2903723-1-sthotton@marvell.com> <20210308204543.2903723-2-sthotton@marvell.com> In-Reply-To: <20210308204543.2903723-2-sthotton@marvell.com> Accept-Language: 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.5.1.3 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: [136.49.192.164] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f6d20035-95de-4899-635a-08d8e56bb9f0 x-ms-traffictypediagnostic: SN6PR11MB3277: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w01BENPWcNPAd2x/EP+oGcPzapZ/ucLrbfCyo0HmI9xSx0POZ1E5W0yRK3mFGgfQLouDPzifZlUNgQJuTw6Hev1f4FM6Cs3XMmsvg6Y0cow8J/KLs0zYVW+DfUQJ5cQuwW3TxhV52vCHo/TMv95dzawNRnErsVMPGK8rmhvnWG4EmjPR3Yztucv1KYx+Ti3g67JsvMXxTz231nsuoEZ+i6scLkAIks7lKAOBNUgYbU38mZmDfgjrRsrCO+ZB4a0V+G2s69LQAp55G76517dCH8grzdkTTxM9dSDYaCt2r2Ql7n8h0UFp4BfYr/XTcfgMabzW3uF7yZnDbd18lFMLrTPl3NLIugHzT31LFp2/j2zBj+pHTBJn90q3W1xKVnp7IMvWzqqJM+Y440lk0fERIVR8Vd7hdhfGLJG7Hpgv2ZFtSAeirWANdWA/4hQ1z/mNPXvpRLfq1duCc1SnF9rBB3wS2ZgHjbs6K52Uf6cmt/xgny1JNPryWT6CotiKYqWMBwvSKSRJClnzJf4GO6a3tgIarAYEoRE1FNLfPzhYrcT1rsBG+jTF+paD2tFpsPnI x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR11MB5196.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(346002)(366004)(39860400002)(376002)(396003)(26005)(33656002)(316002)(8676002)(8936002)(54906003)(186003)(6916009)(2906002)(76116006)(55016002)(6506007)(64756008)(52536014)(66476007)(66556008)(9686003)(71200400001)(478600001)(66946007)(66446008)(4326008)(83380400001)(5660300002)(53546011)(7696005)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?WbJNpebchYt3uHie5gw4E/BkwXtD2iKP/OqT04O7ZbpklGPVjlJnu0chrzpu?= =?us-ascii?Q?A9Jc5Eg/AvGmF5yoZrNBErD/oFpnh6TYLGzvYJIiQRoag/7J2KS4XE3fjscI?= =?us-ascii?Q?pOXKickJf6CQM5aP4y0GS/v0ejJOXz5wfSTs0ig9UYTMkefOMN31E5MWTQuP?= =?us-ascii?Q?e99WwXL5PJqAoEAGd0IRCwHZfGq9UFqpH0DEcc0ulYbo0LWDeDecovJ2J0WY?= =?us-ascii?Q?E6hVgSWA5+saiyVy2Os89Utz0Wlkd7FfDlVWIaELQplB42eh5GIU9ht3V/w/?= =?us-ascii?Q?dOYh4WtUO3YjTA8gg3rkypc0TIWPhU2vDGvqpOZTBWzAeTaOdu9EN/JsuFdo?= =?us-ascii?Q?xOzEzsqcb5Beh0JRwYFYsvTuODh7udZkzlKnCajznz+x1AUssMJ3A3khnjly?= =?us-ascii?Q?5xWx4Pwwr+tZEsTs3hhmUcNtjvVlwOJpZ9uz+dSIiOcN2F8qdbWK5DgXNRft?= =?us-ascii?Q?SlXIF/2DbMLwBL1Li5YGV9EHJ3UxhCmsVVy5sQT/4N518BI0BmV86VI2NEto?= =?us-ascii?Q?T7nXlrocAWXTRDbFkDW2WXc2wKpZmM74rVs4c0RMkIKE9eAIHwDsmOPxG2sb?= =?us-ascii?Q?z0Qd7lgHvG94gDNenWA6lw1vDaUD40aKYKrjaWWkVi3PfpOGyg1yu2zIS1oS?= =?us-ascii?Q?W5Reb/rKgWtPSLl5bblEv5FLGZnt7Rb14pfWGCyB2BQQ2TulsIkGc/Q2Ppgm?= =?us-ascii?Q?MP1PDtzbWUUZM4RnxEqAX93dshqlMnIz3XEgPb1LkMAmone1vHNU4Cfe++an?= =?us-ascii?Q?fcI5dOPQIfdtn8mYynQ4Pj1j/JQ644W5QjyvlR0uDWSGDieDjRFKouf5Praz?= =?us-ascii?Q?/DArCTsT83UDaTpNmCP7JZOJ6hlR663Wpg5pHSb2Ht4EJQxYLooDg5+m8gMr?= =?us-ascii?Q?K/4kN2wY5SMXNwF8+YgKDOg2bKxs/93Qs6fDmt+mjyQmi1zB70f7b+Mn/V+M?= =?us-ascii?Q?HddbJMSYiByyq7fp1gOsO3uKHUt9Ooep9uilKwzPybIiCJgp8GU4xOHWzVEq?= =?us-ascii?Q?NmFFbDdnrxXp7ZcqdiwpnOA7k2mkxbaDYR031+iajVnkvTuWMeWf+TJ8lTjF?= =?us-ascii?Q?Awa0k9YJzZhryYEX5mesjdSwFi7vUoJF09bJyqIMZB9zgY9HlJ6Eqp1SIV7d?= =?us-ascii?Q?1diztL9MwhGWn3n1VInbbs9F6kbcbciwcNRVmU3AGz/ACUUcIfh7Md48UFV5?= =?us-ascii?Q?IgmKHJljek3Kzo6RXbgRMJvY9oxJAj5McKYPhJG4FU3GiO8J+gbEsi+vfpzt?= =?us-ascii?Q?t0rIjC5IYmRJrkwfG9AtmXENWJCLzL2s44IdMNdXkKbeuzhe2bSmNrRr+DsF?= =?us-ascii?Q?uZSiddU2dx2qVhtVm7qqzxjK?= x-ms-exchange-transport-forked: True 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: SA2PR11MB5196.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6d20035-95de-4899-635a-08d8e56bb9f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2021 15:30:11.6048 (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: ZU/1UpaxXoDhqxqhbY1U5ED9v0Ns51h+a9EchJsDJ8NeJeavZL/bfCinsEYZLnUwAimtiMi2/GPz5AbZNPVfQEx3KOQUmmjcOxCD8ot+lTw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3277 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 1/3] eventdev: introduce adapter flags for periodic mode 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" Hi Shijith, Some comments in-line: > -----Original Message----- > From: Shijith Thotton > Sent: Monday, March 8, 2021 2:46 PM > To: Carrillo, Erik G > Cc: Shijith Thotton ; Pavan Nikhilesh > ; Jerin Jacob ; > dev@dpdk.org > Subject: [PATCH 1/3] eventdev: introduce adapter flags for periodic mode >=20 > A timer adapter in periodic mode can be used to arm periodic timers. > This patch adds flags used to advertise capability and configure timer ad= apter > in periodic mode. Capability flag should be set for adapters which suppor= t > periodic mode. >=20 > Below is a programming sequence on the usage: > /* check for periodic mode support by reading capability. */ > rte_event_timer_adapter_caps_get(...); >=20 > /* create adapter in periodic mode by setting periodic flag > (RTE_EVENT_TIMER_ADAPTER_F_PERIODIC) and resolution. */ > rte_event_timer_adapter_create_ext(...); >=20 > /* arm periodic timer of configured resolution */ > rte_event_timer_arm_burst(...); >=20 > /* timer event will be periodically generated at configured > resolution till cancel is called. */ > while (running) { rte_event_dequeue_burst(...); } >=20 > /* cancel periodic timer which stops generating events */ > rte_event_timer_cancel_burst(...); >=20 > Signed-off-by: Shijith Thotton > --- > doc/guides/prog_guide/event_timer_adapter.rst | 33 > +++++++++++++++++++ lib/librte_eventdev/rte_event_timer_adapter.h | > 6 ++++ > lib/librte_eventdev/rte_eventdev.h | 3 ++ > 3 files changed, 42 insertions(+) >=20 > diff --git a/doc/guides/prog_guide/event_timer_adapter.rst > b/doc/guides/prog_guide/event_timer_adapter.rst > index a95efbe0d..fcdecdb3b 100644 > --- a/doc/guides/prog_guide/event_timer_adapter.rst > +++ b/doc/guides/prog_guide/event_timer_adapter.rst > @@ -252,6 +252,39 @@ be canceled by calling > ``rte_event_timer_cancel_burst()``: > */ > rte_event_timer_cancel_burst(adapter, &conn->timer, 1); >=20 > +Timer adapter in periodic mode > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +A periodic timer is a timer, which expires at fixed time intervals > +continuously till it is cancelled. A timer adapter can be configured > +to arm such timers by configuring it in periodic mode. Capability flag > +``RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC`` can be used to check if an > +adapter supports periodic mode. An adapter in periodic mode can only be > +used to arm periodic timers. > + > +Example config to create an adapter in periodic mode with 100ms > resolution: > + > +.. code-block:: c > + > + #define NSECPERSEC 1E9 // No of ns in 1 sec > + const struct rte_event_timer_adapter_conf adapter_config =3D { > + .event_dev_id =3D event_dev_id, > + .timer_adapter_id =3D 0, > + .clk_src =3D RTE_EVENT_TIMER_ADAPTER_CPU_CLK, > + .timer_tick_ns =3D NSECPERSEC / 10, // 100 milliseconds > + .nb_timers =3D 100, > + .timer_adapter_flags =3D RTE_EVENT_TIMER_ADAPTER_F_PERIO= DIC, > + }; > + > +``timer_adapter_flags`` is set to include periodic flag > +``RTE_EVENT_TIMER_ADAPTER_F_PERIODIC`` and ``timer_tick_ns`` to > resolution. > +Maximum timeout (``max_tmo_nsec``) does not apply for periodic mode. This content can be reworked slightly and moved into the "Create and Config= ure an Adapter Instance" section, perhaps as a subsection describing the tw= o adapter modes. > + > +After starting the adapter, event timer arm APIs can be used to arm > +periodic timers. Timer events will be generated at configured > +``timer_tick_ns`` intervals. Event generation can be stopped using > +cancel API ``rte_event_timer_cancel_burst``. > + I think this content should be worked into the "Arming Event Timers" sectio= n, indicating how the timer behavior depends on the mode of the adapter tha= t specified in the arm call. > Processing Timer Expiry Events > ------------------------------ >=20 > diff --git a/lib/librte_eventdev/rte_event_timer_adapter.h > b/lib/librte_eventdev/rte_event_timer_adapter.h > index d2ebcb090..f9fc95711 100644 > --- a/lib/librte_eventdev/rte_event_timer_adapter.h > +++ b/lib/librte_eventdev/rte_event_timer_adapter.h I think we should also update the doxygen documentation for the rte_event_t= imer_arm_burst to indicate that timer expiry events will be generated once = or periodically until the timer is stopped based on the mode of the adapter= that is specified. We can have a "see also" for the RTE_EVENT_TIMER_ADAPT= ER_F_PERIODIC flag. Thanks, Erik > @@ -151,6 +151,12 @@ enum rte_event_timer_adapter_clk_src { > * @see struct rte_event_timer_adapter_conf::flags > */ >=20 > +#define RTE_EVENT_TIMER_ADAPTER_F_PERIODIC (1ULL << 2) > +/**< Flag to configure event timer adapter in periodic mode. > + * > + * @see struct rte_event_timer_adapter_conf::flags > + */ > + > /** > * Timer adapter configuration structure > */