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 BF511A0C4C; Tue, 5 Oct 2021 16:45:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87EFA41344; Tue, 5 Oct 2021 16:45:22 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id BCD7E412D0 for ; Tue, 5 Oct 2021 16:45:20 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="225657599" X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="225657599" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 07:45:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="656586749" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga005.jf.intel.com with ESMTP; 05 Oct 2021 07:45:19 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 5 Oct 2021 07:45:19 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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.2242.12; Tue, 5 Oct 2021 07:45:18 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 5 Oct 2021 07:45:18 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) 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.2242.12; Tue, 5 Oct 2021 07:45:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MwZTm8WvjSv1l2IxGU9jz7gvk/Cj46FOJ2quAE3eGdkPoqjgIk4Vsao1TtBthhXgV0gGQOGzHazFS+VJthVyZp/IQfWHXvQGu5yHgnQHfhC+U+6khS5GzdPTnbb9cVnX3+KW+Vj3/FqieXBq0C+V6ejnNNxT9FhqbwKETkoY8fP61WwJVSu52Nvl0tH+HR6w0bzCtCDk7hiD416b4DeTCZfVvCxU9zt50GtCUTU0xgPYeJwvS3Khw9HpajtEO/pQ3ihiXbE3Pgj6BLBAWygpB3TW7j4N9zmocXqPq6FbsVmqEJ/XcKx6LNlMcYA7HuueU9XfGV+FP/Vd6dX3p2JAVw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uSaHEtdOs44kxllcQrxZbqntknqHibLpLVK0uumlfto=; b=LjDYyxlZ8N7LCvB1PUPT8VYzDify8FCNfuCyhRUxJf4rbKMMv2gpkkKv1O5saNJ1u5x/ncGOBeIXv7xxwZf/8yTL7xtcjRhH/5j+YlTJAz/gSiize2sbNZSlhzGVZJWn0jGqoQarOujWbh3CXf3WoRdd/WpkzR1F2XoWm0I9Sbb9UTptwiAQh8dzTYsX56gCMPVbqhyGUDDoNYZvrBniPzSAD2+D75LGzgwH7M4IvJ3rgnC4x6Jo/GE5LCupJTyrvV96q5952wzLXZz62+nK49mEUmkJju2tUdakVE0O/JY2W146H1pUzJY94IsmbJ/gB+J7IS6Dayc7Nd/D84rRJA== 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=uSaHEtdOs44kxllcQrxZbqntknqHibLpLVK0uumlfto=; b=nS+yEIpWhwJQemginm8rF00SaGOTcToB/NT8FElgeTB1ThiCIcKVPyGdOLCr7qF+S/O5ww0hEcX7PZmFn7iCrIcFqdBed+MJRvsSTB8tBwnKYr2rP9Fy8o1tfq9CgMg540nwAP8BoQ2BUMV2hbkAU45yrkiLXnNd+aZtrb5ZYnk= Received: from DM6PR11MB3868.namprd11.prod.outlook.com (2603:10b6:5:19f::13) by DM5PR11MB1243.namprd11.prod.outlook.com (2603:10b6:3:8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Tue, 5 Oct 2021 14:45:17 +0000 Received: from DM6PR11MB3868.namprd11.prod.outlook.com ([fe80::89fd:9564:349a:c59e]) by DM6PR11MB3868.namprd11.prod.outlook.com ([fe80::89fd:9564:349a:c59e%4]) with mapi id 15.20.4566.022; Tue, 5 Oct 2021 14:45:17 +0000 From: "Naga Harish K, S V" To: "Jayatheerthan, Jay" , "jerinj@marvell.com" CC: "dev@dpdk.org" , "Kundapura, Ganapati" Thread-Topic: [PATCH v5 1/5] eventdev/rx_adapter: add event buffer size configurability Thread-Index: AQHXuOJ2Eugu7ec2qUGGHGHf0wnn16vD8YoQgACJ6qA= Date: Tue, 5 Oct 2021 14:45:17 +0000 Message-ID: References: <20210930082901.293541-1-s.v.naga.harish.k@intel.com> <20211004054108.3890018-1-s.v.naga.harish.k@intel.com> In-Reply-To: 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.6.200.16 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2d0b4726-398e-4085-7cd2-08d9880ebf82 x-ms-traffictypediagnostic: DM5PR11MB1243: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:324; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XO4+agcfT+8DCwPK85hYGA2emN7o8YDSCrItnPGn7Q6KW50Z12+APpS6yhYWLJZYINBZxVom9dScTqurfiij3uNFq4uuHUbVflNp3drGNv4S/ZIzPwoCIv61LYVypsAJmQPVADimrReB4I2i4vstzxF8c7XpzLRSezPS3nioQo1cS1M83U9e1kvKLzErg45mCXc8F3ZuRIlyuBEZ7w6FHnXivTV/mXzjoQAbSgr4GlCbFAXEH2ipUVJxyXdS+AbNRDn5Jdlz8AeziWOC20KvogcKkY6e88aeDJS//y9P/AWm0yb4Bk1bm1D09HadgGA4VRZ+KZ3dMNPlNOfiJyc0zVf0Lel5Ri5qVsTLKlLumaCcV4aPtFSz4TaK9RK+CnpCcFmYQNDxZGp+VjiAJd/m3U/GOuIkMEY6Ve4hgLv6UjsXCbjaZPdLp8iu4cSwSkXhuNEQiUDSxaFwa/Arv7Plqahj/4BvLxRrvAiIsytL7Wl1Fsl/Ddmiu2C4xyuZuNxnufq+huWNGvIKoDlErybzhXoHwVEG3MKkYEO+RuWrfJXbeXxpHcVVaV/uIFM4VeK3ZtJML1ookW+CkwuKsy2SoDo0HAKijBZWBkskqP+qao0hbx7r1Ehn83MuH01s99bQ1RlKNToxiWRewAnOK6n4p5LtgGVqadvY2aTTQ05nNCkFa8e6KHypIwTcrjvvSzkxMQOyJZW/9sdJWngHgy86mw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3868.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(30864003)(33656002)(66476007)(66556008)(64756008)(66446008)(66946007)(6506007)(5660300002)(86362001)(508600001)(55236004)(53546011)(26005)(186003)(38100700002)(83380400001)(2906002)(122000001)(9686003)(7696005)(76116006)(4326008)(54906003)(110136005)(8676002)(107886003)(38070700005)(71200400001)(52536014)(316002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AkavioLbR8f6upxKcyAlFTKbWF0if3ZJTEMqNYrFI3KzmJbjSuH0ehYZJ0jT?= =?us-ascii?Q?ixxt+ya+JEvup2W6Rx+jc7rJGIczD//8vs3fGiDiLXVaYPuJS1TAcL+gvgF1?= =?us-ascii?Q?PiUWsKeBqRptOuAUJFcqBYFMr2lxPnCbIF7NMDxLY+Y6QPpfUHiJO16qH/Wv?= =?us-ascii?Q?UfP+IdsvPiNHHmbV5qhnLTF9TcApc7B4ZC91bcXAXakZq7CSSoYDk7x4CezM?= =?us-ascii?Q?zaVn9ejKS9BIEN8R29C0wAMC0m2ZgjetmCwS+Pc5nfZXLAPT5BktOUOT8Gu/?= =?us-ascii?Q?YgSOx7vlyFDXdLIqb11gPJgS68veN15CuFvtWb8Fv+l8Vsj32TNoxg8XMrEF?= =?us-ascii?Q?QYZb+mpQrSIJ9585zeL2G22p8lFMZQnLLNXuGRSliCGXfKO7tP51DSF+19Rx?= =?us-ascii?Q?da1H8XvfnXgTR1UnDDlCn6HeutUJPO6jXKXcJvtlHirozgqr81bmmU2nXee8?= =?us-ascii?Q?w05skgJpJi44Q1eHjugGQItXk7zIF+oMyluujpzormrBX/+xLLbJkZtAni6/?= =?us-ascii?Q?XyNmW550z4TsW2MV2QUCyns/XPu1pF7PdCY4GHdL5iXrnZ3asUPcQdh+f603?= =?us-ascii?Q?ykEIRE2PV4w/oGs2EomGfY85wXW1Zb/tnTQ15nze9drlAtvtCgkaqeI+9OrO?= =?us-ascii?Q?vqwtbxxfj1c/A2Kf8v73xqucRZJDawiNRbTnmxAhI0EUwu1J378J/ENtRaSO?= =?us-ascii?Q?wu9ihA8F3hvblQ9ElT5SrhY0OZ62RgHS+apmVqilKF2XdKtnu6OlgvKx0h7E?= =?us-ascii?Q?NGg+HGqk8yZUJRjCBatYe7rYsKm7HBlq48cwr+QSsy5ogia6WecwCNoaIvML?= =?us-ascii?Q?tmDXySdxAfPqExxb9HV6qcHNIstKdTgVegGrndvFFB9ggMr2MAUQZgr2+7/v?= =?us-ascii?Q?6REh9wYl6FEhRads7CTOPDJJR3+hOTrivUVlqlk4c/abR0qp44/E7L350L4o?= =?us-ascii?Q?Vepd5rINlLhEucHBzA9P/k5zZh5RvcV3fcNvuGjDQSoXV+FNX3/l3p9yzsU4?= =?us-ascii?Q?7Te8A7ymzjfiUa+PrQDG3s01DPs1SNidQuRus7UKdrDP7mPROELC3QMMi8sm?= =?us-ascii?Q?WHZglUKPwL0MrgBeCVIZkXp3EULgHlNQcwxU34b85t1yTKRrZrQLFdMjAa9j?= =?us-ascii?Q?DRS7z4nuvHuX/zQR/R6mYyWsbsOP6XLGZ4u+jmRGuZC4Cf03ryx9oruo/MDp?= =?us-ascii?Q?vgBrcGMpFjdUkHrkjL8P5JTq61F2Jlt1uZETYt/kfLuLnDvMsgzo6V3SySZl?= =?us-ascii?Q?Criu82M37HPHIDp3cSuoNSS+d2BJ9aS4jEPvhyjLjRp0XUThmcKwbxUUrWL5?= =?us-ascii?Q?nvE=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: DM6PR11MB3868.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d0b4726-398e-4085-7cd2-08d9880ebf82 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2021 14:45:17.2835 (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: lLKG7nXehRAh8Z6d60sOypsB1pQJArg9JTdz3xFZ56rJ5bE94ms+pl0I3t4EttFeYX/NBSIixhFxIBLnmAUzOHRyam9NN3oM2+2XVI79bj4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1243 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 1/5] eventdev/rx_adapter: add event buffer size configurability 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 Jay, > -----Original Message----- > From: Jayatheerthan, Jay > Sent: Tuesday, October 5, 2021 12:49 PM > To: Naga Harish K, S V ; jerinj@marvell.com > Cc: dev@dpdk.org; Kundapura, Ganapati > Subject: RE: [PATCH v5 1/5] eventdev/rx_adapter: add event buffer size > configurability >=20 > > -----Original Message----- > > From: Naga Harish K, S V > > Sent: Monday, October 4, 2021 11:11 AM > > To: jerinj@marvell.com; Jayatheerthan, Jay > > > > Cc: dev@dpdk.org; Kundapura, Ganapati > > Subject: [PATCH v5 1/5] eventdev/rx_adapter: add event buffer size > > configurability > > > > Currently event buffer is static array with a default size defined > > internally. > > > > To configure event buffer size from application, > > ``rte_event_eth_rx_adapter_create_with_params`` api is added which > > takes ``struct rte_event_eth_rx_adapter_params`` to configure event > > buffer size in addition other params . The event buffer size is > > rounded up for better buffer utilization and performance . In case of > > NULL params argument, default event buffer size is used. > > > > Signed-off-by: Naga Harish K S V > > Signed-off-by: Ganapati Kundapura > > > > --- > > v5: > > * reverted queue conf get unit test change > > > > v4: > > * rebased with latest dpdk-next-eventdev branch > > * changed queue conf get unit test > > > > v3: > > * updated documentation and code comments as per review comments. > > * updated new create api test case name with suitable one. > > > > v2: > > * Updated header file and rx adapter documentation as per review > comments. > > * new api name is modified as > rte_event_eth_rx_adapter_create_with_params > > as per review comments. > > * rxa_params pointer argument Value NULL is allowed to represent the > > default values > > > > v1: > > * Initial implementation with documentation and unit tests. > > --- > > --- > > .../prog_guide/event_ethernet_rx_adapter.rst | 7 ++ > > lib/eventdev/rte_event_eth_rx_adapter.c | 98 +++++++++++++++++-- > > lib/eventdev/rte_event_eth_rx_adapter.h | 41 +++++++- > > lib/eventdev/version.map | 2 + > > 4 files changed, 140 insertions(+), 8 deletions(-) > > > > diff --git a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > > b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > > index ce23d8a474..8526aecf57 100644 > > --- a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > > +++ b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > > @@ -62,6 +62,13 @@ service function and needs to create an event port > > for it. The callback is expected to fill the ``struct > > rte_event_eth_rx_adapter_conf structure`` passed to it. > > > > +If the application desires to control the event buffer size, it can > > +use the ``rte_event_eth_rx_adapter_create_with_params()`` api. The > > +event buffer size is specified using ``struct > rte_event_eth_rx_adapter_params::event_buf_size``. > > +The function is passed the event device to be associated with the > > +adapter and port configuration for the adapter to setup an event port > > +if the adapter needs to use a service function. > > + > > Adding Rx Queues to the Adapter Instance > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > > b/lib/eventdev/rte_event_eth_rx_adapter.c > > index 10491ca07b..606db241b8 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > @@ -85,7 +85,9 @@ struct rte_eth_event_enqueue_buffer { > > /* Count of events in this buffer */ > > uint16_t count; > > /* Array of events in this buffer */ > > - struct rte_event events[ETH_EVENT_BUFFER_SIZE]; > > + struct rte_event *events; > > + /* size of event buffer */ > > + uint16_t events_size; > > /* Event enqueue happens from head */ > > uint16_t head; > > /* New packets from rte_eth_rx_burst is enqued from tail */ @@ > > -946,7 +948,7 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter > *rx_adapter, > > dropped =3D 0; > > nb_cb =3D dev_info->cb_fn(eth_dev_id, rx_queue_id, > > buf->last | > > - (RTE_DIM(buf->events) & ~buf- > >last_mask), > > + (buf->events_size & ~buf->last_mask), > > buf->count >=3D BATCH_SIZE ? > > buf->count - BATCH_SIZE : 0, > > &buf->events[buf->tail], > > @@ -972,7 +974,7 @@ rxa_pkt_buf_available(struct > rte_eth_event_enqueue_buffer *buf) > > uint32_t nb_req =3D buf->tail + BATCH_SIZE; > > > > if (!buf->last) { > > - if (nb_req <=3D RTE_DIM(buf->events)) > > + if (nb_req <=3D buf->events_size) > > return true; > > > > if (buf->head >=3D BATCH_SIZE) { > > @@ -2206,12 +2208,15 @@ rxa_ctrl(uint8_t id, int start) > > return 0; > > } > > > > -int > > -rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, > > - rte_event_eth_rx_adapter_conf_cb > conf_cb, > > - void *conf_arg) > > +static int > > +rxa_create(uint8_t id, uint8_t dev_id, > > + struct rte_event_eth_rx_adapter_params *rxa_params, > > + rte_event_eth_rx_adapter_conf_cb conf_cb, > > + void *conf_arg) > > { > > struct rte_event_eth_rx_adapter *rx_adapter; > > + struct rte_eth_event_enqueue_buffer *buf; > > + struct rte_event *events; > > int ret; > > int socket_id; > > uint16_t i; > > @@ -2226,6 +2231,7 @@ rte_event_eth_rx_adapter_create_ext(uint8_t > id, > > uint8_t dev_id, > > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, - > EINVAL); > > RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > > + > > if (conf_cb =3D=3D NULL) > > return -EINVAL; > > > > @@ -2273,11 +2279,30 @@ > rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, > > rte_free(rx_adapter); > > return -ENOMEM; > > } > > + > > rte_spinlock_init(&rx_adapter->rx_lock); > > + > > for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) > > rx_adapter->eth_devices[i].dev =3D &rte_eth_devices[i]; > > > > + /* Rx adapter event buffer allocation */ > > + buf =3D &rx_adapter->event_enqueue_buffer; > > + buf->events_size =3D RTE_ALIGN(rxa_params->event_buf_size, > > +BATCH_SIZE); >=20 > Do we need to align event_buf_size again here ? The caller seems to take > care of it. It is redundant, and is removed in v6 patchset. >=20 > > + > > + events =3D rte_zmalloc_socket(rx_adapter->mem_name, > > + buf->events_size * sizeof(*events), > > + 0, socket_id); > > + if (events =3D=3D NULL) { > > + RTE_EDEV_LOG_ERR("Failed to allocate mem for event > buffer\n"); > > + rte_free(rx_adapter->eth_devices); > > + rte_free(rx_adapter); > > + return -ENOMEM; > > + } > > + > > + rx_adapter->event_enqueue_buffer.events =3D events; > > + > > event_eth_rx_adapter[id] =3D rx_adapter; > > + > > if (conf_cb =3D=3D rxa_default_conf_cb) > > rx_adapter->default_cb_arg =3D 1; > > > > @@ -2293,6 +2318,61 @@ rte_event_eth_rx_adapter_create_ext(uint8_t > id, uint8_t dev_id, > > return 0; > > } > > > > +int > > +rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, > > + rte_event_eth_rx_adapter_conf_cb > conf_cb, > > + void *conf_arg) > > +{ > > + struct rte_event_eth_rx_adapter_params rxa_params; >=20 > Can initialize rxa_params in case if more fields get added in future that= we > don't assign here. Done >=20 > > + > > + /* use default values for adapter params */ > > + rxa_params.event_buf_size =3D ETH_EVENT_BUFFER_SIZE; > > + > > + return rxa_create(id, dev_id, &rxa_params, conf_cb, conf_arg); } > > + > > +int > > +rte_event_eth_rx_adapter_create_with_params(uint8_t id, uint8_t > dev_id, > > + struct rte_event_port_conf *port_config, > > + struct rte_event_eth_rx_adapter_params > *rxa_params) { > > + struct rte_event_port_conf *pc; > > + int ret; > > + struct rte_event_eth_rx_adapter_params temp_params =3D {0}; > > + > > + if (port_config =3D=3D NULL) > > + return -EINVAL; > > + > > + /* use default values if rxa_parmas is NULL */ > > + if (rxa_params =3D=3D NULL) { > > + rxa_params =3D &temp_params; > > + rxa_params->event_buf_size =3D ETH_EVENT_BUFFER_SIZE; > > + } > > + > > + if (rxa_params->event_buf_size =3D=3D 0) > > + return -EINVAL; > > + > > + pc =3D rte_malloc(NULL, sizeof(*pc), 0); > > + if (pc =3D=3D NULL) > > + return -ENOMEM; > > + > > + *pc =3D *port_config; > > + > > + /* adjust event buff size with BATCH_SIZE used for fetching packets > > + * from NIC rx queues to get full buffer utilization and prevent > > + * unnecessary rollovers. > > + */ > > + rxa_params->event_buf_size =3D RTE_ALIGN(rxa_params- > >event_buf_size, > > + BATCH_SIZE); > > + rxa_params->event_buf_size +=3D BATCH_SIZE + BATCH_SIZE; >=20 > Please add brackets to be more explicit and readable. Done >=20 > > + > > + ret =3D rxa_create(id, dev_id, rxa_params, rxa_default_conf_cb, pc); > > + if (ret) > > + rte_free(pc); > > + > > + return ret; > > +} > > + > > int > > rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, > > struct rte_event_port_conf *port_config) @@ -2302,12 > +2382,14 @@ > > rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, > > > > if (port_config =3D=3D NULL) > > return -EINVAL; > > + > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, - > EINVAL); > > > > pc =3D rte_malloc(NULL, sizeof(*pc), 0); > > if (pc =3D=3D NULL) > > return -ENOMEM; > > *pc =3D *port_config; > > + > > ret =3D rte_event_eth_rx_adapter_create_ext(id, dev_id, > > rxa_default_conf_cb, > > pc); > > @@ -2336,6 +2418,7 @@ rte_event_eth_rx_adapter_free(uint8_t id) > > if (rx_adapter->default_cb_arg) > > rte_free(rx_adapter->conf_arg); > > rte_free(rx_adapter->eth_devices); > > + rte_free(rx_adapter->event_enqueue_buffer.events); > > rte_free(rx_adapter); > > event_eth_rx_adapter[id] =3D NULL; > > > > @@ -2711,6 +2794,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > > > > stats->rx_packets +=3D dev_stats_sum.rx_packets; > > stats->rx_enq_count +=3D dev_stats_sum.rx_enq_count; > > + > > return 0; > > } > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > index 470543e434..846ca569e9 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > @@ -26,6 +26,7 @@ > > * The ethernet Rx event adapter's functions are: > > * - rte_event_eth_rx_adapter_create_ext() > > * - rte_event_eth_rx_adapter_create() > > + * - rte_event_eth_rx_adapter_create_with_params() > > * - rte_event_eth_rx_adapter_free() > > * - rte_event_eth_rx_adapter_queue_add() > > * - rte_event_eth_rx_adapter_queue_del() > > @@ -37,7 +38,7 @@ > > * > > * The application creates an ethernet to event adapter using > > * rte_event_eth_rx_adapter_create_ext() or > > rte_event_eth_rx_adapter_create() > > - * functions. > > + * or rte_event_eth_rx_adapter_create_with_params() functions. > > * The adapter needs to know which ethernet rx queues to poll for mbuf= s > as well > > * as event device parameters such as the event queue identifier, even= t > > * priority and scheduling type that the adapter should use when > > constructing @@ -257,6 +258,17 @@ struct > rte_event_eth_rx_adapter_vector_limits { > > */ > > }; > > > > +/** > > + * A structure to hold adapter config params */ struct > > +rte_event_eth_rx_adapter_params { > > + uint16_t event_buf_size; > > + /**< size of event buffer for the adapter. > > + * This value is rounded up for better buffer utilization > > + * and performance. > > + */ > > +}; > > + > > /** > > * > > * Callback function invoked by the SW adapter before it continues @@ > > -357,6 +369,33 @@ int rte_event_eth_rx_adapter_create_ext(uint8_t id, > > uint8_t dev_id, int rte_event_eth_rx_adapter_create(uint8_t id, uint8_= t > dev_id, > > struct rte_event_port_conf *port_config); > > > > +/** > > + * This is a variant of rte_event_eth_rx_adapter_create() with > > +additional > > + * adapter params specified in ``struct > rte_event_eth_rx_adapter_params``. > > + * > > + * @param id > > + * The identifier of the ethernet Rx event adapter. > > + * > > + * @param dev_id > > + * The identifier of the event device to configure. > > + * > > + * @param port_config > > + * Argument of type *rte_event_port_conf* that is passed to the > > +conf_cb > > + * function. > > + * > > + * @param rxa_params > > + * Pointer to struct rte_event_eth_rx_adapter_params. > > + * In case of NULL, default values are used. > > + * > > + * @return > > + * - 0: Success > > + * - <0: Error code on failure > > + */ > > +__rte_experimental > > +int rte_event_eth_rx_adapter_create_with_params(uint8_t id, uint8_t > dev_id, > > + struct rte_event_port_conf *port_config, > > + struct rte_event_eth_rx_adapter_params > *rxa_params); > > + > > /** > > * Free an event adapter > > * > > diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map index > > 9f280160fa..7de18497a6 100644 > > --- a/lib/eventdev/version.map > > +++ b/lib/eventdev/version.map > > @@ -138,6 +138,8 @@ EXPERIMENTAL { > > __rte_eventdev_trace_port_setup; > > # added in 20.11 > > rte_event_pmd_pci_probe_named; > > + # added in 21.11 > > + rte_event_eth_rx_adapter_create_with_params; > > > > #added in 21.05 > > rte_event_vector_pool_create; > > -- > > 2.25.1